You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Why is it needed WARNING: 'primary_conninfo' is set but 'conninfo' does not point to a standby server. Ignoring 'primary_conninfo' ? #1166
I have version 3.16 of Barman, and I can see from the source code that this is still the case. Since some update, we've started getting this warning, which constantly clutters the screen and logs. I even had to clear the message for monitoring tools like Zabbix. I decided to figure out why it was triggered, since my conninfo points to a replica, and I couldn't figure out why it was suddenly indicating it was the master. I dug into the code and found out...
if self.postgres.is_in_recovery is False:
self.postgres.close()
self.postgres = None
output.warning(
"'primary_conninfo' is set but 'conninfo' does not point to a "
"standby server. Ignoring 'primary_conninfo'."
)
if self.wal_conninfo is not None:
overrides["conninfo"] = self.wal_conninfo
elif self.wal_streaming_conninfo is not None:
overrides["conninfo"] = self.wal_streaming_conninfo
wal_conninfo = overrides.get("conninfo", self.conninfo)
if overrides:
message_parts = [
f"'{key}' overridden with '{value}'" for key, value in overrides.items()
]
# Only display message if its not a check command!
if not check_strategy:
output.info(
"Configuration overrides applied: %s", " and ".join(message_parts)
)
return wal_streaming_conninfo, wal_conninfo
Honestly, I don't understand the logic here. Could you explain? Why do you need to replace conninfo from wal_streaming_conninfo and then issue a warning about it? It looks like a bug. The documentation says that if you want wals to be taken from the master, use wal_streaming_conninfo and simultaneously use conninfo to create base copies from the replica. Why replace conninfo, and especially why issue a warning about it, if you're deliberately replacing it with wal_streaming_conninfo, which definitely connects to the master?
p.s. I tried removing primary_conninfo. Without it, the warning disappears, but backups to the DB with low activity hang because it waits for the WAL file to fill up, and with primary_conninfo, the WAL switch occurs automatically.
Could you please start by showing your barman configuration? The snippet you shared doesn't modify conninfo. If modifies wal_conninfo in some occasions
Could you please start by showing your barman configuration? The snippet you shared doesn't modify conninfo. If modifies wal_conninfo in some occasions
If conninfo indicates a connection to a replica, where else could the connection to the master be? Can you point to that location?
Configuration overrides applied: 'streaming_conninfo' overridden with 'host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres' and 'conninfo' overridden with 'host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres'
WARNING: 'primary_conninfo' is set but 'conninfo' does not point to a standby server. Ignoring 'primary_conninfo'.
That's what led me to this piece of code.
if self.wal_conninfo is not None:
overrides["conninfo"] = self.wal_conninfo
elif self.wal_streaming_conninfo is not None:
overrides["conninfo"] = self.wal_streaming_conninfo
wal_conninfo = overrides.get("conninfo", self.conninfo)
if overrides:
message_parts = [
f"'{key}' overridden with '{value}'" for key, value in overrides.items()
]
# Only display message if its not a check command!
if not check_strategy:
output.info(
"Configuration overrides applied: %s", " and ".join(message_parts)
)
return wal_streaming_conninfo, wal_conninfo
Activity
martinmarques commentedon Apr 6, 2026
Could you please start by showing your barman configuration? The snippet you shared doesn't modify
conninfo. If modifieswal_conninfoin some occasionsofigenov commentedon Apr 6, 2026
conninfo = host=replica-host port=5432 user=barman dbname=postgres connect_timeout=5
archiver = false
active = true
archiver_batch_size = 1024
backup_method = postgres
backup_options = concurrent_backup
check_timeout = 90
compression = pigz
last_backup_maximum_age = 3 DAYS
minimum_redundancy = 1
recovery_options = get-wal
retention_policy = RECOVERY WINDOW OF 6 DAYS
retention_policy_mode = auto
slot_name = barman
streaming_archiver = true
streaming_archiver_batch_size = 1024
wal_streaming_conninfo = host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres
primary_conninfo = host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres
primary_checkpoint_timeout = 60
about
If conninfo indicates a connection to a replica, where else could the connection to the master be? Can you point to that location?
ofigenov commentedon Apr 6, 2026
I also found this in my barman's log:
Configuration overrides applied: 'streaming_conninfo' overridden with 'host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres' and 'conninfo' overridden with 'host=master-host port=5432 user=barman connect_timeout=5 dbname=postgres'
WARNING: 'primary_conninfo' is set but 'conninfo' does not point to a standby server. Ignoring 'primary_conninfo'.
That's what led me to this piece of code.
https://github.com/EnterpriseDB/barman/blob/release/3.16.0/barman/config.py#L1137
This clearly indicates that conninfo is being replaced by a connection to the master.