Multisite builds are currently broken under new native theme changes


(Dean Taylor) #1

Currently having an issue building - could it be the new Native Theme changes @sam?

Compiling css for discourse 2017-04-12 18:51:49 UTC
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "themes" does not exist
LINE 1: SELECT "themes"."key", "themes"."name" FROM "themes" WHERE (...
                                                    ^
: SELECT "themes"."key", "themes"."name" FROM "themes" WHERE (user_selectable OR key = NULL)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
/var/www/discourse/lib/freedom_patches/fast_pluck.rb:41:in `select_raw'
/var/www/discourse/lib/freedom_patches/fast_pluck.rb:67:in `pluck'
/var/www/discourse/lib/stylesheet/manager.rb:47:in `precompile_css'
/var/www/discourse/lib/tasks/assets.rake:54:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:126:in `block in each_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each_connection'
/var/www/discourse/lib/tasks/assets.rake:48:in `block in <top (required)>'
/var/www/discourse/lib/tasks/assets.rake:185:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
PG::UndefinedTable: ERROR:  relation "themes" does not exist
LINE 1: SELECT "themes"."key", "themes"."name" FROM "themes" WHERE (...
                                                    ^
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
/var/www/discourse/lib/freedom_patches/fast_pluck.rb:41:in `select_raw'
/var/www/discourse/lib/freedom_patches/fast_pluck.rb:67:in `pluck'
/var/www/discourse/lib/stylesheet/manager.rb:47:in `precompile_css'
/var/www/discourse/lib/tasks/assets.rake:54:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:126:in `block in each_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each_connection'
/var/www/discourse/lib/tasks/assets.rake:48:in `block in <top (required)>'
/var/www/discourse/lib/tasks/assets.rake:185:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => assets:precompile:css
(See full trace by running task with --trace)
I, [2017-04-12T18:59:49.177113 #13]  INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 2959 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}

(Sam Saffron) #2

sounds to me like your migrations have not run correctly, do a rebuild.


(Dean Taylor) #3

I’ve ran a rebuild 3 times now.


(Sam Saffron) #4

hmmm what is the output of db:migrate ?


(Dean Taylor) #5
I, [2017-04-12T19:06:29.741554 #13]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
I, [2017-04-12T19:06:35.882110 #13]  INFO -- : 
== Seed from /var/www/discourse/db/fixtures/001_categories.rb

== Seed from /var/www/discourse/db/fixtures/002_groups.rb

== Seed from /var/www/discourse/db/fixtures/003_post_action_types.rb
 - PostActionType {:id=>1, :name_key=>"bookmark", :is_flag=>false, :position=>1}
 - PostActionType {:id=>2, :name_key=>"like", :is_flag=>false, :icon=>"heart", :position=>2}
 - PostActionType {:id=>3, :name_key=>"off_topic", :is_flag=>true, :position=>3}
 - PostActionType {:id=>4, :name_key=>"inappropriate", :is_flag=>true, :position=>4}
 - PostActionType {:id=>5, :name_key=>"vote", :is_flag=>false, :position=>5}
 - PostActionType {:id=>8, :name_key=>"spam", :is_flag=>true, :position=>6}
 - PostActionType {:id=>6, :name_key=>"notify_user", :is_flag=>true, :position=>7}
 - PostActionType {:id=>7, :name_key=>"notify_moderators", :is_flag=>true, :position=>8}

== Seed from /var/www/discourse/db/fixtures/004_screened_ip_addresses.rb
 - ScreenedIpAddress {:id=>1, :ip_address=>"10.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>2, :ip_address=>"192.168.0.0/16", :action_type=>2}
 - ScreenedIpAddress {:id=>3, :ip_address=>"127.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>4, :ip_address=>"172.16.0.0/12", :action_type=>2}
 - ScreenedIpAddress {:id=>5, :ip_address=>"fc00::/7", :action_type=>2}

== Seed from /var/www/discourse/db/fixtures/005_badge_types.rb
 - BadgeType {:id=>1, :name=>"Gold"}
 - BadgeType {:id=>2, :name=>"Silver"}
 - BadgeType {:id=>3, :name=>"Bronze"}

== Seed from /var/www/discourse/db/fixtures/006_badges.rb
 - BadgeGrouping {:id=>1, :name=>"Getting Started", :default_position=>10}
 - BadgeGrouping {:id=>2, :name=>"Community", :default_position=>11}
 - BadgeGrouping {:id=>3, :name=>"Posting", :default_position=>12}
 - BadgeGrouping {:id=>4, :name=>"Trust Level", :default_position=>13}
 - BadgeGrouping {:id=>5, :name=>"Other", :default_position=>14}
 - Badge {:id=>1, :name=>"Basic User", :badge_type_id=>3, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 1 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>2, :name=>"Member", :badge_type_id=>3, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 2 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>3, :name=>"Regular", :badge_type_id=>2, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 3 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>4, :name=>"Leader", :badge_type_id=>1, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 4 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>17, :name=>"Reader", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"  SELECT id user_id, current_timestamp granted_at\n  FROM users\n  WHERE id IN\n  (\n    SELECT pt.user_id\n    FROM post_timings pt\n    JOIN badge_posts b ON b.post_number = pt.post_number AND\n                          b.topic_id = pt.topic_id\n    JOIN topics t ON t.id = pt.topic_id\n    LEFT JOIN user_badges ub ON ub.badge_id = 17 AND ub.user_id = pt.user_id\n    WHERE ub.id IS NULL AND t.posts_count > 100\n    GROUP BY pt.user_id, pt.topic_id, t.posts_count\n    HAVING count(*) >= t.posts_count\n  )\n", :default_badge_grouping_id=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>16, :name=>"Read Guidelines", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"  SELECT user_id, read_faq granted_at\n  FROM user_stats\n  WHERE read_faq IS NOT NULL AND (user_id IN (:user_ids) OR :backfill)\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>14, :name=>"First Link", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT l.user_id, l.post_id, l.created_at granted_at\n  FROM\n  (\n    SELECT MIN(l1.id) id\n    FROM topic_links l1\n    JOIN badge_posts p1 ON p1.id = l1.post_id\n    JOIN badge_posts p2 ON p2.id = l1.link_post_id\n    WHERE NOT reflection AND p1.topic_id <> p2.topic_id AND not quote AND\n      (:backfill OR ( p1.id in (:post_ids) ))\n    GROUP BY l1.user_id\n  ) ids\n  JOIN topic_links l ON l.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>15, :name=>"First Quote", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT ids.user_id, q.post_id, q.created_at granted_at\n  FROM\n  (\n    SELECT p1.user_id, MIN(q1.id) id\n    FROM quoted_posts q1\n    JOIN badge_posts p1 ON p1.id = q1.post_id\n    JOIN badge_posts p2 ON p2.id = q1.quoted_post_id\n    WHERE (:backfill OR ( p1.id IN (:post_ids) ))\n    GROUP BY p1.user_id\n  ) ids\n  JOIN quoted_posts q ON q.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>11, :name=>"First Like", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n  FROM (\n    SELECT pa.user_id, min(pa.id) id\n    FROM post_actions pa\n    JOIN badge_posts p on p.id = pa.post_id\n    WHERE post_action_type_id = 2 AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n    GROUP BY pa.user_id\n  ) x\n  JOIN post_actions pa1 on pa1.id = x.id\n", :default_badge_grouping_id=>1, :trigger=>1, :system=>true}
 - Badge {:id=>13, :name=>"First Flag", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>false, :query=>"  SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n  FROM (\n    SELECT pa.user_id, min(pa.id) id\n    FROM post_actions pa\n    JOIN badge_posts p on p.id = pa.post_id\n    WHERE post_action_type_id IN (3,4,7,8) AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n    GROUP BY pa.user_id\n  ) x\n  JOIN post_actions pa1 on pa1.id = x.id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>25, :name=>"Promoter", :default_icon=>"fa-user-plus", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 1\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>26, :name=>"Campaigner", :default_icon=>"fa-user-plus", :badge_type_id=>2, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 1 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 3\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>27, :name=>"Champion", :default_icon=>"fa-user-plus", :badge_type_id=>1, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 2 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 5\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>12, :name=>"First Share", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, i2.created_at granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>21, :name=>"Nice Share", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 25\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>22, :name=>"Good Share", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 300\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>23, :name=>"Great Share", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 1000\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>5, :name=>"Welcome", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT p.user_id, min(post_id) post_id, min(pa.created_at) granted_at\n  FROM post_actions pa\n  JOIN badge_posts p on p.id = pa.post_id\n  WHERE post_action_type_id = 2 AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n  GROUP BY p.user_id\n", :default_badge_grouping_id=>2, :trigger=>1, :system=>true}
 - Badge {:id=>9, :name=>"Autobiographer", :badge_type_id=>3, :multiple_grant=>false, :query=>"  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  JOIN user_profiles up on u.id = up.user_id\n  WHERE bio_raw IS NOT NULL AND LENGTH(TRIM(bio_raw)) > 10 AND\n        uploaded_avatar_id IS NOT NULL AND\n        (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>10, :name=>"Editor", :badge_type_id=>3, :multiple_grant=>false, :query=>"  SELECT p.user_id, min(p.id) post_id, min(p.created_at) granted_at\n  FROM badge_posts p\n  WHERE p.self_edits > 0 AND\n      (:backfill OR p.id IN (:post_ids) )\n  GROUP BY p.user_id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>6, :name=>"Nice Post", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 10 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>7, :name=>"Good Post", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 25 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>8, :name=>"Great Post", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 50 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>18, :name=>"Nice Topic", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 10 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>19, :name=>"Good Topic", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 25 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>20, :name=>"Great Topic", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 50 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>24, :name=>"Anniversary", :default_icon=>"fa-clock-o", :badge_type_id=>2, :query=>"  SELECT u.id AS user_id, MIN(u.created_at + interval '1 year') AS granted_at\n    FROM users u\n    JOIN posts p ON p.user_id = u.id\n   WHERE u.id > 0\n     AND u.active\n     AND NOT u.blocked\n     AND u.created_at + interval '1 year' < now()\n     AND p.deleted_at IS NULL\n     AND NOT p.hidden\n     AND p.created_at + interval '1 year' > now()\n     AND (:backfill OR u.id IN (:user_ids))\n   GROUP BY u.id\n   HAVING COUNT(p.id) > 0\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>28, :name=>"Popular Link", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 50\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>29, :name=>"Hot Link", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 300\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>30, :name=>"Famous Link", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 1000\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>36, :name=>"Appreciated", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 1\n        AND (:backfill OR p.user_id IN (:user_ids))\n      GROUP BY p.user_id\n      HAVING count(*) > 20\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>37, :name=>"Respected", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 2\n        AND (:backfill OR p.user_id IN (:user_ids))\n GROUP BY p.user_id\n      HAVING count(*) > 100\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>31, :name=>"Admired", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 5\n        AND (:backfill OR p.user_id IN (:user_ids))\n      GROUP BY p.user_id\n      HAVING count(*) > 300\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>38, :name=>"Thank You", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 10\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 20\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>32, :name=>"Gives Back", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 100\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 100\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>39, :name=>"Empathetic", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 1000\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 500\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>33, :name=>"Out of Love", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 1\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>34, :name=>"Higher Love", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 5\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>35, :name=>"Crazy in Love", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 20\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>40, :name=>"First Mention", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT acting_user_id AS user_id, min(target_post_id) AS post_id, min(p.created_at) AS granted_at\n  FROM user_actions\n  JOIN posts p ON p.id = target_post_id\n  JOIN topics t ON t.id = topic_id\n  JOIN categories c on c.id = category_id\n  WHERE action_type = 7\n    AND NOT read_restricted\n    AND p.deleted_at IS  NULL\n    AND t.deleted_at IS  NULL\n    AND t.visible\n    AND t.archetype <> 'private_message'\n    AND (:backfill OR p.id IN (:post_ids))\n  GROUP BY acting_user_id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>41, :name=>"First Emoji", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>42, :name=>"First Onebox", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>43, :name=>"First Reply By Email", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>44, :name=>"New User of the Month", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>0, :system=>true}

== Seed from /var/www/discourse/db/fixtures/007_web_hook_event_types.rb
 - WebHookEventType {:id=>1, :name=>"topic"}
 - WebHookEventType {:id=>2, :name=>"post"}
 - WebHookEventType {:id=>3, :name=>"user"}

== Seed from /var/www/discourse/db/fixtures/009_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"xxx", :active=>true, :admin=>true, :moderator=>true, :approved=>true, :trust_level=>4}

== Seed from /var/www/discourse/db/fixtures/500_lounge_category.rb

== Seed from /var/www/discourse/db/fixtures/501_meta_category.rb

== Seed from /var/www/discourse/db/fixtures/502_staff_category.rb

== Seed from /var/www/discourse/db/fixtures/999_settings.rb

== Seed from /var/www/discourse/db/fixtures/999_topics.rb

(Dean Taylor) #6

This hint enabled me to track it down, it was because the:
bundle exec rake multisite:migrate
had not ran before
bundle exec rake assets:precompile on a multisite install.

The standard multisite install instructions include adding this:

 after_bundle_exec:
    - exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate

However the web.template.yml file contains this:

  - exec:
      cd: $home
      hook: bundle_exec
      cmd:
        - su discourse -c 'bundle install --deployment --verbose --without test --without development'
        - su discourse -c 'bundle exec rake db:migrate'
        - su discourse -c 'bundle exec rake assets:precompile'

Changing it to this temporarily allowed the build to complete:

  - exec:
      cd: $home
      hook: bundle_exec
      cmd:
        - su discourse -c 'bundle install --deployment --verbose --without test --without development'
        - su discourse -c 'bundle exec rake db:migrate'
        - su discourse -c 'bundle exec rake multisite:migrate'
        - su discourse -c 'bundle exec rake assets:precompile'

So bundle exec rake assets:precompile is executed after the multisite migrate / db command.

Thanks for your support!


(Sam Saffron) #7

Can you edit the howto to correct the instructions?


(Dean Taylor) #8

It’s not that easy - there is no simple way for editing the middle of a hook.

I don’t think editing the web.template.yml should be part of the instructions here?

EDIT:
I could add a new hook (say db_migrate) to web.template.yml and update the instructions…
… however that would still leave broken multisite installs out there that would need their container .yml files updating.


(Jeff Atwood) #9

I would add a

:warning: section

to the instructions maybe?


(Dean Taylor) #10

With my serious lack of knowledge in this area I see a couple more ways of dealing with the issue…

Where options 1 & 2 leave existing multisite installs requiring a manual container .yml file change (broken on update).

1. Add a new hook (say db_migrate) to web.template.yml

As mentioned in previous post.

2. Execute bundle install and db:migrate multiple times for multsite installs

We can avoid changing web.template.yml, this does mean that bundle install and db:migrate are executed twice, only a minor increase in build time.

Getting the user to change their multisite container from:

  after_bundle_exec:
    - exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate`

To:

  before_bundle_exec:
    - exec:
        cd: $home
        cmd:
          - su discourse -c 'bundle install --deployment --verbose --without test --without development'
          - su discourse -c 'bundle exec rake db:migrate'
          - su discourse -c 'bundle exec rake multisite:migrate'

3. Get db:migrate to check for multisite

db:migrate could perhaps be changed to check for multisite.yml and execute multisite:migrate as needed.


I could implement #1 or #2 - but they don’t look like the best solutions and yes a :warning: message would be good for both #1 and #2.

For the moment I’ve gone with #2 for my install as it was a simple change to a single file.


(Sam Saffron) #11

OK I have a fix for this, no changes needed :slight_smile:


(Dean Taylor) #12

This happened again with a more recent change:

precompile target: desktop Default
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column theme_fields.type_id does not exist
LINE 1: ...e_fields" WHERE "theme_fields"."theme_id" = 1 AND "theme_fie...
                                                             ^
HINT:  Perhaps you meant to reference the column "theme_fields.theme_id".
: SELECT "theme_fields".* FROM "theme_fields" WHERE "theme_fields"."theme_id" = 1 AND "theme_fields"."type_id" IN (2, 3, 4)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.2/lib/patches/db/pg.rb:90:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.2/lib/patches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:356:in `select'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/querying.rb:39:in `find_by_sql'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:639:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/association_relation.rb:32:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:515:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:243:in `to_a'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation/delegation.rb:46:in `each'
/var/www/discourse/lib/stylesheet/importer.rb:42:in `block in <class:Importer>'
/var/www/discourse/lib/stylesheet/importer.rb:133:in `instance_eval'
/var/www/discourse/lib/stylesheet/importer.rb:133:in `imports'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/import_handler.rb:29:in `block in import_function'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/engine.rb:40:in `compile_data_context'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/engine.rb:40:in `render'
/var/www/discourse/lib/stylesheet/compiler.rb:47:in `compile'
/var/www/discourse/lib/stylesheet/compiler.rb:29:in `compile_asset'
/var/www/discourse/lib/stylesheet/manager.rb:124:in `compile'
/var/www/discourse/lib/stylesheet/manager.rb:66:in `block (2 levels) in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:60:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:60:in `block in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:59:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:59:in `precompile_css'
/var/www/discourse/lib/tasks/assets.rake:54:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:126:in `block in each_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each_connection'
/var/www/discourse/lib/tasks/assets.rake:48:in `block in <top (required)>'
/var/www/discourse/lib/tasks/assets.rake:199:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
PG::UndefinedColumn: ERROR:  column theme_fields.type_id does not exist
LINE 1: ...e_fields" WHERE "theme_fields"."theme_id" = 1 AND "theme_fie...
                                                             ^
HINT:  Perhaps you meant to reference the column "theme_fields.theme_id".
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.2/lib/patches/db/pg.rb:90:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.2/lib/patches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:356:in `select'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/querying.rb:39:in `find_by_sql'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:639:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/association_relation.rb:32:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:515:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation.rb:243:in `to_a'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/relation/delegation.rb:46:in `each'
/var/www/discourse/lib/stylesheet/importer.rb:42:in `block in <class:Importer>'
/var/www/discourse/lib/stylesheet/importer.rb:133:in `instance_eval'
/var/www/discourse/lib/stylesheet/importer.rb:133:in `imports'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/import_handler.rb:29:in `block in import_function'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/engine.rb:40:in `compile_data_context'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/sassc-1.11.2/lib/sassc/engine.rb:40:in `render'
/var/www/discourse/lib/stylesheet/compiler.rb:47:in `compile'
/var/www/discourse/lib/stylesheet/compiler.rb:29:in `compile_asset'
/var/www/discourse/lib/stylesheet/manager.rb:124:in `compile'
/var/www/discourse/lib/stylesheet/manager.rb:66:in `block (2 levels) in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:60:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:60:in `block in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:59:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:59:in `precompile_css'
/var/www/discourse/lib/tasks/assets.rake:54:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:126:in `block in each_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rails_multisite-1.0.6/lib/rails_multisite/connection_management.rb:124:in `each_connection'
/var/www/discourse/lib/tasks/assets.rake:48:in `block in <top (required)>'
/var/www/discourse/lib/tasks/assets.rake:199:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => assets:precompile:css
(See full trace by running task with --trace)
I, [2017-05-05T17:04:50.984432 #13]  INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 15983 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
6e93fd7888c63b58358a44c02ff336101bdd94d0e7befa0cf1f6277d4dd74256
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Used Fix #2 mentioned here to work around it.


(Sam Saffron) #13

hmmm … this is tricky, will only happen between betas … will put some extra protection.

Try this:


(Dean Taylor) #14

I’m unable run it again to see the error because I’m all upgraded - but thought you should know.

Thanks!


(Kane York) #15

Couldn’t we just update the default template to just always run multisite:migrate? It just wraps db:migrate in RailsMultisite::ConnectionManagement.each_connection which works fine for a single database, no?