ERROR: cannot parse line: '0000'

522 views
Skip to first unread message

dth...@telecomdesign.fr

unread,
Jul 4, 2014, 8:59:13 AM7/4/14
to pgba...@googlegroups.com
Hello,

after a backup, my script does a list backup (barman list-backup all). But I get this error for one server, that has the biggest backup (about 60 Gb) :
EXCEPTION: cannot parse line: '0000'
See log file for more details.

In log, I read this :
2014-07-04 12:08:54,108 barman.cli ERROR: cannot parse line: '0000'
See log file for more details.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 574, 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 161, in list_backup
    server.list_backups()
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 744, in list_backups
    wal_info = self.get_wal_info(backup)
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 852, in get_wal_info
    for name, size in self.get_wal_until_next_backup(backup_info):
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 828, in get_wal_until_next_backup
    name, size, _, _ = self.xlogdb_parse_line(line)
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 932, in xlogdb_parse_line
    raise ValueError("cannot parse line: %r" % (line,))
ValueError: cannot parse line: '0000'


The backup has finished normally :
2014-07-04 10:45:42,148 barman.backup INFO: copying config_file as outside /srv/soldirhost-app/pgdata directory
2014-07-04 10:45:43,065 barman.backup INFO: copying hba_file as outside /srv/soldirhost-app/pgdata directory
2014-07-04 10:45:44,399 barman.backup INFO: copying ident_file as outside /srv/soldirhost-app/pgdata directory
2014-07-04 10:45:45,706 barman.backup INFO: Copy done.
2014-07-04 10:45:45,708 barman.backup INFO: Asking PostgreSQL server to finalize the backup.
2014-07-04 10:45:56,138 barman.backup INFO: Backup end at xlog location: 511/7D03E6C8 (00000001000005110000007D, 0003E6C8)
2014-07-04 10:45:56,139 barman.backup INFO: Backup completed

This is the second time I get this error. The first, I thought that was caused by a problem of disk space. I delete all backup (actually I moved them and delete only the oldest), and all run correctly at new. My disk keep enough space for more than one backup, and barman cron keep enough space by deleting oldest. But the error came at new, for list-backup abd show-backup.
I get it when I want show latest and previous backup, but not for older, and neither for list backup of other servers.
I tried to recover the backup, I get this error :
EXCEPTION: /srv/backup-pg/barman/.soldirhost-cron.lock
See log file for more details.


I read the cron lock file, it was empty. I rename this file, recover process start normally (I interrupted it with CTRL-C). But now, when I list backup, I get :
EXCEPTION: cannot parse line: '000000010000050F000000B3\t2794634\t1404461863.000000010000050B00000040.00000020.backup\t248\t1404470746.0\tbzip2\n'
See log file for more details.


And in log :
2014-07-04 12:50:50,328 barman.cli ERROR: cannot parse line: '000000010000050F000000B3\t2794634\t1404461863.000000010000050B00000040.00000020.backup\t248\t1404470746.0\tbzip2\n'
See log file for more details.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 574, 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 161, in list_backup
    server.list_backups()
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 744, in list_backups
    wal_info = self.get_wal_info(backup)
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 852, in get_wal_info
    for name, size in self.get_wal_until_next_backup(backup_info):
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 828, in get_wal_until_next_backup
    name, size, _, _ = self.xlogdb_parse_line(line)
  File "/usr/lib/python2.7/dist-packages/barman/server.py", line 932, in xlogdb_parse_line
    raise ValueError("cannot parse line: %r" % (line,))
ValueError: cannot parse line: '000000010000050F000000B3\t2794634\t1404461863.000000010000050B00000040.00000020.backup\t248\t1404470746.0\tbzip2\n'

I will do the same thing the last time (remove all backup and free space on disk), but what is wrong ? And did I do an error by deleting cron lock file or interrupting recover process ?

Thanks for your help, Denis

Giulio Calacoci

unread,
Jul 7, 2014, 6:46:44 AM7/7/14
to pgba...@googlegroups.com
Hi Denis,
 
as far as I can see, there is a corruption in your WAL archive.
Which barman version are you using?
In the latest available version we added a fix for preventing problems like yours, so, I suggest you to update your barman installation.
 
