Content
You are here:
Problem During upgrade
Added by Bartosz Gołek about 9 years ago
HI, all.
I’m trying to upgrade my openProject installation from 4.2 to 5.0.3.
Everything is going fine till command:
RAILS_ENV="production" bundle exec rake db:migrate
I’m getting error:
~/openproject$ RAILS_ENV="production" bundle exec r ake db:migrate rake aborted! NoMethodError: undefined method `map' for "\x04\b[\aI\"\aen\x06:\x06ETI\"\apl\x06;\x00T":String /home/openproject/openproject/config/initializers/30-redmine.rb:37:in `<top (required)>' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/engine.rb:615:in `each' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/engine.rb:615:in `block in <class:Engine>' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `each' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `tsort_each_child' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `public_send' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `method_missing' /home/openproject/openproject/config/environment.rb:34:in `<top (required)>' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency' /home/openproject/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/application.rb:328:in `require_environment!' /home/openproject/.rvm/gems/ruby-2.1.5/gems/railties-4.2.4/lib/rails/application.rb:457:in `block in run_tasks_blocks' /home/openproject/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval' /home/openproject/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)
Anyone knows, could be the reason?
Replies (20)
I have the same problem, trying to upgrade a packaged installation on Debian Jessie from 4.2 to 5.0.5-1449140564.d088c7a.jessie when doing
sudo openproject configure
how come noone could answer to this yet?
submitted a work package: #22278
problem persists with 5.0.6-1449652276.4ed93bd.jessie
Experiencing exact same error, problem seems to persist.
4.2.8 -> 5.0.7
I am used to have issues with the Gemfile ( plugins and such),
But this is new to me.
did you try the workaround described in #22278?
Yes i did, without success in the end.
I have the manual installation, yours were the packaged if i remember
correctly, I couldn’t figure out how to “reconfigure”.
So I ended up reinstalling from source, then migrated the db using the rak
cmd.
On Dec 24, 2015 3:13 AM, wrote:
had this error today,
any more detailed suggestions for fixing manual installation rather than hint ‘migrated the db using the rak
cmd’ ? what is rak ? rake? where to look for instructions how to run it?
or maybe there is an answer on where is it possible to take that magic ‘openproject’ script which allows to issue
openproject run rails console
from mentioned packaged solution?
edit: I managed to run console but for whatever reason I get right set of languages
so Setting.available_languages are correctly deserialized. I think I will try to set more languages ( used russian in openproject installation ) or will follow advice to remove all wrongly serialized tables
edit2 - returned to ver 4.2.9 for a while ….
Hi Sergey.
Yes “Rake”, I forgot the e
I mostly founde the instructions for rake in the openproject manual upgrade
guide.
Time has gone by, so I have forgotten too much now to be helpful.
Sorry
On Feb 4, 2016 3:28 AM, wrote:
Hey Sergey,
‘The Upgrade’ section of our manual upgrading guide should contain all the necessary steps for you to migrate your database and installation to 5.0.
In a manual installation:
you’ll first need to fetch the latest release - Since you probably cloned the repository using Git, you can simply checkout the stable/5 branch, which always points to the latest released version.
Lastly, install any pending migrations and precompile assets as the openproject user.
su - openproject
I’m taking a look at the encoding issue in this thread since it seems to affect multiple users.
Best,
Oliver
Oliver thanks,
done exactly like described but on step
RAILS_ENV=“production” bundle exec rake db:migrate
a problem occurs, which is described in this topic - no futher steps are possible
edit: when returning back with v4.2.9 the only thing I notice is this message
Application.initialize!… [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
maybe this is a reason for problems during installation to v5?
edit2: tried setting config.i18n.enforce_available_locales = false in application.rb but no effect - v5 error still persists
Hey guys,
I think I’ve isolated the error. During the migration to Rails 4, something in
Rails.cache
seems to provide a different encoding. The result is that theSetting.available_languages
is still cached by Rails, and results in an invalid string.You should be able to solve it for now using the rake task:
bundle exec rake tmp:clear
Let me know if that does not fix the error for you.
BTW: This issue appears to have the same origin: https://community.openproject.org/work_packages/22278/activity
Best,
Oliver
Hi Oliver,
yes
bundle exec rake tmp:clear
did the trick!
so I got git code for 5.0.14
issued
bundle exec rake tmp:clear
just before
RAILS_ENV=“production” bundle exec rake db:migrate
and it worked
Thanks a lot!
Hey Sergey,
great news!
I’m still looking into a way to fix this issue automatically, since it’s easy to forget (even though I’ll add it to the upgrade guide),
but great to hear it’s solvable for now.
Best,
Oliver
Hi Oliver,
many thanks for your support. Now I got 5.0.14 installed. But unfortunately I get now a HTTP 500 on every request. Apache error log shows this:
Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`
I tried to set them manually but apparently I got the format wrong. Maybe you know how to solve this?
Best regards
Fabian
Hi Fabian,
I had same error and fixed it,
so I run rake secret inside /home/openproject/openproject
copied output and set two vars
production:
secret_key_base: ****
secret_token: ****
where ***** is just an output from
rake secret
( it is possible to set env var SECRET_KEY_BASE as it is requested in secrets.yml ) but to check - a quick way is OK
but yes - this issue requires some doc comments
edit forgot to mention that I rebooted after change ( possibly touch /tmp/reload.txt and restarting nginx will suffice)
Hi Sergey,
Many Thanks for your hint. It is working now.
Best regards
Fabian
Hi,
with version 5, the
script/delayed_job
is now somehow missing and no email notifications are sent anymore. I copied the file from 4.2 and got it working again. Is this just a bug or has the notification mechanism changed?Best regards
Fabian
Hi Fabian,
OpenProject 5.0 employs Rails 4.2.x, which contains a number of changes regarding paths. Foremost, files previously located in the scripts directory now reside in bin (e.g., delayed_job).
Best,
Oliver
Hi Oliver,
Many Thanks for information. Maybe you should update the manual upgrade guide, it is a bit misleading.
Best regards
Fabian
I agree: https://github.com/opf/openproject/commit/d99929bbcb8bdc3e631b5ad87d1f420056bffc0b
Best,
Oliver