Failed db migration during update to 6.1

HI,

we have a Zammad installation under Ubuntu 22.04 (no Docker Container)
Every 4 to 6 weeks we install the latest updates, those from Ubuntu together with those from Zammad.
Last Friday, November 3rd, when updating to version 6.1 I received the following error message during database migration

# database.yml found. Updating db...
== 20230807051414 InputFieldsOperatorRenaming: migrating ======================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

Validation failed: The required 'perform' value for x-zammad-ticket-customer_id, value is missing!
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.6/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.6/lib/active_record/validations.rb:53:in `save!'
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:302:in `block in save!'
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/database_statements.rb:318:in `transaction'
... and so on

elasticsearch and postgresql are the last Versions of the repositorys.

Now we have various errors, e.g. with the search function…
Does anyone have an idea what we can do to repair it?

EDIT:
I have read the thread with similar Problems, but it does not helped me
(Zammad 6.1 elasticsearch reindex fails
Cannot run zammad run rake db:migrate after upgrade - #2 by MrGeneration)

Regards,
gerdpeter

Hi @gerdpeter.

You have at least one postmaster filter that is invalid in terms of the stored values. Could you please check how many postmaster filters you have and search for the one that is making trouble? The perform part is the interesting one…

HI @fliebe92,

Thank You!
And yes, we have only one short postmaster filter, created a long time ago.
I delete this Filter, then the Update to version 6.1 runs smoothly until the end …

OT and the long Version:
We have one Proxmox VM under ZFS. The steps in detail:
The starting point is Zammad 6.0 (don’t know exactly); I stop the elasticsearch, postgresql and zammad service; create a snapshot; apt update && apt upgrade and get some ERRORs:

from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /opt/zammad/bin/rails:5:in `<main>'
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': **connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (PG::ConnectionBad**
)
	Is the server running locally and accepting connections on that socket?
	from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/pg-1.2.3/lib/pg.rb:58:in `new'
	from /opt/zammad/vendor/bundle/ruby/3.1.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect'

the zammad:searchindex:rebuild also fail

Creating indexes... rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass

    settings = Setting.get('es_model_settings')[model.name] || {}
                                               ^^^^^^^^^^^^

Then I reboot zammad, and now with all service are running I do a

apt install --reinstall zammad

Now the Update to version 6.1 and the searchindex:rebuild runs without error until the end
And what do we learn from the latter:
don’t stop any services before the update :wink:

Thank You and regards,
gerdpeter

Hi @gerdpeter. Please have a look at our documentation: Updating Zammad — Zammad System Documentation documentation

I guess that your database was not available on the first try… that leads to errors afterward.

Yes, because I stop elasticsearch and postgresql
that was my fault …
And yes, reading beforehand is often helpful :wink:
regards,