Failed to download pc-kernel snap

Hi there,

This morning we run into an issue while trying to download pc-kernel snap. It seems the snap file was downloaded 100% but returned an 404 error. Please let me know if any logs are required for troubleshooting. Thanks.

Fetching snapd
Fetching pc-kernel 100% 4.31MB/s 0.0ns
error: received an unexpected http response code (404) when trying to download https://api.snapcraft.io/api/v1/snaps/download/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap
COMMAND FAILED: snap prepare-image --channel=beta --snap=xxxxx=latest/beta --snap=docker=latest/stable xxxxx.assert /tmp/tmpelipao2v/unpack

there seems to currently be an issue with the store, see
https://status.snapcraft.io/

2 Likes

Hmm, still seeing the error message. Now the status is green. :slight_smile: Got some logs from curl command, sorry for the off-format:

curl https://api.snapcraft.io/api/v1/snaps/download/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap -Iv

  • Trying 91.189.92.39:443…
  • TCP_NODELAY set
  • Connected to api.snapcraft.io (91.189.92.39) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • TLSv1.2 (IN), TLS handshake, Finished (20):
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  • ALPN, server did not agree to a protocol
  • Server certificate:
  • subject: CN=api.snapcraft.io
  • start date: Feb 15 14:50:43 2021 GMT
  • expire date: May 16 14:50:43 2021 GMT
  • subjectAltName: host “api.snapcraft.io” matched cert’s “api.snapcraft.io
  • issuer: C=US; O=Let’s Encrypt; CN=R3
  • SSL certificate verify ok.

HEAD /api/v1/snaps/download/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap HTTP/1.1 Host: api.snapcraft.io User-Agent: curl/7.68.0 Accept: /

<

When I downloaded the snap file with wget command, it redirected to another location, not sure if ubuntu-image can follow the redirect:

wget https://api.snapcraft.io/api/v1/snaps/download/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap
–2021-03-16 10:02:54-- https://api.snapcraft.io/api/v1/snaps/download/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap
Resolving api.snapcraft.io (api.snapcraft.io)… 91.189.92.20, 91.189.92.41, 91.189.92.38, …
Connecting to api.snapcraft.io (api.snapcraft.io)|91.189.92.20|:443… connected.
HTTP request sent, awaiting response… 302 FOUND
Location: https://canonical-bos01.cdn.snapcraft.io/download-origin/canonical-lgw01/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap?token=1615917600_b1e022352ad81e5fbc25002079087b5f91c74e03 [following]
–2021-03-16 10:02:56-- https://canonical-bos01.cdn.snapcraft.io/download-origin/canonical-lgw01/pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap?token=1615917600_b1e022352ad81e5fbc25002079087b5f91c74e03
Resolving canonical-bos01.cdn.snapcraft.io (canonical-bos01.cdn.snapcraft.io)… 91.189.91.42, 91.189.91.43
Connecting to canonical-bos01.cdn.snapcraft.io (canonical-bos01.cdn.snapcraft.io)|91.189.91.42|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 222167040 (212M) [application/octet-stream]
Saving to: ‘pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza_726.snap’

IIRC ubuntu-image just calls snap download (or the snapd API equivalent) internally …

It seems ubuntu-image runs snap prepare-image x.assert /tmp/xxx and failed with 404. I also gave the command snap download a try and it can download the pc-kernel snap file.

@ogra, thanks for the updates. After snapcraft login, the snap pc-kernel can be built in the image, but still not sure why it required login first for the public snap pc-kernel.

export UBUNTU_STORE_AUTH_DATA_FILENAME=xxx helps. I took a look into the codes, and seems “newToolingStore” function may need more logs. Will follow up in launchpad :slight_smile: Thanks.

1 Like