Skip to content

Custom barman config file is not reported in barman commands for a config-switch #94

@tkapias

Description

@tkapias

Barman : 3.14.1
pg-backup-api : 8216de0
Gunicorn : 23.0.0

ISSUE

A new feature pushed April 24 allows to use PG_BACKUP_API_BARMAN_CONF to change the main barman config file.

But, there is an issue at the end of the execution.

pg-backup-api correctly load the custom config file, but after an operation, the barman command that it runs still include the default barman -c /etc/barman.conf.

I use WALs streaming and when I run a switchover with patroni, pg-backup-api tries to run a config-switch.
It parses the correct config file and finds the server configuration.
It closes the old replication slot, but when creating the new one I get an error that the server was not found.

TRACE

I duplicated the config file to the default location /etc/barman.conf to trick it, and like that I get not errors.

The difference is that the path in the receive-wal command is the wrong one :

/opt/pg-backup-api/bin/python3 /opt/pg-backup-api/bin/barman -c /etc/barman.conf -q receive-wal pgserver

If I check the environment of that process I can see that it should have been my custom location :

cat /proc/2825314/environ | tr '\0' '\n'
LANG=en_US.utf8
PATH=/opt/pg-backup-api/bin:/usr/local/bin:/usr/bin:/bin
HOME=/var/lib/barman
LOGNAME=barman
USER=barman
SHELL=/bin/bash
INVOCATION_ID=fc563ea11d204dc48d2e70a3bf7b8067
JOURNAL_STREAM=8:44198166
SYSTEMD_EXEC_PID=2825155
VIRTUAL_ENV=/opt/pg-backup-api
PG_BACKUP_API_BARMAN_CONF=/data/backup/barman.conf
SERVER_SOFTWARE=gunicorn/23.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions