barman 3.18 recover --remote-ssh-command returns EXCEPTION: cannot pickle '_thread.lock' object

16 views
Skip to first unread message

Stan

unread,
May 4, 2026, 8:43:27 AM (10 days ago) May 4
to Barman, Backup and Recovery Manager for PostgreSQL
Hello,

We have upgraded our barman installation from v3.15 to v3.18 and are now no longer able to recover a backup over SSH.

Here is the full recover command and response:

% barman recover --remote-ssh-command 'ssh post...@192.163.1.36 -p 49166' pg_live 20260504T104314 /Volumes/Postgres_Data_2TB/PostgreSQL/18/data

Processing xlog segments from streaming for pg_live (batch size: 2)

000000010000091C00000001

000000010000091C00000002

Processing xlog segments from file archival for pg_live

000000010000091C00000001

000000010000091C00000002

Starting remote restore for server pg_live using backup 20260504T104314

Destination directory: /Volumes/Postgres_Data_2TB/PostgreSQL/18/data

Remote command: ssh post...@192.163.1.36 -p 49166

Copying the base backup.

EXCEPTION: cannot pickle '_thread.lock' object

See log file for more details.



On the recovery machine, the necessary folders are being created in the PGDATA directory ("base", "global", "log", etc.)  but they all remain empty. We are also able to manually create, update, and delete items over SSH in the PGDATA directory.

Any idea how to solve this problem? We are using barman 3.18.0 on macOS 15.7.5 (both the barman server and the recovery machine).

Below is the complete barman log.

Kind regards,

Stan

--------------------------------------------------
2026-05-04 14:18:00,596 [7564] barman.wal_archiver INFO: Found 3 xlog segments from streaming for pg_live. Archive a batch of 2 segments in this run.
2026-05-04 14:18:00,596 [7564] barman.wal_archiver INFO: Archiving segment 1 of 2 from streaming: pg_live/000000010000091C00000001
2026-05-04 14:18:00,632 [7564] barman.wal_archiver INFO: Archiving segment 2 of 2 from streaming: pg_live/000000010000091C00000002
2026-05-04 14:18:00,664 [7564] barman.wal_archiver INFO: Found 2 xlog segments from file archival for pg_live. Archive all segments in one run.
2026-05-04 14:18:00,664 [7564] barman.wal_archiver INFO: Archiving segment 1 of 2 from file archival: pg_live/000000010000091C00000001
2026-05-04 14:18:00,726 [7564] barman.wal_archiver INFO: Archiving segment 2 of 2 from file archival: pg_live/000000010000091C00000002
2026-05-04 14:18:01,300 [7564] barman.recovery_executor INFO: Starting remote restore for server pg_live using backup 20260504T104314
2026-05-04 14:18:01,301 [7564] barman.recovery_executor INFO: Destination directory: /Volumes/Postgres_Data_2TB/PostgreSQL/18/data
2026-05-04 14:18:01,302 [7564] barman.recovery_executor INFO: Remote command: ssh post...@192.163.1.36 -p 49166
2026-05-04 14:18:01,482 [7564] barman.recovery_executor WARNING: Unable to retrieve safe horizon time for smart rsync copy: The /Volumes/Postgres_Data_2TB/PostgreSQL/18/data/.barman-recover.info file does not exist
2026-05-04 14:18:01,484 [7564] barman.recovery_executor INFO: Copying the base backup.
2026-05-04 14:18:02,826 [7564] barman.copy_controller INFO: Copy started (safe before None)
2026-05-04 14:18:02,827 [7564] barman.copy_controller INFO: Copy step 1 of 4: [global] analyze PGDATA directory: /Volumes/BarmanData/postgres/barman/pg_live/base/20260504T104314/data/
2026-05-04 14:18:04,680 [7564] barman.copy_controller INFO: Copy step 2 of 4: [global] create destination directories and delete unknown files for PGDATA directory: /Volumes/BarmanData/postgres/barman/pg_live/base/20260504T104314/data/
2026-05-04 14:18:05,058 [7564] barman.copy_controller INFO: Copy failed (safe before None)
2026-05-04 14:18:05,060 [7564] barman.cli ERROR: cannot pickle '_thread.lock' object
See log file for more details.
Traceback (most recent call last):
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/cli.py", line 2900, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/cli.py", line 1428, in restore
    server.recover(
    ~~~~~~~~~~~~~~^
        backup_info,
        ^^^^^^^^^^^^
    ...<16 lines>...
        **snapshot_kwargs,
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/server.py", line 2511, in recover
    return self.backup_manager.recover(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        backup_info, dest, wal_dest, tablespaces, remote_command, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/backup.py", line 1228, in recover
    recovery_info = executor.recover(
        backup_info,
    ...<4 lines>...
        **kwargs
    )
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 217, in recover
    self._backup_copy(
    ~~~~~~~~~~~~~~~~~^
        backup_info,
        ^^^^^^^^^^^^
    ...<4 lines>...
        recovery_info=recovery_info,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 3406, in _backup_copy
    backup_info = operation.execute(
        backup_info=backup_info,
    ...<5 lines>...
        is_last_operation=is_last_operation,
    )
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 1892, in execute
    return self._execute(
           ~~~~~~~~~~~~~^
        backup_info,
        ^^^^^^^^^^^^
    ...<5 lines>...
        is_last_operation,
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 2340, in _execute
    return self._execute_on_chain(
           ~~~~~~~~~~~~~~~~~~~~~~^
        backup_info,
        ^^^^^^^^^^^^
    ...<5 lines>...
        is_last_operation,
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 1995, in _execute_on_chain
    volatile_backup = method(backup, destination, *args, **kwargs)
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 2408, in _rsync_backup_copy
    self._copy_pgdata_and_tablespaces(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        backup_info, controller, dest_prefix, destination, tablespaces
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/recovery_executor.py", line 2540, in _copy_pgdata_and_tablespaces
    controller.copy()
    ~~~~~~~~~~~~~~~^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/barman/copy_controller.py", line 567, in copy
    pool = Pool(
        processes=self.workers,
        initializer=_init_worker,
        initargs=(self._execute_job,),
    )
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/context.py", line 119, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild,
                context=self.get_context())
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/pool.py", line 215, in __init__
    self._repopulate_pool()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/pool.py", line 306, in _repopulate_pool
    return self._repopulate_pool_static(self._ctx, self.Process,
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                                        self._processes,
                                        ^^^^^^^^^^^^^^^^
    ...<3 lines>...
                                        self._maxtasksperchild,
                                        ^^^^^^^^^^^^^^^^^^^^^^^
                                        self._wrap_exception)
                                        ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/pool.py", line 329, in _repopulate_pool_static
    w.start()
    ~~~~~~~^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
                  ~~~~~~~~~~~^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/context.py", line 294, in _Popen
    return Popen(process_obj)
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_fork.py", line 20, in __init__
    self._launch(process_obj)
    ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/macports-bin-pkg-version/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^

Reply all
Reply to author
Forward
0 new messages