aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.54k stars 369 forks source link

Snapshots cannot be deleted with space in the snapshotname #1259

Open KonstantinNoulezas opened 3 months ago

KonstantinNoulezas commented 3 months ago

Snapshots cannot be deleted, when they have a space at the End of the name

Detailed Description

  1. I have a snapshot with the exact name within the brackets: [focal-multiverse-snapshot-2023-09 ] Detail:

  2. You can see a "space" charakter at the end of the Snapshotname (after the 9 - Chatakter)

  3. When I try to delete the snapshot, I get an error message, that the Snapshot-name is not available $ aptly snapshot drop -force focal-multiverse-snapshot-2023-09 ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09 not found --> I try again with single quotes: $ aptly snapshot drop -force 'focal-multiverse-snapshot-2023-09 ' ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09 not found --> I try it with double quotes: $ aptly snapshot drop -force "focal-multiverse-snapshot-2023-09 " ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09 not found --> I try it with bakslah at the end before the "space" $ aptly snapshot drop -force focal-multiverse-snapshot-2023-09\ ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09 not found --> and of course i tried it with single and doule qotas aptly snapshot drop -force 'focal-multiverse-snapshot-2023-09\ ' ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09\ not found aptly snapshot drop -force "focal-multiverse-snapshot-2023-09\ " ERROR: unable to drop: snapshot with name focal-multiverse-snapshot-2023-09\ not found

  4. I also tried to Rename the Snapshot in a name without Space at the end, same Result

Context

If we dont fix it, we will run in a more and more growing very big database --> Full disk in a frw Months ! --> We Need a fix for this. Thank you. :-) How would you use it? --> Delete a snapshot with in its Name is at the End a Space. ## Change Suggestion: 1. Offer a Workaround / Solution how to Delete this Snapshot with the Space at the End of the Snapshot Name 2. Implement a check, so that space in a given Name prohibited when created

--> They will not run into the same Problem as we actually have

Possible Implementation

Your Environment

Ubuntu 20.04 LTS, with Bash $ cat /srv/aptly/.aptly.conf { "rootDir": "/srv/aptly/.aptly", "downloadConcurrency": 4, "downloadSpeedLimit": 0, "downloadRetries": 0, "downloader": "default", "databaseOpenAttempts": -1, "architectures": ["amd64"], "dependencyFollowSuggests": false, "dependencyFollowRecommends": false, "dependencyFollowAllVariants": false, "dependencyFollowSource": false, "dependencyVerboseResolve": false, "gpgDisableSign": false, "gpgDisableVerify": true, "gpgProvider": "gpg", "downloadSourcePackages": false, "skipLegacyPool": true, "ppaDistributorID": "ubuntu", "ppaCodename": "", "skipContentsPublishing": false, "skipBz2Publishing": false, "FileSystemPublishEndpoints": {}, "S3PublishEndpoints": {}, "SwiftPublishEndpoints": {}, "AzurePublishEndpoints": {}, "AsyncAPI": false, "enableMetricsEndpoint": false }

KonstantinNoulezas commented 3 months ago

We was able to delete the Snaphot with this apecific command:

$ aptly snapshot drop 'focal-multiverse-snapshot-2023-09 '

So without the "-force" switch it is possible to delete it.

### So we solved the Issue for us.

The question is here for you (the Aptly community), if you want to analyse it or close it?

neolynx commented 2 months ago

I think aptly should remove leading / training spaces on all identifiers...