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
Backups should be able to be saved to the filesystem and saved to Git
Observed Behavior
Received an error BACKUP CONFIG failed: Subtask: SAVE BACKUP CONFIGURATION TO FILE (failed). This appeared to be due to having a leading / in my backup config path in Golden Config Settings, which I'm assuming was referencing the root of the filesystem. Since Nautobot doesn't run as root it doesn't have access to / in the filesystem.
# correct (references current working directory)
{{obj.location.name}}/{{obj.name | upper}}.cfg
# invalid (references the root of the host/container filesystem)
/{{obj.location.name}}/{{obj.name | upper}}.cfg
Steps to Reproduce
Use a leading / in the path for backup, intended, or template settings in Golden Config settings for a given device.
Run Backup/Intended job for device
Proposed solutions
Pop up a warning if a leading / is detected in the settings page or when the settings are created/updated. i.e. "You have a leading / in your configuration, is this expected?"
Have a more descriptive error thrown if the above backup error occurs (not tested but I believe this would happen with intended as well).
Strip any leading / when the settings are created/updated. This could limit some customer implementations if they are actually storing backups in a root directory that Nautobot does have access to.
The text was updated successfully, but these errors were encountered:
That's unexpected. This is due to this behavior in os.path.join:
Help on function join in module posixpath:
join(a, *p)
Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
ends with a separator.
Environment
Expected Behavior
Backups should be able to be saved to the filesystem and saved to Git
Observed Behavior
Received an error
BACKUP CONFIG failed: Subtask: SAVE BACKUP CONFIGURATION TO FILE (failed)
. This appeared to be due to having a leading/
in my backup config path in Golden Config Settings, which I'm assuming was referencing the root of the filesystem. Since Nautobot doesn't run as root it doesn't have access to/
in the filesystem.Steps to Reproduce
/
in the path for backup, intended, or template settings in Golden Config settings for a given device.Proposed solutions
/
is detected in the settings page or when the settings are created/updated. i.e. "You have a leading/
in your configuration, is this expected?"/
when the settings are created/updated. This could limit some customer implementations if they are actually storing backups in a root directory that Nautobot does have access to.The text was updated successfully, but these errors were encountered: