Menu

#57 barman 1.3.3 fails on any operations on existing backup / corrupt backups

1.x
closed
bug (3)
2014-12-24
2014-12-12
No

barman list-backup servername
EXCEPTION: unsupported operand type(s) for -: 'float' and 'NoneType'
See log file for more details.

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 617, in main
p.dispatch(pre_call=global_config, output_file=_output_stream)
File "/usr/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
return dispatch(self, args, *kwargs)
File "/usr/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
for line in lines:
File "/usr/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
for line in result:
File "/usr/lib/python2.7/dist-packages/argh/dispatching.py", line 156, in _call
result = args.function(args)
File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 188, in list_backup
server.list_backups()
File "/usr/lib/python2.7/dist-packages/barman/server.py", line 806, in list_backups
wal_info = self.get_wal_info(backup)
File "/usr/lib/python2.7/dist-packages/barman/server.py", line 963, in get_wal_info
wal_info['wal_first_timestamp'])
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

happens in
wal_info['wal_total_seconds'] = (wal_info['wal_last_timestamp'] -
wal_info['wal_first_timestamp'])

with conditions
{'wal_until_next_compression_ratio': 0, 'wals_per_second': 0.0, 'wal_until_next_size': 1682262317, 'wal_until_next_num': 759, 'wal_num': 9, 'wal_first_timestamp': None, 'wal_last': '00000001000003CE00000015', 'wal_size': 20066208, 'wal_last_timestamp': 1418391403.0, 'wal_compression_ratio': 0, 'wal_first': None}

so it's problem with 'wal_first_timestamp': None
moreover some strange thing 'wal_first': None
not sure should i fire another bug for it, in normal backup problem should not be raised

backup was made from streaming slave with pgespresso installed, wal archives ships from master pg.

backup.info for broken backup (excerpts)

backup_label='START WAL LOCATION: 3CA/EB006950 (file 00000001000003CA000000EB)\nCHECKPOINT LOCATION: 3CA/EB008608\nBACKUP METHOD: streamed\nBACKUP FROM: standby\nSTART TIME: 2014-12-12 03:54:55 MSK\nLABEL: Barman backup servername 20141212T035455\n'
begin_offset=26960
begin_time=2014-12-12 03:54:55.378062+03:00
begin_wal=00000001000003CA000000EB
begin_xlog=3CA/EB006950
end_offset=0
end_time=2014-12-12 03:56:25.585227+03:00
end_wal=00000001000003CB0000001E
end_xlog=3CB/1F000000
error=None
mode=default
pgdata=/data/replica/servername
server_name=servername
size=1488043192
status=DONE
tablespaces=None
timeline=1
version=90304

wallog 00000001000003CA000000EB isnt exists in barman wals or incoming folders

======
how to get in such a problem

  1. setup master & slave
  2. setup log shipping from master to barman
  3. make backup, it says all ok, but START WAL LOCATION is before first shipped log from master

so, barman should
1. not crash on operations with backups, 1 such backup and all others are unavailable to work with (all servers operations, same server operations)
2. check this condition and avoid mark backup as good

Discussion

  • Gabriele Bartolini

    • status: open --> closed
    • assigned_to: Giulio Calacoci
     

Log in to post a comment.