Error while remaping posts


(Lapinot) #1

Hi, I run the command rake posts:remap["forumalt","forum"] and I got this error message:

** Invoke posts:remap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute posts:remap
rake aborted!
NoMethodError: undefined method `acting_user=' for nil:NilClass
/var/www/discourse/lib/post_revisor.rb:123:in `revise!'
/var/www/discourse/app/models/post.rb:428:in `revise'
/var/www/discourse/lib/tasks/posts.rake:135:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46:in `each'
/var/www/discourse/lib/tasks/posts.rake:130:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:248:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:152:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:117:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:102:in `top_level'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:80:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:77:in `run'
bin/rake:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:332:in `exec'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:20:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:11:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:34:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:26:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => posts:remap
Remapping

I had to undergo some dirty migration/upgrade not long ago, it may be related…


(RĂ©gis Hanol) #2

It is highly likely to be related :wink:

You’ll have to fix your database before running the remap.


(Lapinot) #3

And what does it look like to fix the database? :wink:


(Sam Saffron) #4

Well then, is this a supported docker install?

If so, step 0 here is:

cd /var/discourse
git pull
./launcher rebuild app

How to repair old titles?