← Back to issue list

snapcraft should check permissions before starting an upload

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1627843
Type
issue
State
closed
Author
~thomir-deactivatedaccount
Labels
—
Created
Updated
Closed

Current evaluation

Authentication refreshing was fixed in Snapcraft 2.18 via LP #1621171; a maintainer later confirmed the upload-permission problem was already resolved.

Resolution: closed resolved

Reason: Maintainer Sergio Schvezov identified LP #1621171 as the macaroon-refresh fix included in 2.18 and stated on 2019-10-01 that the problem had long been fixed. Version 2.18.1 was subsequently rolled out to Xenial.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Hi, I'm running: snapcraft push <snap_file> --release <channel> and sometimes it seems my authentication session has expired. Snapcraft uploads the entire snap file and then tells me: ``` Received 401: '{"error_list": [{"message": "Authorization Required", "code": "macaroon-permission-required"}]}' ``` Running 'snapcraft login' and then re-running the above command fixes the issue. The problem is that my upload speed is limited, and the snap is rather large. Ideally snapcraft would check that it has permissions to complete the operation before uploading everything. If there's a race condition (i.e.- auth credentials expire while the upload is happening) that's regrettable, but would be far better than what it's doing now. I'm running the latest snapcraft that's available on Xenial (which is where these snaps are built): 2.17

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Authentication refreshing was fixed in Snapcraft 2.18 via LP #1621171; a maintainer later confirmed the upload-permission problem was already resolved.
stealth/space-bunny-alpha — closed resolved Authentication refresh was added in Snapcraft 2.18.1 by PR #805 (commit 60b7ef044); the issue was later closed as fixed.
stealth/space-bunny-alpha — closed stale snapcraft#1627843 was closed as stale after prolonged inactivity, with no fix or pre-upload permission check implemented.
qwen/qwen3.6-35b-a3b — — Closed without resolution due to prolonged inactivity. The request to validate authentication permissions before uploading large snaps was abandoned, with no fix or implementation added to subsequent versions.
qwen/qwen3.6-35b-a3b — — Closed without resolution, likely abandoned. The feature request to verify authentication permissions before uploading large snap files was not implemented.
qwen/qwen3.6-35b-a3b — — The request for pre-upload permission checks in snapcraft was closed without resolution. With zero comments and over a decade of inactivity, the feature was abandoned and never implemented.
qwen3.6-35b-a3b-mtp-q6 — — Requesting pre-upload permission checks to prevent wasted bandwidth on expired auth sessions was closed without resolution. No code changes or pull requests were merged.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft (launchpad)#1621171 (confidence 98%)

    Added macaroon refreshing in Snapcraft 2.18 to prevent avoidable authentication failures during uploads.

  • Related To: snapcraft (launchpad)#1610776 (confidence 90%)

    Tracked the desired Store API preflight query that would validate push permission before uploading.

Related issues

Issue Project State Summary Similarity
#1871109 snapcraft should check file creation permissions and warn/error out instead of generating a non-functional snap snapcraft (launchpad) closed Snapcraft now validates the snap skeleton and fails before producing an unusable artifact; merged in canonical/snapcraft#3743 (7c927032d).
73%
#1572963 snapcraft upload can fail while monitoring scan status snapcraft (launchpad) closed Fixed by ubuntu-core/snapcraft PR #480 (commit 2cae24aa5), which made upload polling ignore spurious scan-status errors; verified in Snapcraft 2.8.8b.
71%