cannot install system snap "snapd"

Bug #2069292 reported by Matthias Mailänder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

Trying to test https://github.com/snapcrafters/eclipse/pull/70 locally fails:

snapcraft
failed to inject host's snap 'snapcraft' into target environment.nstance from remote
* Command that failed: 'lxc --project snapcraft exec local:base-instance-snapcraft-buildd-base-v7-c-f91ee4af44ccdf02cefb -- env CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical snap install /tmp/snapcraft.snap --classic'
* Command exit code: 1
* Command standard error output: b'error: cannot perform the following tasks:\n- Ensure prerequisites for "snapcraft" are available (cannot install system snap "snapd": Post "https://api.snapcraft.io/v2/snaps/refresh": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers))\n'
Full execution log: '/home/matthias/.local/state/snapcraft/log/snapcraft-20240613-140205.076032.log'

I tried removing and reinstalling snapcraft, but it did not help.

I am running KUbuntu 24.04

Revision history for this message
Matthias Mailänder (mailaender) wrote :
description: updated
description: updated
Revision history for this message
Callahan Kovacs (mr-cal) wrote :

I haven't seen this timeout before. It's possible it's a transient network/server issue and may be worth retrying in a few hours.

If not, what happens if you launch a lxc container and try to install snapd yourself?

i.e.

lxc launch ubuntu:24.04 u1
lxc exec u1 bash
snap install snapd # or 'snap refresh snapd --channel=latest/beta' to force it to grab something from the snapstore

Revision history for this message
Matthias Mailänder (mailaender) wrote :

lxc launch ubuntu:24.04 ul
lxc exec ul bash
root@ul:~# snap install snapd
error: unable to contact snap store

Revision history for this message
Matthias Mailänder (mailaender) wrote :

root@ul:~# ping snapcraft.io
PING snapcraft.io (185.125.190.29) 56(84) bytes of data.
--- snapcraft.io ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3077ms

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Is there a proxy configured in your environment?

Revision history for this message
Matthias Mailänder (mailaender) wrote :

Software firewall is disabled and no proxy used. The connection problems only happen in lxc.

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

1. Are you using a VPN?
2. Can you reach other websites besides snapcraft.io from the lxc container?

Revision history for this message
Matthias Mailänder (mailaender) wrote :

Not using a VPN. The lxc container can't reach anything.

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Ah, OK. So this is a broader lxc-related network issue and not a snapcraft-specific issue.

Do you have Docker installed? This is another common reason for not having network connectivity in LXC containers:

https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker

Revision history for this message
Matthias Mailänder (mailaender) wrote :

Yes, Docker installed.

docker --version
Docker version 26.1.4, build 5650f9b

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

That is the most likely cause then. The link provided above has steps to resolve LXD network issues when Docker is installed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.