Zammad error after upgrade v5

We had the same or a similar problem after updating from 4.x to 5.x (see All logins denied after update 4.1.0 -> 5.0.2). In our case it was a database migration issue which was solved by (thanks to @MrGeneration)

systemctl stop zammad
zammad run rails r "Cache.clear"
zammad run rake db:migrate
systemctl start zammad