Zammad:bootstrap:reset -> PG::InsufficientPrivilege: ERROR

Infos:

  • Used Zammad version: 5.4
  • Used Zammad installation type: package
  • Operating system: Debian 11
  • Browser + version: Chrome, newest

I have set up a new server to do some testing and development. I am working with an auto_wizard.json file to load the application with a set of predefined values.

I want to use the Rake task as described here:

systemctl stop zammad
zammad run rails zammad:bootstrap:reset

But it doesn’t let me create the DB.

root@zammad:/opt/zammad/config# DISABLE_DATABASE_ENVIRONMENT_CHECK=1 zammad run rails zammad:bootstrap:reset
Dropped database 'zammad_production'
PG::InsufficientPrivilege: FEHLER: keine Berechtigung, um Datenbank zu erzeugen
Couldn't create 'zammad_production' database. Please check your configuration.
rails aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: FEHLER: keine Berechtigung, um Datenbank zu erzeugen

I have tried this with the users root and zammad. Both get the same response. I have also tried the postgresql user but then I receive this response:

Error: You must be executing as the user 'zammad' or with root privileges to launch commands.
Either log in as 'zammad', root, use sudo, or add sudo privileges for running zammad with your current user.

I have used sudo, added zammad to the sudoers file, but nothing helped. Does it need any special developement environment variable? Or why can’t I create the DB?

Many thanks for the help!

Gijs

PS. I have tried some tricks and tips to similar issues found in the forum but so far had no luck.

That’s the relevant part.
Underneath it does run rake db:create which technically is a createdb as the user you’re using.
By default that user is zammad but may differ in your environment.

Said user requires CREATEDB permission which usually™️ is not the kind of permission you want in production. No Zammad scripts are setting that permission.

ALTER USER zammad WITH CREATEDB; will do the trick run as postgres or any other administrative user.

You can learn more here:

1 Like

Thanks! Works perfect now!

1 Like

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