Upgrade Zammad 6.0 to 6.1 failed

Infos:

  • Used Zammad version: 6.0
  • Used Zammad installation type: (source, package, docker-compose, …) package
  • Operating system: Centos 7
  • Browser + version:

Expected behavior:

Upgrade using yum update zammad

Actual behavior:

/tmp/tmp.87EFFokHYU: line 17: /config/database.yml: No such file or directory
/tmp/tmp.87EFFokHYU: line 18: /config/database.yml: No such file or directory
/tmp/tmp.87EFFokHYU: line 31: pg_isready: command not found
!!! ERROR !!!
Your database does not seem to be online!
Please check your configuration in config/database.yml and ensure the configured database server is online.
Exiting Zammad package installation / upgrade - try again.
error: %pre(zammad-6.1.0-1694593564.c5436f74.centos7.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package zammad-6.1.0-1694593564.c5436f74.centos7.x86_64
zammad-6.0.0-1688711101.114e84ee.centos7.x86_64 was supposed to be removed but is not!
Verifying : zammad-6.0.0-1688711101.114e84ee.centos7.x86_64 1/2
Verifying : zammad-6.1.0-1694593564.c5436f74.centos7.x86_64 2/2

Failed:
zammad.x86_64 0:6.0.0-1688711101.114e84ee.centos7 zammad.x86_64 0:6.1.0-1694593564.c5436f74.centos7

Steps to reproduce the behavior:

Can you provide your database type and database version?

database type and version - PostgreSQL 14.8

Can you please double check if the file /opt/zammad/config/database.yml exists?

Nevermind. I introduced a bug there. Sorry about that.
We’re on a fix already.

If /opt/zammad/VERSION already is on 6.1, you can manually run /opt/zammad/contrib/packager.io/postinstall.sh which should finish the upgrade process and keep you online.

That’s the first thing I checked

production:
adapter: postgresql
database: zammad
pool: 50
timeout: 5000
encoding: utf8
username: zammad

By the way, unlike what is written in the log, the pg_isready command works when I run it manually:

/var/run/postgresql:5432 - accepting connections

The issue is a sub part of the check routine not your machine.

Handled by this issue:

1 Like

I tried again and still the same problem

You’re saying Zammad v6.1.0-1694610998.de69445a still fails with above error?

I have 6.0 Im trying upgrade to 6.1

What specific version please.

zammad 6.0.0-1688711101.114e84ee.centos7 will be updated
zammad 6.1.0-1694610998.de69445a.centos7 will be an update

Okay.
Then please ensure that the database credentials are actually correct.
They’re needed in that process.

You can double tab that by running /opt/zammad/contrib/backup/zammad_db_user_helper.sh.
This script will ensure it works and is correct. The upgrade definitively should work after that.

The database credentials is correct bbecause before the upgrade everything works correctly.

/tmp/tmp.lNiM9bzkQ0: line 31: pg_isready: command not found
!!! ERROR !!!
Your database does not seem to be online!
Please check your configuration in config/database.yml and ensure the configured database server is online.
Exiting Zammad package installation / upgrade - try again.
error: %pre(zammad-6.1.0-1694610998.de69445a.centos7.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package zammad-6.1.0-1694610998.de69445a.centos7.x86_64

Have you verified that Zammad really is not using a socket connection.
Please run the script and try again.

I’ve spoken BS here.
If you take host and post from your database.yml, the following command should run successfully:
pg_isready -q -h $DB_HOST -p $DB_PORT

Replace the variables with your actual information. This is what the pre-flight check is actually doing.

You can also remove -q to get actual output.

database.yml

pg_isready
image

Still can’t upgrade, with the same error
Thank you for your patience

Could you please check what pg_isready --version returns for you?
I’m suprised that the binary in question if working for you as it’s not on path in default installations.
(Which I had to learn just now)

This line from your original post actually reflects that.

I prepared another MR that’s undergroing internal QA by my colleguales.
I’ll be absend until next week so I hope this finally solves it.

If you can’t wait, ensure that your postgresql binary path is on path so that the upgrade process can find the binary.

With PostGreSQL v14.x this would be /usr/pgsql-14/bin when using postgresql’s repositories.
Temporarily add the path by export PATH=$PATH:/usr/pgsql-14/bin. This won’t survive the users session so you may want to make it a better implementation by using environment files that load automatically on user login.

Hope it helps.


Above issues should only affect CentOS 7 installations.
Maybe RHEL but I couldn’t verify that.

Debian and Ubuntu installations should install without mayor incidents. :pray:

Similar issue with Ubuntu and 6.1 upgrade:

# cat /opt/zammad/config/database.yml 
production:
  adapter: mysql2
  database: zammad
  pool: 50
  timeout: 5000
  encoding: utf8
  username: zammad
  password: <redacted>

Database connection works with those credentials as do the past upgrades within 6.0.

Issue is that installer does not seem to use the credentials found in database.yml:

Preparing to unpack zammad_6.1.0-1694667214.1a17b798.focal_amd64.deb ...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost''
!!! ERROR !!!
Your database does not seem to be online!
Please check your configuration in config/database.yml and ensure the configured database server is online.

MariaDB connection with both Zammad (credentials from database.yml) and root@localhost work from console as tested with mariadb CLI but the dpkg installation fails to connect.

This causes partial installation which causes Zammad to start failing with HTTP/500 due to missing assets. This has to be fixed with:

zammad run rake assets:precompile
zammad restart

After that 6.0 is functional again after the failed 6.1 installation attempt.

1 Like