You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Situation is that a user has PostgreSQL on Windows with a significant amount of data on a tablespace on the F drive. Barman is running on Ubuntu Focal with /var/lib/barman/[server] mounted as a CIFS share from a Windows file server.
Barman works, and can stream wals to the backup. However creating a backup fails.
The reason is that the tablespace mapping just appends the path to the destination path, providing a path like: /var/lib/barman/pg/base/20240124T132339/data/F:\postgres\data
This cannot work because the colon (:) has special meaning on NTFS/Windows file paths as a selector for alternate data streams for a given file. If you are not familiar with this feature of NTFS, here's a quick primer including security implications: https://blog.netwrix.com/2022/12/16/alternate_data_stream/
I also assume but am not 100% sure that the changes in slashes do work on Python in this way. I am not sure about pg_basebackup though.
Proposed resolution:
If the barman_home starts with / and the tablespace directory starts with [A-Z]:\ then:
change the mapper to __windows__/[A-Z]/ and drop the colon.
Optionally we may need to also transpose \ to / in order to normalize the paths.
The text was updated successfully, but these errors were encountered:
As a note, while this issue only is unavoidable with CIFS shares, the problem will surface in other forms if NFS 4.1 is used against a Windows server as the underlying issue is found int he filesystem. Additionally workarounds for the issue in NFS 3 Server for Windows are brittle and difficult to implement perfectly. This would be very nice to fix and it might make it easier to eventually support Windows hosts for Barman
Situation is that a user has PostgreSQL on Windows with a significant amount of data on a tablespace on the F drive. Barman is running on Ubuntu Focal with /var/lib/barman/[server] mounted as a CIFS share from a Windows file server.
Barman works, and can stream wals to the backup. However creating a backup fails.
The reason is that the tablespace mapping just appends the path to the destination path, providing a path like:
/var/lib/barman/pg/base/20240124T132339/data/F:\postgres\data
This cannot work because the colon (:) has special meaning on NTFS/Windows file paths as a selector for alternate data streams for a given file. If you are not familiar with this feature of NTFS, here's a quick primer including security implications: https://blog.netwrix.com/2022/12/16/alternate_data_stream/
I also assume but am not 100% sure that the changes in slashes do work on Python in this way. I am not sure about pg_basebackup though.
Proposed resolution:
If the barman_home starts with
/
and the tablespace directory starts with[A-Z]:\
then:change the mapper to
__windows__/[A-Z]/
and drop the colon.Optionally we may need to also transpose
\
to/
in order to normalize the paths.The text was updated successfully, but these errors were encountered: