Zammad crashed after 3.6 update?

I just saw that zammad was upgraded during the night and it crashed my installation.
Everytime i tried to log into Zammad i got this error:

Mysql2::Error: Unknown column 'statsstores.statsstorabletype' in 'where clause': SELECT stats</u>stores.* FROM stats<u>stores WHERE stats</u>stores.stats<u>storable</u>type = 'User' AND stats<u>stores.stats</u>storable<u>id = 3 AND stats</u>stores.key = 'dashboard' LIMIT 1

After i reinstalled the 3.5 version everything worked again.

  • Used Zammad version: 3.6
  • Used Zammad installation source: source
  • Operating system: Ubuntu 18.04

Actual behavior:

Mysql2::Error: Unknown column 'statsstores.statsstorabletype' in 'where clause': SELECT stats</u>stores.* FROM stats<u>stores WHERE stats</u>stores.stats<u>storable</u>type = 'User' AND stats<u>stores.stats</u>storable<u>id = 3 AND stats</u>stores.key = 'dashboard' LIMIT 1

Steps to reproduce the behavior:

root@XXXXXXXXXXXXX:~# apt-get install zammad
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  zammad
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 258 MB of archives.
After this operation, 710 MB of additional disk space will be used.
Get:1 https://dl.packager.io/srv/deb/zammad/zammad/stable/ubuntu 18.04/main amd64 zammad amd64 3.6.0-1605492102.99dfd900.bionic [258 MB]
Fetched 258 MB in 5s (48.8 MB/s)
Selecting previously unselected package zammad.
(Reading database ... 116514 files and directories currently installed.)
Preparing to unpack .../zammad_3.6.0-1605492102.99dfd900.bionic_amd64.deb ...
Unpacking zammad (3.6.0-1605492102.99dfd900.bionic) ...
Setting up zammad (3.6.0-1605492102.99dfd900.bionic) ...
# (Re)creating init scripts
Nothing to do.
Nothing to do.
Nothing to do.
# Enabling Zammad on boot
# Stopping Zammad
# database.yml found. Updating db...
== 20200121000001 SMIMESupport: migrating =====================================
-- create_table(:smime_certificates)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'smime_certificates' already exists: CREATE TABLE `smime_certificates` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `subject` varchar(500) NOT NULL, `doc_hash` varchar(250) NOT NULL, `fingerprint` varchar(250) NOT NULL, `modulus` varchar(1024) NOT NULL, `not_before_at` datetime, `not_after_at` datetime, `raw` mediumblob NOT NULL, `private_key` mediumblob, `private_key_secret` varchar(500), `created_at` datetime(3) NOT NULL, `updated_at` datetime(3) NOT NULL)
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `block in query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `handle_interrupt'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:871:in `block in method_missing'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `block in say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:860:in `method_missing'
/opt/zammad/db/migrate/20200121000001_smime_support.rb:57:in `up'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:817: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 <main>'
/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 `<main>'

Caused by:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'smime_certificates' already exists: CREATE TABLE `smime_certificates` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `subject` varchar(500) NOT NULL, `doc_hash` varchar(250) NOT NULL, `fingerprint` varchar(250) NOT NULL, `modulus` varchar(1024) NOT NULL, `not_before_at` datetime, `not_after_at` datetime, `raw` mediumblob NOT NULL, `private_key` mediumblob, `private_key_secret` varchar(500), `created_at` datetime(3) NOT NULL, `updated_at` datetime(3) NOT NULL)
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `block in query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `handle_interrupt'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:871:in `block in method_missing'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `block in say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:860:in `method_missing'
/opt/zammad/db/migrate/20200121000001_smime_support.rb:57:in `up'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:817: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 <main>'
/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 `<main>'

Caused by:
Mysql2::Error: Table 'smime_certificates' already exists
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `block in query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `handle_interrupt'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `query'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:871:in `block in method_missing'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `block in say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:840:in `say_with_time'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:860:in `method_missing'
/opt/zammad/db/migrate/20200121000001_smime_support.rb:57:in `up'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/migration.rb:817: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 <main>'
/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 `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
# Updating translations...
# Configuring Elasticsearch...
-> removing [ingest-attachment]...
-> Installing ingest-attachment
-> Downloading ingest-attachment from elastic
[=================================================] 100%  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
* java.security.SecurityPermission insertProvider
* java.security.SecurityPermission putProviderProperty.BC
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

-> Installed ingest-attachment
# Starting Zammad
cp: cannot create regular file '/etc/nginx/sites-available/zammad.conf': No such file or directory
ln: failed to create symbolic link '/etc/nginx/sites-enabled/zammad.conf': No such file or directory
# Creating webserver bootstart
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
# Restarting webserver nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
####################################################################################

Add your fully qualified domain name or public IP to servername directive of
nginx, if this installation is done on a remote server. You have to change:
/etc/nginx/sites-available/zammad.conf and restart nginx process.
Otherwise just open http://localhost/ in your browser to start using Zammad.

####################################################################################

Same issue here. Updated from 3.5 to 3.6. How did you downgrade to 3.5 after this issue using Ubuntu?

apt-get remove zammad
apt-get install zammad=3.5.0-1605097372.e4949483.bionic

THANKS!!! :grinning:

@MrGeneration is this release production ready?

Hm… it looks like there is no easy way for a downgrad…
I just ran into a new problem with IMAP fetching:

I, [2020-11-17T10:25:08.926058 #31786-47023157155680] INFO – : - message 1/1
I, [2020-11-17T10:25:09.507574 #31786-47023157155680] INFO – : Process email with msgid ‘h6Fxp7mVUg1K8uK7kAsKcGXl5OZmlJg6Q7cEmxAeU@ovm2336
E, [2020-11-17T10:25:09.519129 #31786-47023157155680] ERROR – : Can’t process email, you will find it for bug reporting under /opt/zammad/tmp/unprocessable_mail/6648b5c03d29e95622d708f445d8278f.eml, please create an issue at Issues · zammad/zammad · GitHub
E, [2020-11-17T10:25:09.519192 #31786-47023157155680] ERROR – : uninitialized constant Channel::Filter::ImportArchive (NameError)
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/inflector/methods.rb:285:in const_get' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/inflector/methods.rb:285:in block in constantize’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/inflector/methods.rb:281:in each' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/inflector/methods.rb:281:in inject’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/inflector/methods.rb:281:in constantize' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/core_ext/string/inflections.rb:68:in constantize’
/opt/zammad/app/models/channel/email_parser.rb:147:in block in _process' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in each' /opt/zammad/app/models/channel/email_parser.rb:146:in _process’
/opt/zammad/app/models/channel/email_parser.rb:118:in block in process' /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:93:in block in timeout’
/opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:33:in block in catch' /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:33:in catch’
/opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:33:in catch' /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:108:in timeout’
/opt/zammad/app/models/channel/email_parser.rb:117:in process' /opt/zammad/app/models/channel/driver/imap.rb:294:in block in fetch’
/opt/zammad/app/models/channel/driver/imap.rb:229:in each' /opt/zammad/app/models/channel/driver/imap.rb:229:in fetch’
/opt/zammad/app/models/channel.rb:57:in fetch' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/relation/delegation.rb:71:in each' /opt/zammad/app/models/channel.rb:32:in fetch’
(eval):1:in _start_job' /opt/zammad/app/models/scheduler.rb:287:in eval’
/opt/zammad/app/models/scheduler.rb:287:in _start_job' /opt/zammad/app/models/scheduler.rb:239:in block (2 levels) in start_job’
/opt/zammad/app/models/scheduler.rb:237:in loop' /opt/zammad/app/models/scheduler.rb:237:in block in start_job’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context’

I looked up the error “uninitialized constant Channel::Filter::ImportArchive (NameError)” and found this topic:

@MrGeneration could you explain briefly how to undo a migration and redo it afterwards?

Same here. Opened up a Bug report which got closed by @MrGeneration.


Actually I do see errors after an upgrade as a bug, not a question… but thats only my opinion of it.
I guess the database-migration-script is somehow failing as (1) @oschmidt already stated in his original post the upgrade failed with the table “smime_certificates” already existing and (2) the error message from the login is pointing to some column in the database which does not yet exist.

Leaving this here for further troubleshooting:
I just updated two systems without any problems (package, debian 9).

IMHO: This totally depends on the cause of the problem. Also he said the following in the linked issue:
“In case this turns out the be a bug and no technical question, we’ll transfer the relevant information to this repo!”

cheers

1 Like

Question, this issue only belonging installations with mysql/mariadb, right?

I think the problem of mysql/mariadb is to not have transactions on table changes. So if one database migration fails, the undo is not possible and the whole migration is marked as “not done”.

JFI: I updated several instances as well, without errors (3.6 is running quite well).

@bastolino the database column statsstores.statsstorabletype should get created by executing the database migrations of Zammad 3.6.

So your error message says, you have running Zammad 3.6 but the database looks like Zammad 3.5 (or lower).

What is the output if you execute the database migratios of Zammad 3.6 manually?

zammad run rake db:migrate ?

Servus @martini,
it seems it is belongig mysql/mariadb, correct. I just digged deeper in it and found out that db/migrate/20200121000001_smime_support.rb tries to create the table “smime_certificates” already existing and that fails subsequently. I just removed the lines creating the table in above file and afterwards everything worked as expected…
I’ll edit my typescript and attach it just in a minute.
Best wishes

Excellent. That is the way how to get deeper to the issue which is preventing rake db:migrate from being successfully.

Track down what line fails and solve this problem.

Note again: PostgreSQL is supporting transactions on table changes too, so with PostgreSQL you will never have this kind of issues.

Hey @bastolino could you explain what you did so i could fix it?
Not really sure what you mean with “removing the lines”

Yeah. Isn’t there a possibility for rake to check if tables already exist? At least, it should be checked in my eyes.
Apart from that - editing that file solved the issue for me, so everyone else: changing one file to the following resolves the issue with the table “smime_certificates” for now. Please be aware to check if the table really exists with the values given in that file before you remove or edit it!

zammaduser$ vim db/migrate/20200121000001_smime_support.rb
zammaduser$ cat db/migrate/20200121000001_smime_support.rb
class SMIMESupport < ActiveRecord::Migration[5.2]
def up

# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')

Setting.create_if_not_exists(
  title:       'S/MIME integration',
  name:        'smime_integration',
  area:        'Integration::Switch',
  description: 'Defines if S/MIME encryption is enabled or not.',
  options:     {
    form: [
      {
        display: '',
        null:    true,
        name:    'smime_integration',
        tag:     'boolean',
        options: {
          true  => 'yes',
          false => 'no',
        },
      },
    ],
  },
  state:       false,
  preferences: {
    prio:           1,
    authentication: true,
    permission:     ['admin.integration'],
  },
  frontend:    true
)
Setting.create_if_not_exists(
  title:       'S/MIME config',
  name:        'smime_config',
  area:        'Integration::SMIME',
  description: 'Defines the S/MIME config.',
  options:     {},
  state:       {},
  preferences: {
    prio:       2,
    permission: ['admin.integration'],
  },
  frontend:    true,
)
Setting.create_if_not_exists(
  title:       'Defines postmaster filter.',
  name:        '0016_postmaster_filter_smime',
  area:        'Postmaster::PreFilter',
  description: 'Defines postmaster filter to handle secure mailing.',
  options:     {},
  state:       'Channel::Filter::SecureMailing',
  frontend:    false
)

end

end

zammaduser$ vim db/migrate/20200121000001_smime_support.rb
zammaduser$ zammad run rake db:migrate --trace
…(working from now on)

2 Likes

Usually a migrations is executed successfully or not. For some reason on your Zammad 3.5 update the tables smime_certificates got created but your migration got not marked as successfully executed. So on every new execution of the migrations you bumped into the Table 'smime_certificates' already exists issue.

We use the rails default migrations (Active Record Migrations — Ruby on Rails Guides) which worked just fine in the past. So currently I do not see that we should add an additional layer on top of rails migration layer (if this kind of errors will happen more often, then we should).

@bastolino Cheers mate. You saved my day :wink:

Well, but as we can see, this doesn’t always seem to be the case :slight_smile: . Same issue here (CentOS 7.9 with MySQL as database backend)

Fixed with @bastolino’s fix in Zammad crashed after 3.6 update? - #15 by bastolino. Thank you very much

1 Like

Thanks u for the tips … this issue drived me mad

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