Zammad Version: 6.1.0 package deb
OS: Ubuntu 22.04 server
After apt upgrade Zammad gives “502 bad gateway”. Console commands and db_migration throws following error:
root@nc:/home/user# zammad run rails r ‘p Setting.get(“system_bcc”)’
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require': cannot load such file -- rails/commands (LoadError) from /opt/zammad/bin/rails:5:in ’
/opt/zammad/bin/rails brings
/usr/bin/env: ‘ruby’: No such file or directory
I made a blank install for comparison on a test machine. “zammad run rails …” works there and web ui is online but “/usr/bin/env: ‘ruby’: No such file or directory” also appears.
So I gues this is not the problem.
I removed zammad package and the zammad user + /home/zammad and reinstalled. Problem remains and error occurs during package post installation:
root@nc:/home/user# /opt/zammad/contrib/packager.io/postinstall.sh
# Enforcing Redis...
# Creating Redis bootstart
Synchronizing state of redis-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable redis-server
# Starting Redis server
# Redis server is running.
# (Re)creating init scripts
Nothing to do.
Nothing to do.
Nothing to do.
# Enabling Zammad on boot
# Stopping Zammad
# Clear cache...
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require': cannot load such file -- rails/commands (LoadError)
from /opt/zammad/bin/rails:5:in `<main>'
# database.yml found. Updating db...
rake aborted!
LoadError: cannot load such file -- rails/all
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
...
The 4 zammad services report running, but I get no connection to “localhost:3000”. I gues that the service does not start correctly because of rails is not working.
FYI: This might be specific to the Ubuntu repository versions of Zammad, I have been upgrading on a Debian machine using the Debian bookworm repository versions (https://dl.packager.io/srv/deb/zammad/zammad/stable/debian 12 main) and have not encountered these issues at all.
I did run into most likely the same issue a few weeks ago.
What I noticed is, that it seemed like that bootsnap did not invalidate its cache. Deleting /opt/zammad/tmp/cache to force bootsnap to start from a clean slate helped.