Skip to content

CreateDashboardDefaults may fail to migrate if sudo mode enabled #186

@HighwayStar

Description

@HighwayStar

When redmine configured to use sudo:
sudo_mode: true
in config/configuration.yml

CreateDashboardDefaults migration may fail if admin user has admin attribute set to false by sudo timeout.

producing log like this

== 4 CreateDashboardRoles: migrated (0.0015s) =================================

== 5 CreateDashboardDefaults: migrating =======================================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `id' for nil:NilClass
/home/tomin/devel/redmine-test/redmine-5.0.5/plugins/additionals/db/migrate/005_create_dashboard_defaults.rb:5:in `up'
/home/tomin/devel/redmine-test/redmine-5.0.5/bundler/ruby/3.0.0/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:870:in `public_send'
/home/tomin/devel/redmine-test/redmine-5.0.5/bundler/ruby/3.0.0/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:870:in `exec_migration'
....

If I login to redmine as Admin user and use sudo button before trying to migrate it will create dashboard successfully and complete other migrations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions