GCS Backup times out at 120s
We have kubernetes clusters at remote locations that are connected to the cloud via slow connections. The database size is also small (approx 40MB compressed). However the upload to GCS buckets is timing out. Despite setting the --read-timeout to 600, it times out after 120s.
The command used is as follows
barman-cloud-backup --user postgres --name <name>--gzip --read-timeout 600 --cloud-provider google-cloud-storage gs://<gcs bucket/folder> <cluster name>
The error is as follows ERROR: <class 'google.api_core.exceptions.RetryError'> ERROR: Timeout of 120.0s exceeded, last exception: ('Connection aborted.', timeout('The write operation timed out')) ERROR: Upload error: Timeout of 120.0s exceeded, last exception: ('Connection aborted.', timeout('The write operation timed out')) (worker 0)
It looks like the timeout is hard coded and cannot be changed. I have also tried setting the read-timeout to 0 without any success.
Hi I have the same issue. Backup target is google cloud and only one file is created there with this content below.
backup.info created 07:33:10+00:00
backup_label=None
backup_name=backup-20260328072916
begin_offset=16489792
begin_time=2026-03-28 07:29:19.208660+00:00
begin_wal=000000140000132300000001
begin_xlog=1323/1FB9D40
children_backup_ids=None
cluster_size=878507851574
compression=None
config_file=/var/lib/postgresql/data/pgdata/postgresql.conf
copy_stats=None
data_checksums=off
deduplicated_size=None
encryption=None
end_offset=None
end_time=None
end_wal=None
end_xlog=None
error=failure uploading data (Timeout of 120.0s exceeded, last exception: ('Connection aborted.', TimeoutError('The write operation timed out')))
hba_file=/var/lib/postgresql/data/pgdata/pg_hba.conf
ident_file=/var/lib/postgresql/data/pgdata/pg_ident.conf
included_files=['/var/lib/postgresql/data/pgdata/custom.conf', '/var/lib/postgresql/data/pgdata/override.conf']
mode=None
parent_backup_id=None
pgdata=/var/lib/postgresql/data/pgdata
server_name=cloud
size=None
status=FAILED
summarize_wal=off
systemid=7504997402752360478
tablespaces=None
timeline=20
version=170007
xlog_segment_size=16777216
and this is log from plugin-barman-cloud
2026-03-28T07:29:16.187823282Z Starting backup
2026-03-28T07:29:16.193852282Z Starting barman-cloud-backup
2026-03-28T07:30:18.07806374Z /usr/local/lib/python3.13/site-packages/barman/cloud.py:224: FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in staticmethod() if you want to preserve the old behavior
2026-03-28T07:30:18.078073922Z self.buffer = self._buffer()
2026-03-28T07:31:48.979570295Z Skipping retention policy enforcement, not the current primary
2026-03-28T07:33:09.529742916Z 2026-03-28 07:33:09,529 [182627] ERROR: <class 'google.api_core.exceptions.RetryError'>
2026-03-28T07:33:09.529790319Z 2026-03-28 07:33:09,529 [182627] ERROR: Timeout of 120.0s exceeded, last exception: ('Connection aborted.', TimeoutError('The write operation timed out'))
2026-03-28T07:33:09.529820553Z 2026-03-28 07:33:09,529 [182627] ERROR: Upload error: Timeout of 120.0s exceeded, last exception: ('Connection aborted.', TimeoutError('The write operation timed out')) (worker 0)
2026-03-28T07:33:09.530621473Z 2026-03-28 07:33:09,530 [182612] ERROR: Error received from upload worker: Timeout of 120.0s exceeded, last exception: ('Connection aborted.', TimeoutError('The write operation timed out'))
2026-03-28T07:33:09.530670904Z Process Process-2:
2026-03-28T07:33:09.531291979Z Traceback (most recent call last):
2026-03-28T07:33:09.531871195Z File \
2026-03-28T07:33:09.531874049Z self.run()
2026-03-28T07:33:09.531875713Z ~~~~~~~~^^
2026-03-28T07:33:09.531877754Z File \
2026-03-28T07:33:09.531883897Z self._target(*self._args, **self._kwargs)
2026-03-28T07:33:09.53188542Z ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-03-28T07:33:09.53188708Z File \
2026-03-28T07:33:09.531888828Z task = self.queue.get()
2026-03-28T07:33:09.531890439Z File \
2026-03-28T07:33:09.531892527Z File \
2026-03-28T07:33:09.531894163Z kind, result = conn.recv()
2026-03-28T07:33:09.531895515Z ~~~~~~~~~^^
2026-03-28T07:33:09.531897414Z File \
2026-03-28T07:33:09.531898997Z buf = self._recv_bytes()
2026-03-28T07:33:09.531900373Z File \
2026-03-28T07:33:09.531902015Z buf = self._recv(4)
2026-03-28T07:33:09.531904273Z File \
2026-03-28T07:33:09.531906475Z chunk = read(handle, remaining)
2026-03-28T07:33:09.531909119Z KeyboardInterrupt
2026-03-28T07:33:09.540241709Z 2026-03-28 07:33:09,540 [182612] ERROR: Backup failed uploading data (Timeout of 120.0s exceeded, last exception: ('Connection aborted.', TimeoutError('The write operation timed out')))
2026-03-28T07:33:12.223587761Z while taking backup
2026-03-28T07:33:12.230403427Z Error while handling GRPC request