← Back to issue list

fix: error when export-login target file already exists

View original Github issue

Metadata

Project
snapcraft
Number
#6302
Type
pull request
State
merged
Author
mbeijen
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #6302 (commit df5e9d668) fixing #6301: export-login now raises an explicit SnapcraftError when the target credentials file exists, instead of crashing with an internal error. Shipped in Snapcraft 9.1.1.

Resolution: closed resolved

Reason: PR #6302 by mbeijen was approved and merged as commit df5e9d668 ('fix: error when export-login target file already exists (#6302)'). snapcraft/commands/account.py now checks os.path.lexists() before login and raises 'Could not export login credentials because ... already exists', documented in docs/release-notes/snapcraft-9-1.rst under 9.1.1 fixes.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Closes #6301 Makes sure there is no 'internal error' when generating credentials twice to the same file. (update: by exiting with an explicit error) --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #6302 (commit df5e9d668) fixing #6301: export-login now raises an explicit SnapcraftError when the target credentials file exists, instead of crashing with an internal error. Shipped in Snapcraft 9.1.1.
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#6302, closing #6301: export-login now reports an explicit error when the target credentials file exists instead of crashing.
qwen/qwen3.6-35b-a3b — — Merged fix for #6301 that prevents an internal error when snapcraft export-login targets an existing file. The command now exits with an explicit error instead of overwriting or crashing, updated per reviewer feedback.
qwen/qwen3.6-35b-a3b
Staleness: 40
Complexity: 15
Confidence: 80
needs review Fixes an internal error when running export-login twice to the same file. Currently under review with one approval and three unresolved comments. CI passes on most platforms but fails on Ubuntu 22.04/26.04 integration tests and security scans.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 20
Confidence: 75
needs review Fixes an internal error when running export-login twice to the same file. Passes lint and tests, but has no maintainer feedback after 17 days.

Update history

Date Change
updated
updated
updated
updated
updated
updated
updated
updated
updated

Related work

  • Duplicate Of: canonical/snapcraft#6301 (confidence 100%)

    PR body declares 'Closes #6301'; release notes list #6301 under 9.1.1 fixes

Related issues

Issue Project State Summary Similarity
#6301 Using export-login on a credentials file that already exist fails with 'internal error' snapcraft closed export-login crashed with PermissionError when the target credentials file already existed. Fixed by merged PR #6302 (commit df5e9d668); the command now raises a clear SnapcraftError. Shipped in Snapcraft 9.1.1.
88%