Hello,
After an upgrade from EDB 9.4 to Postgres Community 11.7, Barman doesn't work anymore and returns the following error message :
postgres@server:/services/apps/postgres/product/ [cms2] barman -v
2.10 Barman by 2ndQuadrant (www.2ndQuadrant.com)
postgres@server:/services/apps/postgres/product/ [cms2] barman check cms2
WARNING: No backup strategy set for server 'cms2' (using default 'exclusive_backup').
WARNING: The default backup strategy will change to 'concurrent_backup' in the future. Explicitly set 'backup_options' to silence this warning.
Server cms2:
WAL archive: FAILED (please make sure WAL shipping is setup)
**EXCEPTION: LooseVersion instance has no attribute 'version'**
See log file for more details.
postgres@gva11surigel:/services/apps/postgres/product/ [cms2]
Original Barman version was 2.6. As you can see I have upgraded it to 2.10 but the problem is still present.
Content of barman.log :
2020-03-11 10:59:35,075 [29412] barman.backup_executor WARNING: No backup strategy set for server 'cms2' (using default 'exclusive_backup').
2020-03-11 10:59:35,076 [29412] barman.backup_executor WARNING: The default backup strategy will change to 'concurrent_backup' in the future. Explicitly set 'backup_options' to silence this warning.
2020-03-11 10:59:35,076 [29412] barman.server ERROR: Check 'WAL archive' failed for server 'cms2'
2020-03-11 10:59:35,148 [29412] barman.cli ERROR: LooseVersion instance has no attribute 'version'
See log file for more details.
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/barman/cli.py", line 1355, in main
p.dispatch(pre_call=global_config)
File "/usr/lib/python2.6/site-packages/argh/helpers.py", line 47, in dispatch
return dispatch(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/argh/dispatching.py", line 121, in dispatch
for line in lines:
File "/usr/lib/python2.6/site-packages/argh/dispatching.py", line 197, in _execute_command
for line in result:
File "/usr/lib/python2.6/site-packages/argh/dispatching.py", line 153, in _call
result = args.function(args)
File "/usr/lib/python2.6/site-packages/barman/cli.py", line 647, in check
server.check()
File "/usr/lib/python2.6/site-packages/barman/server.py", line 548, in check
self.check_archiver_errors(check_strategy)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/barman/utils.py", line 393, in timeout
yield
File "/usr/lib/python2.6/site-packages/barman/server.py", line 527, in check
self.check_postgres(check_strategy)
File "/usr/lib/python2.6/site-packages/barman/server.py", line 658, in check_postgres
remote_status = self.get_remote_status()
File "/usr/lib/python2.6/site-packages/barman/remote_status.py", line 67, in get_remote_status
self._remote_status = self.fetch_remote_status()
File "/usr/lib/python2.6/site-packages/barman/server.py", line 1042, in fetch_remote_status
result.update(archiver.get_remote_status())
File "/usr/lib/python2.6/site-packages/barman/remote_status.py", line 67, in get_remote_status
self._remote_status = self.fetch_remote_status()
File "/usr/lib/python2.6/site-packages/barman/wal_archiver.py", line 663, in fetch_remote_status
elif "9.2" < pg_version <= pgreceivexlog_version:
File "/usr/lib64/python2.6/distutils/version.py", line 296, in __cmp__
return cmp(self.version, other.version)
AttributeError: LooseVersion instance has no attribute 'version'
If I set the path_prefix to the previous EDB 9.4 binaries, there is no error :
postgres@gva11surigel:/services/apps/postgres/local/dmk/etc/ [cms2] grep path_prefix barman.conf
**path_prefix = /services/apps/postgres/product/94/db_5/9.4AS/bin/**
###path_prefix = /services/apps/postgres/product/11/db_7/bin/
postgres@gva11surigel:/services/apps/postgres/local/dmk/etc/ [cms2] barman check cms2
WARNING: No backup strategy set for server 'cms2' (using default 'exclusive_backup').
WARNING: The default backup strategy will change to 'concurrent_backup' in the future. Explicitly set 'backup_options' to silence this warning.
Server cms2:
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
is_superuser: OK
PostgreSQL streaming: OK
wal_level: OK
replication slot: FAILED (slot 'barman' not initialised: is 'receive-wal' running?)
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: OK (have 0 backups, expected at least 0)
ssh: OK (PostgreSQL server)
not in recovery: OK
systemid coherence: OK (no system Id stored on disk)
pg_receivexlog: OK
pg_receivexlog compatible: FAILED (PostgreSQL version: 11.7, pg_receivexlog version: 9.4.1.3)
receive-wal running: FAILED (See the Barman log file for more details)
archive_mode: OK
archive_command: OK
continuous archiving: OK
archiver errors: OK
postgres@gva11surigel:/services/apps/postgres/local/dmk/etc/ [cms2]
Any idea ?
Thank you and best regards,
Joël