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

[bug] Snap client _wait handles valid case as an error #139

Closed
Gu1nness opened this issue Dec 12, 2024 · 3 comments
Closed

[bug] Snap client _wait handles valid case as an error #139

Gu1nness opened this issue Dec 12, 2024 · 3 comments

Comments

@Gu1nness
Copy link
Contributor

Description

The SnapClient._wait method (here) considers a valid status Do as an error while it should not.

The snapd REST API specifies that the status can be Do for "Task is ready to start".
The filtering in the SnapClient._wait only considers the cases Done and Doing, Valid as valid cases and otherwise will raise a SnapError.
Similar to this line), the status Do should sleep and wait for the task to start.

I can provide a patch if you want.

@benhoyt
Copy link
Collaborator

benhoyt commented Dec 12, 2024

Makes sense to me. A patch would be great, thanks! Out of interest, how did you run across this? If it was due to an error, do you remember what command/operation you were running at the time?

@benhoyt
Copy link
Collaborator

benhoyt commented Dec 12, 2024

Ah, I see you've opened #140 -- we'll take a look, thanks.

@Gu1nness
Copy link
Contributor Author

Makes sense to me. A patch would be great, thanks! Out of interest, how did you run across this? If it was due to an error, do you remember what command/operation you were running at the time?

I'm working on the MongoDB charms and I'm refactoring everything.
As part of this refactoring, I'm using the Snap.set method to configure my snaps and I noticed that it started happening quite often (which never happened in the past), with the error message showing a status Do
A quick investigation on the REST API and the operator-libs led me to this :)

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