barman stop backup

3,818 views
Skip to first unread message

Andrea Oitana

unread,
Nov 27, 2014, 4:00:20 AM11/27/14
to pgba...@googlegroups.com
I had barman installed an running for a while and he worked properly without notice any issue.

A couple of week ago I decided to upgrade postgresql from 9.3.2 to 9.3.5

after upgrade i started barman backup manually and I noticed the process stop after a couple of minutes without any error.
a fast look on log files showed this messages:

barman.backup ERROR: Backup failed starting the backup: PostgreSQL server is already in exclusive backup mode
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/barman/backup.py", line 468, in backup
    self.backup_start(backup_info)
  File "/usr/local/lib/python2.7/dist-packages/barman/backup.py", line 839, in backup_start
    raise Exception('concurrent exclusive backups are not allowed')

postgres showed no other backup was running

select pg_stop_backup();
ERROR:  a backup is not in progress

and also barman showed everything was ok

barman status main
Server main:
        description: TGS C3 PostgreSQL Database
        PostgreSQL version: 9.3.5 
        PostgreSQL Data directory: /media/db/fast/01/postgresql/9.3/main 
        archive_command: rsync -a %p barman@localhost:/media/db/slow/01/pgbackup/main/incoming/%f 
        archive_status: last shipped WAL segment 00000001000001D0000000E3
        current_xlog: 00000001000001D0000000E4 
        Retention policies: enforced (mode: auto, retention: RECOVERY WINDOW OF 4 WEEKS, WAL retention: main)
        No. of available backups: 27
        first available backup: 20141030T040001
        last available backup: 20141125T040001


barman check main
Server main:
        ssh: OK
        PostgreSQL: OK
        archive_mode: OK
        archive_command: OK
        directories: OK
        retention policy settings: OK
        compression settings: OK
        minimum redundancy requirements: OK (have 27 backups, expected at least 1)

I tried to launch back manually a couple of time and barman restart to work.

Yesterday I made an extensive work on database, and now barman again stop to work.

As last time apparently no problem were found, 
postgres still assert non backup is in progress.

Any idea?

Gabriele Bartolini

unread,
Nov 27, 2014, 4:09:40 AM11/27/14
to pgba...@googlegroups.com
Hi Andrea,

  do you mind sending us the output of "barman diagnose"? Also PostgreSQL logs around that time would be useful.

Thanks,
Gabriele

--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

--
--
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.

Andrea Oitana

unread,
Nov 27, 2014, 4:36:03 AM11/27/14
to pgba...@googlegroups.com
Hi Gabriele,
Thank you for your prompt reply,

postgres log shows 
user=postgres,db=postgres 2014-11-27 09:26:01 GMT ERROR:  canceling statement due to statement timeout
user=postgres,db=postgres 2014-11-27 09:26:01 GMT STATEMENT:  SELECT xlog_loc, (pg_xlogfile_name_offset(xlog_loc)).* from pg_start_backup('Barman backup') as xlog_loc

trying to run command barman diagnose i discovered that barman runnig version
/usr/bin/barman -v
1.2.0

despite dpkg show that installed version is 
dpkg -l | grep barman
ii  barman                                 1.3.3-1.pgdg12.4+1                                      Backup and Recovery Manager for PostgreSQL

I will keep you up to date after further investigations

Il giorno giovedì 27 novembre 2014 10:09:40 UTC+1, Gabriele Bartolini ha scritto:
Hi Andrea,

  do you mind sending us the output of "barman diagnose"? Also PostgreSQL logs around that time would be useful.

Thanks,
Gabriele
--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

Andrea Oitana

unread,
Nov 27, 2014, 5:43:56 AM11/27/14
to pgba...@googlegroups.com
Something weird,

> sudo apt-get remove barman
[omissis...]

The following packages will be REMOVED:
  barman
[omissis...]

> barman
The program 'barman' is currently not installed. You can install it by typing:
apt-get install barman

> sudo apt-get install barman
[omissis...]

Unpacking barman (from .../barman_1.3.3-1.pgdg12.4+1_all.deb) ...
Processing triggers for man-db ...
Setting up barman (1.3.3-1.pgdg12.4+1) ...
> barman -v
1.2.0

Marco Nenciarini

unread,
Nov 27, 2014, 5:54:42 AM11/27/14
to pgba...@googlegroups.com
Il 27/11/14 11:43, Andrea Oitana ha scritto:
Any chance you ever manually installed barman using pip?

You could verify where barman is installed running

which -a barman

It will show you how many barman executables are on your system and
where they are.

Regards,
Marco

--
Marco Nenciarini
mne...@gmail.com

signature.asc

Andrea Oitana

