After a long break we are now back to working on this. We created a shared virtual environment (miniconda3, barman 3.0.1, boto3) under the /usr/local/share/.venv directory, which gives the flexibility of using the environment from multiple operating system accounts (barman and postgres) without disturbing the system python setup. We did install libpq5-devel and gcc at the system level, as suggested, and removed the system installation of barman. Note, when we removed barman from the system, it also removed the barman system cron configuration, but the barman operating system account and its files were not affected.
We successfully implemented hook scripts to forward Barman backups and WAL archive files to S3 storage. We created a shell script to execute the "barman cron" command (it first needs to activate the shared virtual environment).
Thus far we have not tried any retrieve operations from S3, but it is a progress. Thanks to everyone for your help getting us to this point!
Not sure if this should be for the same thread, but it is the same environment, so I will start here ...
The only unusual thing we now seeing are these messages in the database log file during WAL switches:
bash: barman: command not found
ERROR: Error executing ssh: [Errno 32] Broken pipe
Exception ignored in: <function _Stream.__del__ at 0x7f6c5105b700>
Traceback (most recent call last):
File "/usr/local/share/miniconda3/lib/python3.9/tarfile.py", line 410, in __del__
self.close()
File "/usr/local/share/miniconda3/lib/python3.9/tarfile.py", line 460, in close
self.fileobj.write(self.buf)
ValueError: write to closed file
It occurs at every log switch and does not seem related to cloud communication, as it happens even when there are no defined hook scripts.
The database archive_command parameter is: /data/tepgbarman02/barman_wal_archive.sh %p %f
The shell script runs the barman-wal-archive command, similar to this example:
barman-wal-archive
db_host1.mydomain.com tepgbarman02 $1
It throws the ignored exception and everything appears to continue normally.
We observe the WAL file in question is closed and it sits in the streaming directory until the next successful execution of "barman cron" moves it to the Barman wals directory.
We can also see a new .partial file is opened in the streaming directory as soon as there is database activity.
Does anyone know what might be causing the messages or how to troubleshoot this?
Thanks,
Steve