Content
OpenProject Update from 12.1 to 12.2: Error on db:migrate
Added by Heinrich Huber over 3 years ago
Hi,
yesterday I did an update on my Ubuntu 20.04 VM to version 12.2.
After doing the sudo openproject configure command I noticed that my updated OpenProject instance delivers me a 503 Service Unavailable Error. Taking a closer look at the output of sudo openproject configure offered me a few lines which got my interest:
I, [2022-08-21T22:06:28.736578 #484251] INFO -- : Migrating to FixDeletedDataJournals (20220818074159)
== 20220818074159 FixDeletedDataJournals: migrating ===========================
Cleaning up journals on WorkPackage
W, [2022-08-21T22:06:28.760964 #484251] WARN -- : Scoped order is ignored, it's forced to be batch order.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
There shouldn't be any missing data left for WorkPackage, but found 1
Honestly I don't understand what that means but it seems to knock out the openproject-web-1.service. Looking at the logs with sudo openproject logs --tail it show the following lines (snippet):
Aug 21 22:10:56 ubuntu-op systemd[1]: openproject-web-1.service: Main process exited, code=exited, status=1/FAILURE
Aug 21 22:10:56 ubuntu-op systemd[1]: openproject-web-1.service: Failed with result 'exit-code'.
Aug 21 22:10:57 ubuntu-op systemd[1]: openproject-web-1.service: Scheduled restart job, restart counter is at 7604.
Aug 21 22:10:57 ubuntu-op systemd[1]: Stopped openproject-web-1.service.
Aug 21 22:10:57 ubuntu-op systemd[1]: Started openproject-web-1.service.
Aug 21 22:11:06 ubuntu-op openproject-web-1.service[485545]: /opt/openproject/config/constants/settings/definition.rb:295:in `find_env_var_override': Using unprefixed environment variables is deprecated. Please use OPENPROJECT_ATTACHMENTS_STORAGE_PATH instead of ATTACHMENTS_STORAGE_PATH (StructuredWarnings::StandardWarning)
Aug 21 22:11:06 ubuntu-op openproject-web-1.service[485545]: /opt/openproject/config/constants/settings/definition.rb:295:in `find_env_var_override': Using unprefixed environment variables is deprecated. Please use OPENPROJECT_RAILS_CACHE_STORE instead of RAILS_CACHE_STORE (StructuredWarnings::StandardWarning)
Aug 21 22:11:06 ubuntu-op openproject-web-1.service[485545]: => Booting Puma
Aug 21 22:11:06 ubuntu-op openproject-web-1.service[485545]: => Rails 7.0.3.1 application starting in production
Aug 21 22:11:06 ubuntu-op openproject-web-1.service[485545]: => Run `bin/rails server --help` for more startup options
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: Exiting
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: /opt/openproject/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/migration.rb:627:in `check_pending!': (ActiveRecord::PendingMigrationError)
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: Migrations are pending. To resolve this issue, run:
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: bin/rails db:migrate RAILS_ENV=production
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: You have 1 pending migration:
Aug 21 22:11:07 ubuntu-op openproject-web-1.service[485545]: 20220818074159_fix_deleted_data_journals.rb
Doing a manual sudo openproject run rake db:migrate --trace will lead to the same messages like the shown ones from sudo openproject configure. I'll attach full output of openproject configure and openproject logs.
Any help is very welcome.
Replies (5)
I have exactly the same problem (Debian 11, OpenProject 12.1.5 -> 12.2).
Andreas,
thanks for your response. It's always good to be not alone (even if I wished you have no problems with OP:-).
I assume this can be seen as a bug. So I'll create a Work Package. I hope this respects the rules.
I got a solution (see #43839 ).
Heinrich Huber wrote:
This workaround works for me.
Hi Obrien
did you see the solution?
https://community.openproject.org/topics/15250?r=15263#message-15263