Trouble updating to newest version

Infos:

  • Used Zammad version: 3.6->4.0
  • Used Zammad installation source: (source, package, …) source
  • Operating system: Centos 8
  • Browser + version: Chrome

Expected behavior:

  • Working version of Zammad 4.0

Actual behavior:

  • 502 bad gateway

Steps to reproduce the behavior:

Zammad didn’t update but no errors were displayed either.

This led me to attempt update via source.

The client managed to update but the front-end was displaying an error to do with ‘mentions’ (the new feature added in 4.0.

This led me to attempt to rebuild the search index with rake searchindex:rebuild


Errors:

rake aborted!
LoadError: Error loading the ‘postgresql’ Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile.

Caused by:
Gem::LoadError: pg is not part of the bundle. Add it to your Gemfile.


This is where I’m stuck currently as a novice Linux user.

Is there a way to clean slate without causing problems any damage to the database? I fear I might’ve already messed up big time.

Below are the last breaths of Zammad via the production.log.

Blockquote

E, [2021-04-01T14:34:59.710474 #2586910-47125132261360] ERROR – : PG::UndefinedTable: ERROR: relation “mentions” does not exist
LINE 8: WHERE a.attrelid = ‘“mentions”’::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
c.collname, col_description(a.attrelid, a.attnum) AS comment
FROM pg_attribute a
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
WHERE a.attrelid = ‘“mentions”’::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
(ActiveRecord::StatementInvalid)
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in async_exec' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in block (2 levels) in query’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/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.5/lib/active_support/concurrency/share_lock.rb:187:in yield_shares’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:47:in permit_concurrent_loads' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:62:in block in query’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:581:in block (2 levels) in log' /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/monitor.rb:235:in mon_synchronize’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/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.5/lib/active_support/notifications/instrumenter.rb:23:in instrument’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:571:in log' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in query’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql_adapter.rb:757:in column_definitions' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:113:in columns’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/schema_cache.rb:69:in columns' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/schema_cache.rb:75:in columns_hash’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/model_schema.rb:466:in load_schema!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/attributes.rb:234:in load_schema!’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/attribute_decorators.rb:51:in load_schema!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/model_schema.rb:459:in block in load_schema’
/opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/monitor.rb:235:in mon_synchronize' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/model_schema.rb:456:in load_schema’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/model_schema.rb:346:in attribute_types' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/model_schema.rb:370:in type_for_attribute’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/table_metadata.rb:33:in type' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:51:in build’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:112:in block in expand_from_hash' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:71:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:71:in flat_map' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:71:in expand_from_hash’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/predicate_builder.rb:21:in build_from_hash' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/where_clause_factory.rb:19:in build’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/query_methods.rb:588:in where!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/query_methods.rb:581:in where’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/querying.rb:12:in where' /opt/zammad/app/models/transaction/notification.rb:57:in perform’
/opt/zammad/app/models/observer/transaction.rb:62:in execute_singel_backend' /opt/zammad/app/jobs/transaction_job.rb:23:in block in perform’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/delegation.rb:71:in each' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/delegation.rb:71:in each’
/opt/zammad/app/jobs/transaction_job.rb:19:in perform' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/execution.rb:39:in block in perform_now’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:109:in block in run_callbacks' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n.rb:309:in with_locale’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/translation.rb:9:in block (2 levels) in <module:Translation>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:118:in instance_exec’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:118:in block in run_callbacks' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/logging.rb:26:in block (4 levels) in module:Logging
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications.rb:168:in block in instrument' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications/instrumenter.rb:23:in instrument’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications.rb:168:in instrument' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/logging.rb:25:in block (3 levels) in module:Logging
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/logging.rb:46:in block in tag_logger' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/tagged_logging.rb:71:in block in tagged’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/tagged_logging.rb:28:in tagged' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/tagged_logging.rb:71:in tagged’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/logging.rb:46:in tag_logger' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/logging.rb:22:in block (2 levels) in module:Logging
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:118:in instance_exec' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:118:in block in run_callbacks’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/callbacks.rb:136:in run_callbacks' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/execution.rb:38:in perform_now’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activejob-5.2.4.5/lib/active_job/execution.rb:18:in perform_now' /opt/zammad/app/models/ticket.rb:233:in block in process_escalation’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:70:in block (2 levels) in find_each' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:70:in each’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:70:in block in find_each' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:136:in block in find_in_batches’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:238:in block in in_batches' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:222:in loop’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:222:in in_batches' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:135:in find_in_batches’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/relation/batches.rb:69:in find_each' /opt/zammad/app/models/ticket.rb:223:in process_escalation’
(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, [2021-04-01T14:34:59.778966 #2586910-47125132261360] INFO – : Performed TransactionJob (Job ID: 56dee41b-e0a5-4d0d-8500-7032bcaa0d2c) from DelayedJob(default) in 82.45ms
I, [2021-04-01T14:34:59.779245 #2586910-47125132261360] INFO – : ended Ticket.process_escalation took: 0.49098753 seconds.
I, [2021-04-01T14:35:04.800017 #2586910-47125057477000] INFO – : script/scheduler.rb stopped.

The issue was with the environmental variables of Zammad.

The post above helped me.

This worked for me, but exercise caution if you do this yourself.

I performed a backup of the database.

Stopped all Zammad services.

Uninstalled Zammad and removed the /opt/zammad folder.

Uninstalled Ruby from the system

Then reinstalled Zammad via the package. It picked up the old database beautifully.

1 Like

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