To fix this issue you need to rebuild the WAL archive file with using: "rebuild-xlogdb <servername>" (you can use the 'all' shortcut running the command on every server).
Barman will scan all the archived WAL files and regenerate the metadata for the archive.
 
You can find additional information on the rebuild-xlogdb command insiede the 'Available command' section of the barman user guide, in the subsection 'Rebuild the WAL archive' (http://docs.pgbarman.org/#available_commands)
 
Let me know if this solve your problem with the 'cannot parse line' error.
 
regards
Giulio
--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
 Giulio Calacoci - 2ndQuadrant Italia
 PostgreSQL Training, Services and Support
 giulio....@2ndQuadrant.it | www.2ndQuadrant.it 

dth...@telecomdesign.fr

unread,
Jul 7, 2014, 9:11:50 AM7/7/14
to pgba...@googlegroups.com
Hi Giulio,

Our version of barman is 1.3.2, and in list of commands I see indeed rebuild-xlogdb. I cannot try it now, I had to delete these backups to freeing disk space for backups of week-end. I will try it next time the error rise.

Thanks for your response.

Denis

feif...@gmail.com

unread,
Jul 8, 2014, 3:38:41 AM7/8/14
to pgba...@googlegroups.com
Giulio,

I encountered the same issue several times, with barman 1.3.2. Please see the below information:

barman@barman:~$ barman delete client 20140703T055623
Deleting backup 20140703T055623 for server client
Delete associated WAL segments:
EXCEPTION: invalid xlog segment name '00000000000100000006000000AF'

See log file for more details.

2014-07-03 06:13:48,943 barman.cli ERROR: invalid xlog segment name '00000000000100000006000000AF'

See log file for more details.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 574, 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 188, in _call
    for line in result:
  File "/usr/lib/python2.7/dist-packages/barman/cli.py", line 415, in delete
    for line in server.delete_backup(backup):
  File "/usr/lib/python2.7/dist-packages/barman/backup.py", line 190, in delete_backup
    for name in self._remove_unused_wal_files(remove_until):
  File "/usr/lib/python2.7/dist-packages/barman/backup.py", line 1235, in _remove_unused_wal_files
    self.delete_wal(name)
  File "/usr/lib/python2.7/dist-packages/barman/backup.py", line 638, in delete_wal
    hashdir = os.path.join(self.config.wals_directory, xlog.hash_dir(name))
  File "/usr/lib/python2.7/dist-packages/barman/xlog.py", line 124, in hash_dir
    _, log, _ = decode_segment_name(name)
  File "/usr/lib/python2.7/dist-packages/barman/xlog.py", line 84, in decode_segment_name
    raise BadXlogSegmentName("invalid xlog segment name '%s'" % name)
BadXlogSegmentName: invalid xlog segment name '00000000000100000006000000AF'

This happened when master generated many WALs, with barman wal compression turned on, of course. After a while, when the compression was done, I could run the barman command without any problems. Is it possible that barman has little problem when checking the compression WAL files?

dth...@telecomdesign.fr

unread,
Jul 8, 2014, 9:56:46 AM7/8/14
to pgba...@googlegroups.com
Hello Guilio,

the error "cannot parse line '0000'" is back today. I used rebuild-xlogdb command, and as you said,  everything is back to normal.

Thanks.


Denis

Le lundi 7 juillet 2014 12:46:44 UTC+2, Giulio Calacoci a écrit :

Alf Normann Klausen

unread,
Dec 13, 2016, 4:45:00 AM12/13/16
to Barman, Backup and Recovery Manager for PostgreSQL
Hi,

I also got a similar message:

[barman@barman2: ~]$ barman list-backup datavarehus3
EXCEPTION
: cannot parse line: '\n'

See log file for more details.
[barman@barman2: ~]$
[barman@barman2: ~]$ barman rebuild-xlogdb datavarehus3
Rebuilding xlogdb for server datavarehus3
Done rebuilding xlogdb for server datavarehus3 (history: 0, backup_labels: 1, wal_file: 73763)


The rebuild-xlogdb solved this problem!
Thanks!

Reply all
Reply to author
Forward
0 new messages