← Back to issue list

fix(store): catch credential decoding errors

View original Github issue

Metadata

Project
snapcraft
Number
#5536
Type
pull request
State
merged
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

Merged fix that catches invalid SNAPCRAFT_STORE_CREDENTIALS decoding errors, replacing internal crashes with user-friendly messages. Updated craft-store dependency to 3.2.2 and resolved issue #5161.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `make test`? --- Invalid text in `SNAPCRAFT_STORE_CREDENTIALS` could cause a `UnicodeDecodeError`, which would be raised as an internal error: ``` snapcraft internal error: UnicodeDecodeError('utf-8', b'\x9d\xfa(', 0, 1, 'invalid start byte') ``` Now, this is caught and raised as a user-friendly error. Related: https://github.com/canonical/craft-store/pull/287 Fixes #5161

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix that catches invalid SNAPCRAFT_STORE_CREDENTIALS decoding errors, replacing internal crashes with user-friendly messages. Updated craft-store dependency to 3.2.2 and resolved issue #5161.
qwen3.6-35b-a3b-mtp-q6 Merged PR resolves issue #5161 by catching UnicodeDecodeError from invalid SNAPCRAFT_STORE_CREDENTIALS and replacing it with a user-friendly message. Updates craft-store to 3.2.2 to include upstream fixes.
qwen3.6-35b-a3b-mtp-q6 Merged fix catching invalid SNAPCRAFT_STORE_CREDENTIALS decoding errors, replacing internal UnicodeDecodeError crashes with user-friendly messages. Updated craft-store to 3.2.2 for upstream fixes and resolved issue #5161.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#6098 fix: Tweak error message about SNAPCRAFT_STORE_CREDENTIALS snapcraft merged Merged to clarify the ambiguous SNAPCRAFT_STORE_CREDENTIALS error message. The update explicitly states login fails while the variable is set, resolving user confusion. Approved by four reviewers and passed CI checks prior to merge.
78%
#45 auth: raise error when credentials cannot be parsed (CRAFT-812) craft-store merged Merged changes to craft-store that replace cryptic base64 decoding errors with a clear CredentialsNotParseable exception for invalid credentials. Approved by one reviewer and passed CI.
75%
#3945 requirements: craft-store 2.3.0 for new credentials snapcraft merged Merged a dependency update bumping craft-store to 2.3.0 for new credentials support. Approved by a maintainer, passed CI and tests, and merged into main with no coverage impact.
74%
#667 craft store: update to 2.0.0 (CRAFT-773) charmcraft merged Merged craft store update to 2.0.0. Changes include updated StoreClient initialization, renaming NotLoggedIn to CredentialsUnavailable, improved keyring handling, and adjusted relogin logic. Approved by one reviewer, passed CI, and merged by maintainer sergiusens.
71%
#1388 build(deps): bump craft-store to 2.5.0 charmcraft merged Merged dependency bump to craft-store 2.5.0, resolving issue #719. Enables headless systems to fallback to a file-based keyring backend. Approved by two reviewers and passed CI.
71%
#2492 store: handle invalid snap file errors snapcraft merged Merged changes implementing error handling for corrupt or invalid snap files during package data extraction for signing or push. Approved by reviewer, passed CI checks, and successfully integrated to master, resolving SNAPCRAFT-GE.
71%
#2084 fix(store): better error message with fetch-lib charmcraft merged Merged updates that improve error messaging for fetch-lib in the store component. Approved by two reviewers, passed CI, and resolves issue #1721 and CRAFT-3352 across two files.
70%