sauspiel / rbarman Goto Github PK
View Code? Open in Web Editor NEWRuby gem for postgres barman
License: MIT License
Ruby gem for postgres barman
License: MIT License
Hi,
The following command:
sudo -u barman /usr/bin/ruby /var/lib/barman/prog/check_barman/check-barman.rb -a last_wal_received -s db -w 1 -c 2
raises this following error:
/var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/wal_file.rb:109:in `parse': name '00000002.history' has to be exactly 24 chars (RBarman::InvalidWalFileNameError)
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:195:in `block in parse_wal_files_list'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:194:in `each'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:194:in `parse_wal_files_list'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:119:in `wal_files'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:71:in `block in backups'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:68:in `each'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:68:in `backups'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/cli_command.rb:54:in `backup'
from /var/lib/gems/2.1.0/gems/rbarman-0.0.16/lib/rbarman/backup.rb:298:in `by_id'
from /var/lib/barman/prog/check_barman/check-barman.rb:84:in `check_last_wal_received'
from /var/lib/barman/prog/check_barman/check-barman.rb:243:in `<main>'
This is following a PITR recovery of the DB, I suspect this 00000002.history
is perfectly valid
barman@barman2:~$ barman -v
2.3
Barman by 2ndQuadrant (www.2ndQuadrant.com)
barman@barman2:~$ barman list-files --target wal db 20230319T042101 | head
/var/lib/barman/db/wals/00000002.history
/var/lib/barman/db/wals/0000000200002E80/0000000200002E8000000075
/var/lib/barman/db/wals/0000000200002E80/0000000200002E8000000076
/var/lib/barman/db/wals/0000000200002E80/0000000200002E8000000077
/var/lib/barman/db/wals/0000000200002E80/0000000200002E8000000078
/var/lib/barman/db/wals/0000000200002E80/0000000200002E8000000079
I'm not sure on what to do to fix this...
Hi,
Exception is:
/usr/local/rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/time.rb:267:in `parse': no time information in "None" (ArgumentError)
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/backup.rb:116:in `backup_start='
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:239:in `block in parse_backup_info_file'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:235:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:235:in `parse_backup_info_file'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:69:in `block in backups'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:68:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/cli_command.rb:68:in `backups'
from /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rbarman-0.0.13/lib/rbarman/backups.rb:20:in `all'
from ./check-barman.rb:78:in `check_last_wal_received'
from ./check-barman.rb:202:in `<main>'
Problem is that a failed backup has no begin time, end time, as I'm not fluid in ruby I can't look for the exact code portion, I think you will be faster with that!
Here is the output from show-backup:
Backup 20140518T220002:
Server Name : xxx.xxx.xx
Status : FAILED
Error: : failure detecting data directory
bash-4.1$ barman show-backup xxx.xxx.xx 20140520T205254
Backup 20140520T205254:
Server Name : xxx.xxx.xx
Status : DONE
PostgreSQL Version: 90302
PGDATA directory : /var/lib/pgsql/9.3/data
Base backup information:
Disk usage : 10.1 GiB
Timeline : 1
Begin WAL : 00000001000000160000005A
End WAL : 00000001000000160000005A
WAL number : 1
Begin time : 2014-05-20 20:52:54.493173
End time : 2014-05-20 21:13:16.234241
Begin Offset : 40
End Offset : 2603104
Begin XLOG : 16/5A000028
End XLOG : 16/5A27B860
WAL information:
No of files : 41
Disk usage : 211.6 MiB
Last available : 000000010000001600000083
Catalog information:
Retention Policy: VALID
Previous Backup : 20140513T210335
Next Backup : - (this is the latest base backup)
After removing the failed backup the status is reported as it should
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.