Content
Error upgrading OpenProject 14.6.3 to 15 (Docker)
Added by Igor Freire about 12 hours ago
I'm selfhosting OpenProject BIM in Docker (Swarm), currently in 14.6.3, with external database server Postgres 14.
On Portainer, I change the tag to openproject/openproject:15.0.0, set to "Prune Services" and start the "Update the Stack" with "Re-Pull and Deploy".
But the update ends in error (with the service being terminated and restarted indefinitely).
The log below shows the steps performed, and the service is always stopped at this line:
I, [2024-11-27T14:08:59.896073 #124] INFO -- : Migrating to AddStandardGlobalRole (20241001205821)
== 20241001205821 AddStandardGlobalRole: migrating ============================
This error is reported, but I haven't found anything about what could cause it, or how to resolve it:
Caused by:
NameError: uninitialized constant Role::BUILTIN_STANDARD_GLOBAL (NameError)
standard_global_role ||= GlobalRole.find_or_initialize_by(builtin: Role::BUILTIN_STANDARD_GLOBAL)
^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean? Role::BUILTIN_NON_MEMBER
I saw a topic related to an update error for version 15, in baremetal installation, which would be related to database encoding.
But I checked the database used, and the template, and both are configured as UTF-8 (running SHOW SERVER_ENCODING on PGAdmin).
The volumes configured in Portainer Stack are:
- opBIM_pgdata:/var/openproject/pgdata
- opBIM_assets:/var/openproject/assets
- opBIM_token:/app/app/models:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
-----> Setting PGVERSION=13 PGBIN=/usr/lib/postgresql/13/bin PGCONF_FILE=/etc/postgresql/13/main/postgresql.conf
-----> Starting the all-in-one OpenProject setup at /app/docker/prod/supervisord...
-----> You're using an external database. Not initializing a local database cluster.
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/schema_cache.rb:136:in `load_cache': Ignoring db/schema_cache.yml because it has expired. The current schema version is 20240930122522, but the one in the schema cache file is 20241025072902. (StructuredWarnings::StandardWarning)
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/schema_cache.rb:136:in `load_cache': Ignoring db/schema_cache.yml because it has expired. The current schema version is 20240930122522, but the one in the schema cache file is 20241025072902. (StructuredWarnings::StandardWarning)
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/railtie.rb:169:in `block (3 levels) in <class:Railtie>': Ignoring /app/db/schema_cache.yml because it has expired. The current schema version is 20240930122522, but the one in the schema cache file is 20241025072902. (StructuredWarnings::StandardWarning)
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/schema_cache.rb:136:in `load_cache': Ignoring db/schema_cache.yml because it has expired. The current schema version is 20240930122522, but the one in the schema cache file is 20241025072902. (StructuredWarnings::StandardWarning)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
uninitialized constant Role::BUILTIN_STANDARD_GLOBAL
/app/db/migrate/20241001205821_add_standard_global_role.rb:3:in `change'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:986:in `exec_migration'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:969:in `block in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:968:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1178:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1580:in `ddl_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1503:in `each'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1448:in `block in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1448:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1274:in `up'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1249:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/tasks/database_tasks.rb:251:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:455:in `exec'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:29:in `start'
/usr/local/bundle/gems/bundler-2.5.13/exe/bundle:28:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.5.13/exe/bundle:20:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'
Caused by:
NameError: uninitialized constant Role::BUILTIN_STANDARD_GLOBAL (NameError)
standard_global_role ||= GlobalRole.find_or_initialize_by(builtin: Role::BUILTIN_STANDARD_GLOBAL)
^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean? Role::BUILTIN_NON_MEMBER
/app/db/migrate/20241001205821_add_standard_global_role.rb:3:in `change'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:986:in `exec_migration'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:969:in `block in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:968:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1178:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1580:in `ddl_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1503:in `each'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1448:in `block in migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1448:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1274:in `up'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/migration.rb:1249:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/tasks/database_tasks.rb:251:in `migrate'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4.1/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:455:in `exec'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/cli.rb:29:in `start'
/usr/local/bundle/gems/bundler-2.5.13/exe/bundle:28:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.5.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.5.13/exe/bundle:20:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I, [2024-11-27T14:08:54.578260 #124] INFO -- : Increasing database pool size to 17 to match max threads
----------------------------- LOADING PREVIEWS
----------------------------- LOADING PAGES
I, [2024-11-27T14:08:59.896073 #124] INFO -- : Migrating to AddStandardGlobalRole (20241001205821)
== 20241001205821 AddStandardGlobalRole: migrating ============================