unread,
Nov 27, 2014, 5:57:27 AM11/27/14
to pgba...@googlegroups.com
I will try to install from source.

> which -a barman 
/usr/bin/barman
> /usr/bin/barman -v
1.2.0
> dpkg -l | grep barman
ii  barman                                 1.3.3-1.pgdg12.4+1                                      Backup and Recovery Manager for PostgreSQL


Marco Nenciarini

unread,
Nov 27, 2014, 6:03:34 AM11/27/14
to pgba...@googlegroups.com
Il 27/11/14 11:57, Andrea Oitana ha scritto:
> I will try to install from source.
>
>> which -a barman
> /usr/bin/barman
>> /usr/bin/barman -v
> 1.2.0
>> dpkg -l | grep barman
> ii barman 1.3.3-1.pgdg12.4+1
> Backup and Recovery Manager for PostgreSQL
>

Could you please paste here the output of the following command?

python -v /usr/bin/barman -v 2>&1 | grep barman

It will show verbosely the list of modules loaded by python running barman.

Regards,
Marco

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

signature.asc

Andrea Oitana

unread,
Nov 27, 2014, 6:44:25 AM11/27/14
to pgba...@googlegroups.com


Could you please paste here the output of the following command?

    python -v /usr/bin/barman -v 2>&1 | grep barman

It will show verbosely the list of modules loaded by python running barman.

Sorry, I didn't read your reply before removing barman from ubuntu packages and reinstall it from source
now /usr/bin/barman -v show right version number
1.3.3
and manual backup start properly without any error

Starting backup for server main in /media/db/slow/01/pgbackup/main/base/20141127T111752
Backup start at xlog location: 1D1/30033110 (00000001000001D100000030, 00033110)
Copying files.

I will update you after backup finished.

Seems that ubuntu package was unable to correctly update barman.

I also remove barman package apt-get remove barman and manually to install deb packages with command sudo dpkg -i barman_1.3.3-1.pgdg12.4+1_all.deb
it didn't fix the issue,

only deleting ubuntu package with apt-get remove barman
and installation from source 
./setup.py build
./setup.py install
Correctly fix the issue.

server is
cat /etc/issue
Ubuntu 12.04.5 LTS \n \l

with this packages
barman_1.3.3-1.pgdg12.4+1_all.deb

After fix installation i ran barman diagnose, here an extract:

{
    "global": {
        "config": {
            "bandwidth_limit": "0", 
            "barman_home": "/media/db/slow/01/pgbackup", 
            "barman_user": "barman", 
            "compression": "None", 
            "immediate_checkpoint": "true", 
            "log_file": "/var/log/barman/barman.log", 
            "network_compression": "false"
        }, 
        "system_info": {
            "barman_ver": "1.3.3", 
            "kernel_ver": "Linux tgs-srv-02 3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux", 
            "python_ver": "Python 2.7.3", 
            "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 12.04.5 LTS\nRelease:\t12.04\nCodename:\tprecise", 
            "rsync_ver": "rsync  version 3.0.9  protocol version 30", 
            "ssh_ver": "OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012"
        }
    }, 
    "servers": {
        "main": {
            "backups": {
                "20141030T040001": {
                    "backup_id": "20141030T040001", 
                    "backup_label": "None", 
                    "begin_offset": "1008", 
                    "begin_time": "Thu Oct 30 04:00:01 2014", 
                    "begin_wal": "000000010000011C00000033", 
                    "begin_xlog": "11C/330003F0", 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "end_offset": "5761640", 
                    "end_time": "Thu Oct 30 05:18:19 2014", 
                    "end_wal": "000000010000011C00000043", 
                    "end_xlog": "11C/4357EA68", 
                    "error": null, 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/media/db/fast/01/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": 157213799631, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 90304
                }, 

[omissis...]

"20141125T040001": {
                    "backup_id": "20141125T040001", 
                    "backup_label": "None", 
                    "begin_offset": "104", 
                    "begin_time": "Tue Nov 25 04:00:01 2014", 
                    "begin_wal": "0000000100000198000000AA", 
                    "begin_xlog": "198/AA000068", 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "end_offset": "15525032", 
                    "end_time": "Tue Nov 25 05:10:04 2014", 
                    "end_wal": "0000000100000198000000D5", 
                    "end_xlog": "198/D5ECE4A8", 
                    "error": null, 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/media/db/fast/01/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": 189657484173, 
                    "status": "DONE", 
                    "tablespaces": null, 
                    "timeline": 1, 
                    "version": 90305
                }, 
                "20141126T040001": {
                    "backup_id": "20141126T040001", 
                    "backup_label": "None", 
                    "begin_offset": null, 
                    "begin_time": null, 
                    "begin_wal": null, 
                    "begin_xlog": null, 
                    "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                    "end_offset": null, 
                    "end_time": null, 
                    "end_wal": null, 
                    "end_xlog": null, 
                    "error": "failure starting the backup: PostgreSQL server is already in exclusive backup mode", 
                    "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                    "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                    "mode": "default", 
                    "pgdata": "/media/db/fast/01/postgresql/9.3/main", 
                    "server_name": "main", 
                    "size": null, 
                    "status": "FAILED", 
                    "tablespaces": null, 
                    "timeline": null, 
                    "version": 90305
                }, 

"config": {
                "active": true, 
                "backup_directory": "/media/db/slow/01/pgbackup/main", 
                "backup_options": "exclusive_backup", 
                "bandwidth_limit": 0, 
                "barman_home": "/media/db/slow/01/pgbackup", 
                "basebackup_retry_sleep": 30, 
                "basebackup_retry_times": 0, 
                "basebackups_directory": "/media/db/slow/01/pgbackup/main/base", 
                "compression": null, 
                "conninfo": "host=localhost user=postgres", 
                "custom_compression_filter": null, 
                "custom_decompression_filter": null, 
                "description": "TGS C3 PostgreSQL Database", 
                "immediate_checkpoint": true, 
                "incoming_wals_directory": "/media/db/slow/01/pgbackup/main/incoming", 
                "last_backup_maximum_age": null, 
                "lock_file": "/media/db/slow/01/pgbackup/main/main.lock", 
                "minimum_redundancy": 1, 
                "name": "main", 
                "network_compression": false, 
                "post_archive_script": null, 
                "post_backup_script": null, 
                "pre_archive_script": null, 
                "pre_backup_script": null, 
                "retention_policy": "window 4", 
                "retention_policy_mode": "auto", 
                "ssh_command": "ssh postgres@localhost", 
                "tablespace_bandwidth_limit": null, 
                "wal_retention_policy": "simple-wal 4", 
                "wals_directory": "/media/db/slow/01/pgbackup/main/wals"
            }, 
            "status": {
                "archive_command": "rsync -a %p barman@localhost:/media/db/slow/01/pgbackup/main/incoming/%f", 
                "archive_mode": "on", 
                "config_file": "/etc/postgresql/9.3/main/postgresql.conf", 
                "current_xlog": "00000001000001D10000002F", 
                "data_directory": "/media/db/fast/01/postgresql/9.3/main", 
                "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", 
                "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", 
                "last_shipped_wal": "00000001000001D10000002E", 
                "pgespresso_installed": false, 
                "server_txt_version": "9.3.5"
            }, 
            "system_info": {
                "kernel_ver": "Linux tgs-srv-02 3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux", 
                "python_ver": "Python 2.7.3", 
                "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 12.04.5 LTS\nRelease:\t12.04\nCodename:\tprecise", 
                "rsync_ver": "rsync  version 3.0.9  protocol version 30", 
                "ssh_ver": "OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012"
            }
        }
    }
}

 

Regards,
Marco

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

Marco Nenciarini

unread,
Nov 27, 2014, 6:54:39 AM11/27/14
to pgba...@googlegroups.com
Il 27/11/14 12:44, Andrea Oitana ha scritto:
The manually installed python modules usually takes precedence on
package installed ones.

If you want to use the package (which I strongly advise), you need to
completely remove the manual installed modules.

Normally using "pip uninstall" does the trick, but in some cases you
need to manually delete the module directories and executables.

Regards,
Marco

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

signature.asc

Gabriele Bartolini

unread,
Nov 27, 2014, 6:56:35 AM11/27/14
to pgba...@googlegroups.com
Hi Andrea,

  it seems to me that there have been issues with the installation. I *strongly* recommend you stick with apt management of the Barman package for a lot of reasons (including, for example, cron, log rotation, Python dependencies).

  I encourage you to perform a fresh new installation. Also, can you please describe the location of the backup disk? Is it a remote disk?

Cheers,
Gabriele

--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

Andrea Oitana

unread,
Nov 27, 2014, 8:19:50 AM11/27/14
to pgba...@googlegroups.com
I need I working backup after big workload on db, so i decided to install from source. I know is not recommended in a distro that rely on packages.

So, after havin my backup and fell a little bit safe... 

i runned pip uninstall barman

and again apt-get install barman
same result as previous
barman -v shows
1.2.0

python -v /usr/bin/barman -v 2>&1 | grep barman 
import barman # directory /usr/local/lib/python2.7/dist-packages/barman
# /usr/local/lib/python2.7/dist-packages/barman/__init__.pyc matches /usr/local/lib/python2.7/dist-packages/barman/__init__.py
import barman # precompiled from /usr/local/lib/python2.7/dist-packages/barman/__init__.pyc
# /usr/local/lib/python2.7/dist-packages/barman/version.pyc matches /usr/local/lib/python2.7/dist-packages/barman/version.py
import barman.version # precompiled from /usr/local/lib/python2.7/dist-packages/barman/version.pyc
# /usr/local/lib/python2.7/dist-packages/barman/cli.pyc matches /usr/local/lib/python2.7/dist-packages/barman/cli.py
import barman.cli # precompiled from /usr/local/lib/python2.7/dist-packages/barman/cli.pyc
# /usr/local/lib/python2.7/dist-packages/barman/lockfile.pyc matches /usr/local/lib/python2.7/dist-packages/barman/lockfile.py
import barman.lockfile # precompiled from /usr/local/lib/python2.7/dist-packages/barman/lockfile.pyc
# /usr/local/lib/python2.7/dist-packages/barman/server.pyc matches /usr/local/lib/python2.7/dist-packages/barman/server.py
import barman.server # precompiled from /usr/local/lib/python2.7/dist-packages/barman/server.pyc
# /usr/local/lib/python2.7/dist-packages/barman/xlog.pyc matches /usr/local/lib/python2.7/dist-packages/barman/xlog.py
import barman.xlog # precompiled from /usr/local/lib/python2.7/dist-packages/barman/xlog.pyc
# /usr/local/lib/python2.7/dist-packages/barman/backup.pyc matches /usr/local/lib/python2.7/dist-packages/barman/backup.py
import barman.backup # precompiled from /usr/local/lib/python2.7/dist-packages/barman/backup.pyc
# /usr/local/lib/python2.7/dist-packages/barman/command_wrappers.pyc matches /usr/local/lib/python2.7/dist-packages/barman/command_wrappers.py
import barman.command_wrappers # precompiled from /usr/local/lib/python2.7/dist-packages/barman/command_wrappers.pyc
# /usr/local/lib/python2.7/dist-packages/barman/compression.pyc matches /usr/local/lib/python2.7/dist-packages/barman/compression.py
import barman.compression # precompiled from /usr/local/lib/python2.7/dist-packages/barman/compression.pyc
# /usr/local/lib/python2.7/dist-packages/barman/retention_policies.pyc matches /usr/local/lib/python2.7/dist-packages/barman/retention_policies.py
import barman.retention_policies # precompiled from /usr/local/lib/python2.7/dist-packages/barman/retention_policies.pyc
# /usr/local/lib/python2.7/dist-packages/barman/config.pyc matches /usr/local/lib/python2.7/dist-packages/barman/config.py
import barman.config # precompiled from /usr/local/lib/python2.7/dist-packages/barman/config.pyc
# cleanup[2] barman.lockfile
# cleanup[2] barman.server
# cleanup[2] barman.compression
# cleanup[2] barman.config
# cleanup[2] barman.command_wrappers
# cleanup[2] barman.version
# cleanup[2] barman.backup
# cleanup[2] barman
# cleanup[2] barman.retention_policies
# cleanup[2] barman.cli
# cleanup[2] barman.xlog




Il giorno giovedì 27 novembre 2014 12:56:35 UTC+1, Gabriele Bartolini ha scritto:
Hi Andrea,

  it seems to me that there have been issues with the installation. I *strongly* recommend you stick with apt management of the Barman package for a lot of reasons (including, for example, cron, log rotation, Python dependencies).

  I encourage you to perform a fresh new installation. Also, can you please describe the location of the backup disk? Is it a remote disk?

Cheers,
Gabriele
--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

Andrea Oitana

unread,
Nov 27, 2014, 8:22:31 AM11/27/14
to pgba...@googlegroups.com


Il giorno giovedì 27 novembre 2014 12:56:35 UTC+1, Gabriele Bartolini ha scritto:
Hi Andrea,

  it seems to me that there have been issues with the installation. I *strongly* recommend you stick with apt management of the Barman package for a lot of reasons (including, for example, cron, log rotation, Python dependencies).

  I encourage you to perform a fresh new installation. Also, can you please describe the location of the backup disk? Is it a remote disk?


Not worked

backup disk, as live postgres files lies on a nas connected to the server via iscsi multipath,  

Andrea Oitana

unread,
Nov 27, 2014, 8:32:29 AM11/27/14
to pgba...@googlegroups.com


Il giorno giovedì 27 novembre 2014 14:22:31 UTC+1, Andrea Oitana ha scritto:


Il giorno giovedì 27 novembre 2014 12:56:35 UTC+1, Gabriele Bartolini ha scritto:
Hi Andrea,

  it seems to me that there have been issues with the installation. I *strongly* recommend you stick with apt management of the Barman package for a lot of reasons (including, for example, cron, log rotation, Python dependencies).

  I encourage you to perform a fresh new installation. Also, can you please describe the location of the backup disk? Is it a remote disk?


I was able to have a right barman version installed from ubuntu packages manulaly deleting directory  
/usr/local/lib/python2.7/dist-packages/barman, but still some problems

now with root users barman -v show
1.3.3

and
python -v /usr/bin/barman -v 2>&1 | grep barman 
import barman # directory /usr/lib/python2.7/dist-packages/barman
# /usr/lib/python2.7/dist-packages/barman/__init__.pyc matches /usr/lib/python2.7/dist-packages/barman/__init__.py
import barman # precompiled from /usr/lib/python2.7/dist-packages/barman/__init__.pyc
# /usr/lib/python2.7/dist-packages/barman/version.pyc matches /usr/lib/python2.7/dist-packages/barman/version.py
import barman.version # precompiled from /usr/lib/python2.7/dist-packages/barman/version.pyc
# /usr/lib/python2.7/dist-packages/barman/cli.pyc matches /usr/lib/python2.7/dist-packages/barman/cli.py
import barman.cli # precompiled from /usr/lib/python2.7/dist-packages/barman/cli.pyc
# /usr/lib/python2.7/dist-packages/barman/output.pyc matches /usr/lib/python2.7/dist-packages/barman/output.py
import barman.output # precompiled from /usr/lib/python2.7/dist-packages/barman/output.pyc
# /usr/lib/python2.7/dist-packages/barman/infofile.pyc matches /usr/lib/python2.7/dist-packages/barman/infofile.py
import barman.infofile # precompiled from /usr/lib/python2.7/dist-packages/barman/infofile.pyc
# /usr/lib/python2.7/dist-packages/barman/xlog.pyc matches /usr/lib/python2.7/dist-packages/barman/xlog.py
import barman.xlog # precompiled from /usr/lib/python2.7/dist-packages/barman/xlog.pyc
# /usr/lib/python2.7/dist-packages/barman/compression.pyc matches /usr/lib/python2.7/dist-packages/barman/compression.py
import barman.compression # precompiled from /usr/lib/python2.7/dist-packages/barman/compression.pyc
# /usr/lib/python2.7/dist-packages/barman/command_wrappers.pyc matches /usr/lib/python2.7/dist-packages/barman/command_wrappers.py
import barman.command_wrappers # precompiled from /usr/lib/python2.7/dist-packages/barman/command_wrappers.pyc
# /usr/lib/python2.7/dist-packages/barman/utils.pyc matches /usr/lib/python2.7/dist-packages/barman/utils.py
import barman.utils # precompiled from /usr/lib/python2.7/dist-packages/barman/utils.pyc
# /usr/lib/python2.7/dist-packages/barman/lockfile.pyc matches /usr/lib/python2.7/dist-packages/barman/lockfile.py
import barman.lockfile # precompiled from /usr/lib/python2.7/dist-packages/barman/lockfile.pyc
# /usr/lib/python2.7/dist-packages/barman/server.pyc matches /usr/lib/python2.7/dist-packages/barman/server.py
import barman.server # precompiled from /usr/lib/python2.7/dist-packages/barman/server.pyc
# /usr/lib/python2.7/dist-packages/barman/config.pyc matches /usr/lib/python2.7/dist-packages/barman/config.py
import barman.config # precompiled from /usr/lib/python2.7/dist-packages/barman/config.pyc
# /usr/lib/python2.7/dist-packages/barman/backup.pyc matches /usr/lib/python2.7/dist-packages/barman/backup.py
import barman.backup # precompiled from /usr/lib/python2.7/dist-packages/barman/backup.pyc
# /usr/lib/python2.7/dist-packages/barman/fs.pyc matches /usr/lib/python2.7/dist-packages/barman/fs.py
import barman.fs # precompiled from /usr/lib/python2.7/dist-packages/barman/fs.pyc
# /usr/lib/python2.7/dist-packages/barman/hooks.pyc matches /usr/lib/python2.7/dist-packages/barman/hooks.py
import barman.hooks # precompiled from /usr/lib/python2.7/dist-packages/barman/hooks.pyc
# /usr/lib/python2.7/dist-packages/barman/retention_policies.pyc matches /usr/lib/python2.7/dist-packages/barman/retention_policies.py
import barman.retention_policies # precompiled from /usr/lib/python2.7/dist-packages/barman/retention_policies.pyc
# /usr/lib/python2.7/dist-packages/barman/diagnose.pyc matches /usr/lib/python2.7/dist-packages/barman/diagnose.py
import barman.diagnose # precompiled from /usr/lib/python2.7/dist-packages/barman/diagnose.pyc
# cleanup[2] barman.lockfile
# cleanup[2] barman.fs
# cleanup[2] barman.utils
# cleanup[2] barman.diagnose
# cleanup[2] barman.server
# cleanup[2] barman.hooks
# cleanup[2] barman.compression
# cleanup[2] barman.config
# cleanup[2] barman.command_wrappers
# cleanup[2] barman.version
# cleanup[2] barman.output
# cleanup[2] barman.backup
# cleanup[2] barman
# cleanup[2] barman.retention_policies
# cleanup[2] barman.cli
# cleanup[2] barman.xlog
# cleanup[2] barman.infofile

BUT with user barman 
barman@tgs-srv-02:/home/oity$ barman -v
Traceback (most recent call last):
  File "/usr/local/bin/barman", line 5, in <module>
    pkg_resources.run_script('barman==1.3.3', 'barman')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1229, in run_script
    raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'barman'

 python -v /usr/bin/barman -v 2>&1 | grep barman
import barman # directory /usr/lib/python2.7/dist-packages/barman
# /usr/lib/python2.7/dist-packages/barman/__init__.pyc matches /usr/lib/python2.7/dist-packages/barman/__init__.py
import barman # precompiled from /usr/lib/python2.7/dist-packages/barman/__init__.pyc
# /usr/lib/python2.7/dist-packages/barman/version.pyc matches /usr/lib/python2.7/dist-packages/barman/version.py
import barman.version # precompiled from /usr/lib/python2.7/dist-packages/barman/version.pyc
# /usr/lib/python2.7/dist-packages/barman/cli.pyc matches /usr/lib/python2.7/dist-packages/barman/cli.py
import barman.cli # precompiled from /usr/lib/python2.7/dist-packages/barman/cli.pyc
# /usr/lib/python2.7/dist-packages/barman/output.pyc matches /usr/lib/python2.7/dist-packages/barman/output.py
import barman.output # precompiled from /usr/lib/python2.7/dist-packages/barman/output.pyc
# /usr/lib/python2.7/dist-packages/barman/infofile.pyc matches /usr/lib/python2.7/dist-packages/barman/infofile.py
import barman.infofile # precompiled from /usr/lib/python2.7/dist-packages/barman/infofile.pyc
# /usr/lib/python2.7/dist-packages/barman/xlog.pyc matches /usr/lib/python2.7/dist-packages/barman/xlog.py
import barman.xlog # precompiled from /usr/lib/python2.7/dist-packages/barman/xlog.pyc
# /usr/lib/python2.7/dist-packages/barman/compression.pyc matches /usr/lib/python2.7/dist-packages/barman/compression.py
import barman.compression # precompiled from /usr/lib/python2.7/dist-packages/barman/compression.pyc
# /usr/lib/python2.7/dist-packages/barman/command_wrappers.pyc matches /usr/lib/python2.7/dist-packages/barman/command_wrappers.py
import barman.command_wrappers # precompiled from /usr/lib/python2.7/dist-packages/barman/command_wrappers.pyc
# /usr/lib/python2.7/dist-packages/barman/utils.pyc matches /usr/lib/python2.7/dist-packages/barman/utils.py
import barman.utils # precompiled from /usr/lib/python2.7/dist-packages/barman/utils.pyc
# /usr/lib/python2.7/dist-packages/barman/lockfile.pyc matches /usr/lib/python2.7/dist-packages/barman/lockfile.py
import barman.lockfile # precompiled from /usr/lib/python2.7/dist-packages/barman/lockfile.pyc
# /usr/lib/python2.7/dist-packages/barman/server.pyc matches /usr/lib/python2.7/dist-packages/barman/server.py
import barman.server # precompiled from /usr/lib/python2.7/dist-packages/barman/server.pyc
# /usr/lib/python2.7/dist-packages/barman/config.pyc matches /usr/lib/python2.7/dist-packages/barman/config.py
import barman.config # precompiled from /usr/lib/python2.7/dist-packages/barman/config.pyc
# /usr/lib/python2.7/dist-packages/barman/backup.pyc matches /usr/lib/python2.7/dist-packages/barman/backup.py
import barman.backup # precompiled from /usr/lib/python2.7/dist-packages/barman/backup.pyc
# /usr/lib/python2.7/dist-packages/barman/fs.pyc matches /usr/lib/python2.7/dist-packages/barman/fs.py
import barman.fs # precompiled from /usr/lib/python2.7/dist-packages/barman/fs.pyc
# /usr/lib/python2.7/dist-packages/barman/hooks.pyc matches /usr/lib/python2.7/dist-packages/barman/hooks.py
import barman.hooks # precompiled from /usr/lib/python2.7/dist-packages/barman/hooks.pyc
# /usr/lib/python2.7/dist-packages/barman/retention_policies.pyc matches /usr/lib/python2.7/dist-packages/barman/retention_policies.py
import barman.retention_policies # precompiled from /usr/lib/python2.7/dist-packages/barman/retention_policies.pyc
# /usr/lib/python2.7/dist-packages/barman/diagnose.pyc matches /usr/lib/python2.7/dist-packages/barman/diagnose.py
import barman.diagnose # precompiled from /usr/lib/python2.7/dist-packages/barman/diagnose.pyc
# cleanup[2] barman.lockfile
# cleanup[2] barman.fs
# cleanup[2] barman.utils
# cleanup[2] barman.diagnose
# cleanup[2] barman.server
# cleanup[2] barman.hooks
# cleanup[2] barman.compression
# cleanup[2] barman.config
# cleanup[2] barman.command_wrappers
# cleanup[2] barman.version
# cleanup[2] barman.output
# cleanup[2] barman.backup
# cleanup[2] barman
# cleanup[2] barman.retention_policies
# cleanup[2] barman.cli
# cleanup[2] barman.xlog
# cleanup[2] barman.infofile



barman was originally installed by ubuntu packages and I never tried to install by source until this morning, when I noticed the missed backup issue

Gabriele Bartolini

unread,
Nov 27, 2014, 9:08:43 AM11/27/14
to pgba...@googlegroups.com
Ciao Andrea,

  it is possible to run Barman in a multi-user scenario, using different configuration files. However, a typical installation normally uses the 'barman' user with default configuration in /etc/barman.conf. This way, even the root user can execute barman commands in a safe way.

  A typical Barman installation, however, resides on a different server than the one where Postgres is running.

  Are you really, really, really sure that there was no coexistence of two Barman versions in your server?

Thanks,
Gabriele

--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele....@2ndQuadrant.it | www.2ndQuadrant.it

--

Andrea Oitana

unread,
Nov 27, 2014, 9:16:51 AM11/27/14
to pgba...@googlegroups.com
Sorry my fault, 

I didn't realyze that source installation has /usr/local/bin/barman and /usr/local/lib/python2.7/dist-packages/barman as target, 
but apt-get use /usr/bin/barman and /usr/lib/python2.7/dist-packages/ as target

so, after lunch break and coffee:

A previous version of barman (1.2.0) was installed on the server. When I start to manage server barman was already installed
At this point I can't state if was a copy installed with source, but I'm sure was a copy installed by package.
I decided to upgrade server with apt-get upgrade
I made upgrade
Barman failed to run programmed backup with error
raise Exception('concurrent exclusive backups are not allowed')
but barman cron still work properly.
I call barman backup a couple of time manually after that barman start working again.
he worked for a couple of week until yesterday we had a huge work on database
barman backup stop working with again the same error
raise Exception('concurrent exclusive backups are not allowed')
further check showed me that current installed package and running version was different.
I had installed barman from source packages to be able to have a working backup (my priority is to have a postgresql working and safe :) )
after that
pip uninstall barman seems not fix issue.
I had do an apt-get remove barman and manually to delete /usr/local/bin/barman and /usr/local/lib/python2.7/dist-packages/barman
before install again barman with apt-get install

now barman is working properly

hope this can help someone else in the future, many thanks for you help and patience


Andrea Oitana

unread,
Nov 27, 2014, 9:31:48 AM11/27/14
to pgba...@googlegroups.com


Il giorno giovedì 27 novembre 2014 15:08:43 UTC+1, Gabriele Bartolini ha scritto:
Ciao Andrea,

Ciao Gabriele
 

  it is possible to run Barman in a multi-user scenario, using different configuration files. However, a typical installation normally uses the 'barman' user with default configuration in /etc/barman.conf. This way, even the root user can execute barman commands in a safe way.

  A typical Barman installation, however, resides on a different server than the one where Postgres is running.

  Are you really, really, really sure that there was no coexistence of two Barman versions in your server?

Yep as I stated in my last post, I acquired this server with barman already installed, before upgrade I checked which package was installed. I saw barman installed by packages I not made further investigation to verify that barman was also installed by source. So I'm not sure if barman was or not installed twice one with packages one with sources.

despite this is not clear to me why barman still worked properly till yesterday

as you can see

main 20141127T111752 - Thu Nov 27 12:19:39 2014 - Size: 160.7 GiB - WAL Size: 880.0 MiB <<< barman 1.3.3
main 20141127T030001 - FAILED
main 20141126T040001 - FAILED <<< barman 1.2.0 (no other system upgrade)
main 20141125T040001 - Tue Nov 25 05:10:04 2014 - Size: 176.6 GiB - WAL Size: 226.1 GiB
main 20141124T040002 - Mon Nov 24 05:10:29 2014 - Size: 176.1 GiB - WAL Size: 14.9 GiB
main 20141123T040001 - Sun Nov 23 05:10:55 2014 - Size: 175.0 GiB - WAL Size: 17.0 GiB
main 20141122T040001 - Sat Nov 22 05:09:54 2014 - Size: 174.1 GiB - WAL Size: 15.6 GiB
main 20141121T040001 - Fri Nov 21 05:11:32 2014 - Size: 173.2 GiB - WAL Size: 14.0 GiB
main 20141120T040001 - Thu Nov 20 05:11:35 2014 - Size: 172.3 GiB - WAL Size: 17.0 GiB
main 20141119T040001 - Wed Nov 19 05:11:20 2014 - Size: 171.6 GiB - WAL Size: 18.2 GiB
main 20141118T040001 - Tue Nov 18 05:10:28 2014 - Size: 170.6 GiB - WAL Size: 18.2 GiB
main 20141117T040001 - Mon Nov 17 05:10:48 2014 - Size: 170.0 GiB - WAL Size: 18.3 GiB
main 20141116T040001 - Sun Nov 16 05:10:01 2014 - Size: 168.7 GiB - WAL Size: 21.2 GiB
main 20141115T040001 - Sat Nov 15 05:09:47 2014 - Size: 166.9 GiB - WAL Size: 21.8 GiB
main 20141114T040001 - Fri Nov 14 05:07:30 2014 - Size: 166.1 GiB - WAL Size: 18.5 GiB
main 20141113T120513 - Thu Nov 13 13:15:33 2014 - Size: 165.6 GiB - WAL Size: 12.6 GiB <<< barman 1.2.0
main 20141113T040001 - FAILED <<< ubuntu upgrade (postgresql from 9.3.2 to 9.3.5)
main 20141112T040001 - Wed Nov 12 05:08:10 2014 - Size: 163.3 GiB - WAL Size: 21.7 GiB
main 20141111T040001 - Tue Nov 11 05:08:02 2014 - Size: 162.0 GiB - WAL Size: 16.8 GiB
main 20141110T040001 - Mon Nov 10 05:08:53 2014 - Size: 161.2 GiB - WAL Size: 17.5 GiB  <<< barman 1.2.0

 
 Grazie per la pazienza, Andrea


