Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Packaged 12.0.10 to 12.5.4 Migration Error "smtp_openssl_verify_mode is not writable"

Packaged 12.0.10 to 12.5.4 Migration Error "smtp_openssl_verify_mode is not writable"

Added by Ryan Brownell about 2 years ago

While attempting to upgrade to the latest version from 12.0.10 via apt-get, I encountering the following error whenever I try run sudo openproject configure to finish the update:

[openproject] ./bin/postinstall
I, [2023-05-06T13:21:46.638452 #47561]  INFO -- : Migrating to RestoreDefaultsOnEmptySettings (20220428071221)
== 20220428071221 RestoreDefaultsOnEmptySettings: migrating ===================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

smtp_openssl_verify_mode is not writable but can be set through env vars or configuration.yml file.

I am not entirely sure why this is even an issue because I am using sendmail and not smtp.

Solution

I was able to resolve this by manually updating the settings table. Here are the steps:

  1. Connect to Postgres CLI.
    sudo su - postgres -c psql
  2. Switch to the openproject database.
    \c openproject
  3. Look up the ID of the smtp_openssl_verify_mode setting.
    SELECT * FROM settings WHERE name like 'smtp_%';
    1. Take note of the ID. It will be used in the next query. In this example the ID is 9.
  4. Update the setting.
    UPDATE settings SET value = 'none' WHERE id = 9;
  5. Verify the value has been updated
    SELECT * FROM settings WHERE name like 'smtp_%';
  6. Exit Postgres CLI
    exit
  7. Continue the upgrades
    sudo openproject configure

Troubleshooting Process

The troubleshooting steps I went through to solve this included:

  • I tried to do this upgrade in the original Debian 10 Buster VM that was running OpenProject.
  • I also tried to restore the backup from the original instance into an a Ubuntu 22.04 LTS VM running a fresh install of OpenProject 12.5.4.
  • I can't find the referenced configuration.yml file.
  • I tried running sudo openproject config:set OPENPROJECT_SMTP__OPENSSL__VERIFY__MODE=none
  • I tried modifying the configuration found at /etc/openproject/conf.d/smtp but I am not exactly sure how the keys should be structured because the documentation does not match what is already in there:
    • I have tried adding the line export SMTP_OPENSSL_VERIFY_MODE="none" to /etc/openproject/conf.d/smtp
    • I have tried adding the line export OPENSSL_VERIFY_MODE="none" to /etc/openproject/conf.d/smtp
    • I have tried adding the line export OPENPROJECT_SMTP__OPENSSL__VERIFY__MODE="none" to /etc/openproject/conf.d/smtp
  • I tried the steps found at https://community.openproject.org/projects/openproject/work_packages/42299/activity. 

Additional Informaiton

All values in the DB related to SMTP are as follows (no login credential information is stored in the Database because I am not using SMTP).

root@localhost:~/backup# sudo psql $(sudo openproject config:get DATABASE_URL) -c "select * from settings where name like 'smtp_%'"
 id  |           name            | value |       updated_at
-----+---------------------------+-------+------------------------
   9 | smtp_openssl_verify_mode  |       | 2016-11-09 16:46:44+00
  10 | smtp_enable_starttls_auto | 0     | 2016-11-09 16:46:24+00
  11 | smtp_address              |       | 2016-11-09 16:46:24+00
  12 | smtp_port                 | 25    | 2016-11-09 16:46:43+00
  13 | smtp_domain               |       | 2016-11-09 16:46:43+00
  14 | smtp_authentication       | login | 2016-11-09 16:46:44+00
  15 | smtp_user_name            |       | 2016-11-09 16:46:24+00
  16 | smtp_password             |       | 2016-11-09 16:46:24+00
 116 | smtp_ssl                  | 0     | 2019-01-13 03:59:27+00

Here is the full output of the [openproject] ./bin/postinstall step sudo openproject configure command:

[openproject] ./bin/postinstall
I, [2023-05-06T13:23:41.869085 #49231]  INFO -- : Migrating to RestoreDefaultsOnEmptySettings (20220428071221)
== 20220428071221 RestoreDefaultsOnEmptySettings: migrating ===================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

smtp_openssl_verify_mode is not writable but can be set through env vars or configuration.yml file.
/opt/openproject/app/models/setting.rb:175:in `set_value!'
/opt/openproject/app/models/setting.rb:170:in `value='
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/persistence.rb:756:in `public_send'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/persistence.rb:756:in `update_attribute'
/opt/openproject/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb:15:in `block in up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:71:in `each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:71:in `block in find_each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:229:in `loop'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:229:in `in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:137:in `find_in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:70:in `find_each'
/opt/openproject/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb:5:in `up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:873:in `public_send'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:873:in `exec_migration'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:854:in `block (2 levels) in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:853:in `block in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:852:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1046:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1360:in `block in execute_migration_in_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/transactions.rb:209:in `transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1411:in `ddl_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1359:in `execute_migration_in_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1333:in `each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1333:in `migrate_without_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1282:in `block in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1432:in `block in with_advisory_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1447:in `with_advisory_lock_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1428:in `with_advisory_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1282:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1117:in `up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1092:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <top (required)>'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/openproject/bin/bundle:110:in `load'
/opt/openproject/bin/bundle:110:in `<main>'

Caused by:
NoMethodError: smtp_openssl_verify_mode is not writable but can be set through env vars or configuration.yml file.
/opt/openproject/app/models/setting.rb:175:in `set_value!'
/opt/openproject/app/models/setting.rb:170:in `value='
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/persistence.rb:756:in `public_send'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/persistence.rb:756:in `update_attribute'
/opt/openproject/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb:15:in `block in up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:71:in `each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:71:in `block in find_each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:229:in `loop'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:229:in `in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:137:in `find_in_batches'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/relation/batches.rb:70:in `find_each'
/opt/openproject/db/migrate/20220428071221_restore_defaults_on_empty_settings.rb:5:in `up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:873:in `public_send'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:873:in `exec_migration'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:854:in `block (2 levels) in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:853:in `block in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:852:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1046:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1360:in `block in execute_migration_in_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/transactions.rb:209:in `transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1411:in `ddl_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1359:in `execute_migration_in_transaction'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1333:in `each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1333:in `migrate_without_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1282:in `block in migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1432:in `block in with_advisory_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1447:in `with_advisory_lock_connection'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1428:in `with_advisory_lock'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1282:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1117:in `up'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/migration.rb:1092:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.2/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <top (required)>'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/openproject/bin/bundle:110:in `load'
/opt/openproject/bin/bundle:110:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Replies (1)

RE: Packaged 12.0.10 to 12.5.4 Migration Error "smtp_openssl_verify_mode is not writable" - Added by Ryan Brownell about 2 years ago

A bug has been filed for this problem here: https://community.openproject.org/projects/openproject/work_packages/48125/activity

  • (1 - 1/1)
Loading...