[Docker] [Barman] rsync: change_dir "/var/lib/postgresql//pg_xlog" failed: No such file or directory

906 views
Skip to first unread message

Adil NAIMI

unread,
Jan 11, 2015, 5:41:17 PM1/11/15
to pgba...@googlegroups.com, gabriele....@2ndquadrant.it, Mo Mughrabi, ahmed elhamidi
Hi,

I'm trying to backup a Postgresql docker container using barman:

Postgresql and barman are run in the same container.

Configuration seems done correctly:

barman@05733eae00b3:~$ barman -v      

1.3.3

barman@05733eae00b3:~$ barman check main

Server main:

ssh: OK

PostgreSQL: OK

archive_mode: OK

archive_command: OK

directories: OK

retention policy settings: OK

backup maximum age: OK (no last_backup_maximum_age provided)

compression settings: OK

minimum redundancy requirements: OK (have 0 backups, expected at least 0)

But the archive command doesn't work as it should be:

postgres@05733eae00b3:~$ tail /var/log/postgresql.log 

rsync: change_dir#3 "/var/lib/barman/main/incoming" failed: No such file or directory (2)

rsync error: errors selecting input/output files, dirs (code 3) at main.c(712) [Receiver=3.1.0]

rsync: [sender] write error: Broken pipe (32)

LOG:  archive command failed with exit code 3

DETAIL:  The failed archive command was: rsync -a pg_xlog/000000010000000000000001 barman@localhost:/var/lib/barman/main/incoming/000000010000000000000001

rsync: change_dir#3 "/var/lib/barman/main/incoming" failed: No such file or directory (2)

rsync error: errors selecting input/output files, dirs (code 3) at main.c(712) [Receiver=3.1.0]

LOG:  archive command failed with exit code 3

DETAIL:  The failed archive command was: rsync -a pg_xlog/000000010000000000000001 barman@localhost:/var/lib/barman/main/incoming/000000010000000000000001

WARNING:  archiving transaction log file "000000010000000000000001" failed too many times, will try again later

When I try to sync manually, rsync fails and I think because of pg_xlog location:

postgres@05733eae00b3:~$ rsync -av pg_xlog/000000010000000000000001 barman@localhost:/var/lib/barman/main/incoming/000000010000000000000001

sending incremental file list

rsync: change_dir "/var/lib/postgresql//pg_xlog" failed: No such file or directory (2)

sent 20 bytes  received 12 bytes  64.00 bytes/sec

total size is 0  speedup is 0.00

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]

The PGDATA location is /var/lib/postgresql/data 

Is there any way to force pg_xlog location?

Adil NAIMI

unread,
Jan 11, 2015, 6:14:33 PM1/11/15
to pgba...@googlegroups.com, gabriele....@2ndquadrant.it, mo.mu...@gmail.com, ah.el...@gmail.com
Problem resolved.

The directory /var/lib/barman/main/incoming was missing.

After creating it manually, backup works :

barman@3fc9dea9ee3e:~$ barman backup main

Starting backup for server main in /var/lib/barman/main/base/20150111T230451

Backup start at xlog location: 0/5000028 (000000010000000000000005, 00000028)

Copying files.

Copy done.

Asking PostgreSQL server to finalize the backup.

Backup end at xlog location: 0/50000B8 (000000010000000000000005, 000000B8)

Backup completed

Marco Nenciarini

unread,
Jan 12, 2015, 5:30:21 AM1/12/15
to pgba...@googlegroups.com
Hi Adil,

Il 12/01/15 00:14, Adil NAIMI ha scritto:
> Problem resolved.
>
> The directory /var/lib/barman/main/incoming was missing.
>
> After creating it manually, backup works:
>
> barman@3fc9dea9ee3e:~$ barman backup main
>
> Starting backup for server main in /var/lib/barman/main/base/20150111T230451
>
> Backup start at xlog location: 0/5000028 (000000010000000000000005,
> 00000028)
>
> Copying files.
>
> Copy done.
>
> Asking PostgreSQL server to finalize the backup.
>
> Backup end at xlog location: 0/50000B8 (000000010000000000000005, 000000B8)
>
> Backup completed
>
>

I'm glad you solved the issue. To better understand what happened, could
you please attach the output of "barman diagnose" command?

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.ne...@2ndQuadrant.it | www.2ndQuadrant.it

signature.asc

Adil NAIMI

unread,
Jan 12, 2015, 6:09:52 PM1/12/15
to pgba...@googlegroups.com
Hi Marco,


Please find attached the requested infos.

Regards,

marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it

barmandignose.txt

Marco Nenciarini

unread,
Jan 13, 2015, 5:28:44 AM1/13/15
to pgba...@googlegroups.com
Hi Adil,

Il 13/01/15 00:09, Adil NAIMI ha scritto:
> Hi Marco,
>
>
> Please find attached the requested infos.
>

I don't see anything obviously wrong in your barman configuration.

Usually you don't need to create server specific directories manually,
as the "barman check" command creates them.

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.ne...@2ndQuadrant.it | www.2ndQuadrant.it

signature.asc
Reply all
Reply to author
Forward
0 new messages