snapcraft export-login ignores expires parameter
Metadata
Current evaluation
Closed as stale without a Snapcraft fix. Maintainers attributed the short-lived macaroon to store-side refresh handling and later asked reporters to open a new ticket if the problem persisted.
Resolution: closed stale
Reason: Maintainer @mr-cal closed the issue on 2025-04-24 as stale and requested a new ticket if the issue remained. No resolving Snapcraft PR or commit was identified; the earlier response linked store-side handling in craft-store around commit 1284573774631498b32f2c1e833b6dd128afae45.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
If you run `snapcraft export-login` to produce a macaroon, the resulting token will expire in a few days regardless of the `expires` parameter.
### To Reproduce
run `snapcraft export-login --snaps $SNAPS --acls $ACLS --expires $DATE my.macaroon`
after ~2 days, use `pymacaroons` to deserialize this macarron and use the resulting credentials to access https://dashboard.snapcraft.io/dev/api/snap-track-update/
We get a `macaroon-needs-refresh` error code
### Environment
Ubuntu Lunar
snapcraft 7.4.3
### snapcraft.yaml
```shell
not used
```
### Relevant log output
```shell
none
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed stale | Closed as stale without a Snapcraft fix. Maintainers attributed the short-lived macaroon to store-side refresh handling and later asked reporters to open a new ticket if the problem persisted. | |
| stealth/space-bunny-alpha | — | closed stale | Closed as stale with no Snapcraft fix. A maintainer linked the short-lived macaroon behavior to store-side refresh handling and asked for a new ticket if it persisted. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. Maintainers clarified the short expiration is expected due to store-side macaroon refresh logic, not a snapcraft bug. No code changes were made. | |
| qwen/qwen3.6-35b-a3b | — | — | Rejected as a question; maintainer clarified the expiration is expected store-side behavior for manually used macaroons. Closed as stale without code changes. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. Maintainer clarified the expiration limit is expected store-side behavior for manually used macaroons, with refresh logic handled in craft-store. No fix applied. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as stale. Maintainers clarified the short expiration is expected due to store-side macaroon refresh logic, not a bug. No code changes were made. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1990888 Snapcraft login fails in text mode without Desktop | snapcraft (launchpad) | closed | Closed as stale after 60 days without activity; no code fix was made. Maintainers directed headless users to export-login or a configured keyring and the authentication documentation. | |
| #1843404 snapcraft export-login doesn't provide meaningful error messages when an argument is wrong | snapcraft (launchpad) | open | export-login masks Store 4xx/5xx details behind “Failed to get macaroon”; maintainer analysis confirms useful API errors are available, but no fix is evidenced. | |
| #1856502 Obscure error message from snapcraft release when not logged in correctly | snapcraft (launchpad) | open | Snapcraft exposed a raw 401 macaroon error from release; commit 8a854a8de (#3907) now gives invalid legacy credentials an actionable login or export-login resolution. | |
| #1930592 Handle macaroon-authorization-required error response | snapcraft (launchpad) | open | Snapcraft whoami bypasses the 401 re-login wrapper and shows a generic store error for missing or expired credentials; the open report remains valid and is linked to an unresolved craft-store bug. | |
| #1791879 snapcraft reports invalid credentials after successful login (new account) | snapcraft (launchpad) | closed | Closed as not a bug: the 2018-09-11 comment identified using `snap login` instead of `snapcraft login` as the cause, and the reporter marked the issue invalid. | |
| #1621171 snapcraft doesn't refresh the macaroon | snapcraft (launchpad) | closed | Merged snapcore/snapcraft PR #805 as commit 60b7ef044, adding discharge-macaroon refresh so expired credentials are renewed and authorization errors are reduced. | |
| #428 Login with macaroons | snapcraft | closed | Unmerged. Author closed #428 in favour of consolidating the macaroon migration into snapcraft#472, which itself was closed unmerged in June 2016; macaroon login/upload/download finally shipped via merged PR #532 (f1a678a07) in snapcraft 2.10. |