Thanks,
Gabriele

--
 Gabriele Bartolini - 2ndQuadrant Italia - Managing Director
 PostgreSQL Training, Services and Support
 gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

Marco Nenciarini

unread,
Nov 27, 2014, 9:40:53 AM11/27/14
to pgba...@googlegroups.com
Il 27/11/14 15:31, Andrea Oitana ha scritto:
>
>
> despite this is not clear to me why barman still worked properly till
> yesterday
>

The failure you experienced is probably because you have a global
`statement_timeout` for your server. The start backup command, by
default, can take up to a
`checkpoint_timeout`*`checkpoint_completion_target` seconds because it
needs to make a checkpoint and try to spread the requires writes to not
overload your disk. However the real time it takes depends on the actual
load of your server, and is it possible that sometime it lasts longer
than what is permitted by your `statement_timeout` setting.

Regards,
Marco

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

signature.asc

Andrea Oitana

unread,
Nov 27, 2014, 9:52:15 AM11/27/14
to pgba...@googlegroups.com


Il giorno giovedì 27 novembre 2014 15:40:53 UTC+1, Marco Nenciarini ha scritto:
Il 27/11/14 15:31, Andrea Oitana ha scritto:
>
>
> despite this is not clear to me why barman still worked properly till
> yesterday
>

The failure you experienced is probably because you have a global
`statement_timeout` for your server. The start backup command, by
default, can take up to a
`checkpoint_timeout`*`checkpoint_completion_target` seconds because it
needs to make a checkpoint and try to spread the requires writes to not
overload your disk. However the real time it takes depends on the actual
load of your server, and is it possible that sometime it lasts longer
than what is permitted by your `statement_timeout` setting.

 
You are right, I have  statement_timeout set to 5 min. 
So 1.3.3 can fail to make a chekpoint like 1.2.0?

is there an option to let barman override statement_timeout?
 
cheers, Andrea
Regards,
Marco

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

Reply all
Reply to author
Forward
0 new messages