Dl-custom-content plugin causes error during upgrade


(Vissie) #1

Good day,

I am having issues upgrading our discourse. I made sure that docker is updated, all os updates installed. Look like it is having issues upgrading the database.

2017-11-06 21:09:35.048 UTC [772] discourse@discourse LOG:  duration: 161.633 ms  statement:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                             pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                             c.collname, col_description(a.attrelid, a.attnum) AS comment
                        FROM pg_attribute a
                        LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                        LEFT JOIN pg_type t ON a.atttypid = t.oid
                        LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
                       WHERE a.attrelid = '"users"'::regclass
                         AND a.attnum > 0 AND NOT a.attisdropped
                       ORDER BY a.attnum

2017-11-06 21:09:35.195 UTC [772] discourse@discourse LOG:  duration: 136.413 ms  bind <unnamed>: SELECT COUNT(*) FROM (SELECT  1 FROM "users" LIMIT 20) subquery_for_count
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/var/www/discourse/plugins/dl-custom-content/plugin.rb:9:in `block (2 levels) in activate!'
/var/www/discourse/plugins/dl-custom-content/plugin.rb:8:in `class_eval'
/var/www/discourse/plugins/dl-custom-content/plugin.rb:8:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:269:in `block in notify_after_initialize'
/var/www/discourse/lib/plugin/instance.rb:267:in `each'
/var/www/discourse/lib/plugin/instance.rb:267:in `notify_after_initialize'
/var/www/discourse/config/application.rb:211:in `each'
/var/www/discourse/config/application.rb:211:in `block in <class:Application>'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:67:in `block in execute_hook'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:73:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
I, [2017-11-06T21:09:38.582242 #15]  INFO -- :
I, [2017-11-06T21:09:38.605397 #15]  INFO -- : Terminating async processes
I, [2017-11-06T21:09:38.605546 #15]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 44
I, [2017-11-06T21:09:38.605681 #15]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 158
2017-11-06 21:09:38.605 UTC [44] LOG:  received fast shutdown request
2017-11-06 21:09:38.605 UTC [44] LOG:  aborting any active transactions
2017-11-06 21:09:38.605 UTC [59] LOG:  autovacuum launcher shutting down
158:signal-handler (1510002578) Received SIGTERM scheduling shutdown...
2017-11-06 21:09:38.610 UTC [55] LOG:  shutting down
2017-11-06 21:09:38.653 UTC [55] LOG:  database system is shut down
158:M 06 Nov 21:09:38.701 # User requested shutdown...
158:M 06 Nov 21:09:38.701 * Saving the final RDB snapshot before exiting.
158:M 06 Nov 21:09:39.221 * DB saved on disk
158:M 06 Nov 21:09:39.221 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 751 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'"]}
121b50f162ef58dac81aad785043aa8691fe0574f608875b41b4d80ecc3849b0
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Version v1.9.0.beta4 +268

Does anyone know how I can resolve this?


How do I manually update Discourse and Docker image to latest?
(David Taylor) #2

Looks like the error is being caused by the dl-custom-content plugin. Try removing it.

cc @jez


(Vissie) #3

Thank you. Will do and update on the result.


(Vissie) #4

Update works without plugin enabled. Tried to enable the plugin after update but still fails.