Failed db migration during update to 3.5.0

Infos:

  • Used Zammad version: 3.5.0
  • Installation method (source, package, …): package
  • Operating system: Ubuntu 16.04.6
  • Database + version: mysql
  • Elasticsearch version: 5.6.16
  • Browser + version: Chrome

Expected behavior:

  • Update to 3.5.0 proceeds without any errors

Actual behavior:

  • 1st try:

Setting up zammad (3.5.0-1600952424.634fd409.xenial) ... chown: cannot access '/opt/zammad/tmp/cache_file_store_production/507': No such file or directory dpkg: error processing package zammad (--configure): subprocess installed post-installation script returned error exit status 1

  • 2nd try update was successful in general, but there was db migration error:

database.yml found. Updating db…

WARNING: Nokogiri was built against LibXML version 2.9.3, but has dynamically loaded 2.9.10
nil versions are discouraged and will be deprecated in Rubygems 4
== 20200522125253 Issue2943AddSettingEnforceSpecialCharacter: migrating =======
== 20200522125253 Issue2943AddSettingEnforceSpecialCharacter: migrated (0.1315s)

== 20200527000000 AgentCustomer: migrating ====================================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

undefined method update' for nil:NilClass /opt/zammad/db/migrate/20200527000000_agent_customer.rb:15:in move_filter’
/opt/zammad/db/migrate/20200527000000_agent_customer.rb:11:in change' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:814:in exec_migration’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:798:in block (2 levels) in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:797:in block in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in with_connection' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:796:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:977:in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1292:in block in execute_migration_in_transaction’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1345:in ddl_transaction' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1291:in execute_migration_in_transaction’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1263:in block in migrate_without_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1262:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1262:in migrate_without_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1210:in block in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1363:in with_advisory_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1210:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1036:in up' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1011:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/tasks/database_tasks.rb:172:in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/railties/databases.rake:60:in block (2 levels) in ’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in load’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in kernel_load' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in run’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in exec' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in dispatch' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in start' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:30:in block in <top (required)>’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in with_friendly_errors' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:22:in <top (required)>’
/opt/zammad/bin/bundle:3:in load' /opt/zammad/bin/bundle:3:in

Caused by:
NoMethodError: undefined method update' for nil:NilClass /opt/zammad/db/migrate/20200527000000_agent_customer.rb:15:in move_filter’
/opt/zammad/db/migrate/20200527000000_agent_customer.rb:11:in change' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:814:in exec_migration’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:798:in block (2 levels) in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:797:in block in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in with_connection' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:796:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:977:in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1292:in block in execute_migration_in_transaction’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1345:in ddl_transaction' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1291:in execute_migration_in_transaction’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1263:in block in migrate_without_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1262:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1262:in migrate_without_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1210:in block in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1363:in with_advisory_lock' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1210:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1036:in up' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:1011:in migrate’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/tasks/database_tasks.rb:172:in migrate' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/railties/databases.rake:60:in block (2 levels) in ’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in <top (required)>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in load’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in kernel_load' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in run’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in exec' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in dispatch' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in start' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:30:in block in <top (required)>’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in with_friendly_errors' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:22:in <top (required)>’
/opt/zammad/bin/bundle:3:in load' /opt/zammad/bin/bundle:3:in
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Updating translations…

In general zammad is running, but please let me know if I should do anything to rerun this migration (or should I ignore it?)

Steps to reproduce the behavior:

  • apt upgrade

According to latest reply on github, I think I know where is the issue. I’ve removed this filter as described here to allow using headers over imap:

Can I restore this setting (I have backup) and rerun migration manually somehow? (Then can I remove this setting again? :wink: i need it to support headers over imap)

From which Zammad version are you updating? If your current Zammad version is older than Zammad 3.0 you’ll have to take Zammad 3.0 as a pre step before upgrading to Zammad 3.5.

If you used develop versions, this may also be the root cause of your issue. In that case you’ll have to manually remove the setting or whatever is blocking.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.