Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots cannot be deleted with space in the snapshotname #1259

Open
KonstantinNoulezas opened this issue Mar 19, 2024 · 2 comments
Open

Snapshots cannot be deleted with space in the snapshotname #1259

KonstantinNoulezas opened this issue Mar 19, 2024 · 2 comments
Assignees

Comments

@KonstantinNoulezas
Copy link

KonstantinNoulezas commented Mar 19, 2024

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
Copy link
Author

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
Copy link
Member

neolynx commented Apr 17, 2024

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

@neolynx neolynx self-assigned this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants