After update, Zammad can't start: `require': cannot load such file -- action_dispatch (LoadError)

Hi,

Yesterday I updated my Debian 11 ticket server (apt update; apt upgrade), this also updated Zammad to 6.2.0.
Zammad is installed via repository.
Unfortunately after the update 3 services do not start:
systemctl --failed

UNIT                       LOAD   ACTIVE SUB    DESCRIPTION
● zammad-web-1.service       loaded failed failed zammad-web-1.service
● zammad-websocket-1.service loaded failed failed zammad-websocket-1.service
● zammad-worker-1.service    loaded failed failed zammad-worker-1.service

Trying to restart zammad-web-1.service:
systemctl restart zammad-web-1.service

I see this errors in journalctl -f:

Dec 09 11:43:35 icc-ticket systemd[1]: Stopped zammad-web-1.service.
Dec 09 11:43:35 icc-ticket systemd[1]: Started zammad-web-1.service.
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]: bundler: failed to load command: script/rails (script/rails)
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]: /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require': cannot load such file -- action_dispatch (LoadError)
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:4:in `<main>'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/behavior.rb:44:in `block (2 levels) in lookup'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/behavior.rb:40:in `each'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/behavior.rb:40:in `block in lookup'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/behavior.rb:39:in `each'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/behavior.rb:39:in `lookup'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:73:in `find_by_namespace'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:46:in `invoke'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from script/rails:8:in `<top (required)>'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli.rb:486:in `exec'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:48:in `block in <top (required)>'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/vendor/ruby-3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:36:in `<top (required)>'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/bin/bundle:121:in `load'
Dec 09 11:43:35 icc-ticket zammad-web-1.service[15675]:         from /opt/zammad/bin/bundle:121:in `<main>'
Dec 09 11:43:35 icc-ticket systemd[1]: zammad-web-1.service: Main process exited, code=exited, status=1/FAILURE
Dec 09 11:43:35 icc-ticket systemd[1]: zammad-web-1.service: Failed with result 'exit-code'.
Dec 09 11:43:36 icc-ticket systemd[1]: zammad-web-1.service: Scheduled restart job, restart counter is at 5.
Dec 09 11:43:36 icc-ticket systemd[1]: Stopped zammad-web-1.service.

I assume, there are some packages missing in this installation. As a last resort, I updated the whole system to Debian 12, but I get the same errors.

Any Ideas how to solve this errors?

After digging in to this issue, I found, I have two slightly different ruby versions on the system:

root@icc-ticket:/opt/zammad# l vendor/bundle/ruby/3.1.0/
total 184
drwxr-xr-x   2 zammad zammad   4096 Dec  8 18:04 bin
drwxr-xr-x   2 zammad zammad   4096 Mar 14  2023 build_info
drwxr-xr-x   3 zammad zammad   4096 Apr  8  2023 bundler
-rw-r--r--   1 zammad zammad 101749 Sep 13 07:58 compile.log
drwxr-xr-x   3 zammad zammad   4096 Jul 16 10:57 doc
drwxr-xr-x   3 zammad zammad   4096 Apr  8  2023 extensions
drwxr-xr-x 221 zammad zammad  16384 Dec  8 17:48 gems
drwxr-xr-x   2 zammad zammad   4096 Dec  8 18:04 plugins
drwxr-xr-x   2 zammad zammad  40960 Dec  8 18:04 specifications
root@icc-ticket:/opt/zammad# l vendor/ruby-3.1.3/
total 128
drwxr-xr-x 2 zammad zammad   4096 Dec  8 18:04 bin
-rw-r--r-- 1 zammad zammad 113990 Jul  5 11:34 compile.log
drwxr-xr-x 3 zammad zammad   4096 Dec  8 18:04 include
drwxr-xr-x 5 zammad zammad   4096 Dec  8 18:04 lib
drwxr-xr-x 4 zammad zammad   4096 Apr  8  2023 share
root@icc-ticket:/opt/zammad#

Ruby 3.1.0 and Ruby 3.1.3, which is the correct version for Zammad?

Now I cleared manually the package cache

systemctl stop zammad
mv /opt/zammad/tmp/cache/bootsnap /opt/zammad/tmp/cache/bootsnap_old

and restarted Zammad
systemctl restart zammad

Now Zammad starts without an error, unfortunately the web interface is not working, I get a blank page.

The command zammad run rails r "Cache.clear" also do not work, I get this error:

zammad run rails r "Cache.clear"
Please specify a valid ruby command or the path of a script to run.
Run 'rails runner -h' for help.

uninitialized constant Cache

Any ideas how to fix the uninitialized constant Cache error?

Cache.clear is obsolete since quite a while by now.
It is Rails.cache.clear.

Thank you, zammad run rails r "Rails.cache.clear" worked.
Unfortunately in browser I only see a blank screen. Ctrl+Shft+R do not help.
Any ideas how to debug the blank screen issue?

I solved this issue:

  1. I downloaded the current 6.2. version with wget:
    wget https://dl.packager.io/srv/deb/zammad/zammad/stable/debian/pool/main/zammad_6.2.0-1702052196.543b74f4.bookworm_amd64.deb
  2. I did a manual upgrade installation:
    dpkg -i zammad_6.2.0-1702052196.543b74f4.bookworm_amd64.deb
    now, web interface works as expected.

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