DB Adapter not found

Infos:

  • Used Zammad version: 3.4.x (updated)
  • Used Zammad installation source: apt (source, package, …)
  • Operating system: Debian 8.11
  • Browser + version: Not Problemspecific

Expected behavior:

  • Make a correct and complete backup of my zammad installation.

Actual behavior:

  • Backup of Zammad fails showing: DB ADAPTER not found. if its sqlite backup is already saved in the filebackup

However Postgresql is used…

Steps to reproduce the behavior:

  • execute ./zammad_backup.sh on my system

Prosa

I want to move my Zammad installation from a Proxmox VM to another Proxmox CT (not problem specific). To get a clean installation I would like to create a backup and restore it later on.

I have made other transfer without a problem. However on this machine it does not backup the database.

root@zammad:/opt/zammad/contrib/backup# cat config
#!/usr/bin/env bash

zammad backup script config

BACKUP_DIR=’/var/tmp/XXX_zammad_backup’
HOLD_DAYS=‘10’
DEBUG=‘no’
root@zammad:/opt/zammad/contrib/backup# ./zammad_backup.sh

Zammad backup started - Thu 10 Sep 12:15:30 CEST 2020!

creating file backup…
DB ADAPTER not found. if its sqlite backup is already saved in the filebackup

Zammad backuped successfully - Thu 10 Sep 12:16:45 CEST 2020!

Database config

root@zammad:/opt/zammad/contrib/backup# cat /opt/zammad/config/database.yml
production:
adapter: postgresql
database: zammad_production
pool: 50
timeout: 5000
encoding: utf8
username: zammad
password: YYY
host: 127.0.0.1

development:
adapter: postgresql
database: zammad_production
pool: 50
timeout: 5000
encoding: utf8
username: zammad
password: YYY
host: 127.0.0.1

Warning: The database defined as “test” will be erased and

re-generated from your development database when you run “rake”.

Do not set this db to the same as development or production.

test:
adapter: postgresql
database: zammad_production
pool: 50
timeout: 5000
encoding: utf8
username: zammad
password: YYY
host: 127.0.0.1

root@zammad:/opt/zammad/contrib/backup#

Any hints what I’m doing wrong?

Is grep and sed available on the affected system?
Does the following command return postgresql?

grep 'adapter:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*adapter:\(\| \)//g'

Above command is run to get database credentials ( https://github.com/zammad/zammad/blob/develop/contrib/backup/functions#L23 ) and afterwards we’ll check the adapter for -to us- expected values ( https://github.com/zammad/zammad/blob/develop/contrib/backup/functions#L52 ).

The difference between a “normal” package installation and the database.yml you provided is that you have several configurations within your database configuration.
I don’t know why (maybe it was you?), but this proberbly is the issue here.

1 Like
root@zammad:~# grep 'adapter:' < /opt/zammad/config/database.yml | sed -e 's/.*adapter:\(\| \)//g'
postgresql
postgresql
postgresql

The command returns postgresql 3 times.

However: I had to adapt the command since ${ZAMMAD_DIR} was not available. Is this intended?

The original installation of this instance was not done by me… I just got it somehow.

There’s your problem. Either adjust the scripts to your needs to cut more than one finding or cleanup your database to only hold what you really need. Usually this would be production, but this may not be correct as we both don’t know your enviroment good enough to tell.

Yeah sorry, wasn’t intended but my fault because I didn’t replace it during pasting. My bad.

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