[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) or "snapd" snap
Now that "snapd" snap is seeded into the base image of focal along with core18 for "lxd" snap . That actually solves the original issue in a different way. We no longer have to upload "snapd" snap using a charm resource. Bionic is still affected, but I don't think it's common for new deployments these days so I'm closing the charm task as Invalid until somebody really needs the work for bionic. [/var/lib/snapd/seed/seed.yaml on focal] snaps: - name: core18 channel: stable file: core18_1997.snap - name: snapd channel: stable file: snapd_11402.snap - name: lxd channel: 4.0/stable/ubuntu-20.04 file: lxd_19647.snap ** Changed in: charm-etcd Status: Triaged => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) or "snapd" snap To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) or "snapd" snap
** Summary changed: - snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) + snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) or "snapd" snap -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) or "snapd" snap To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16)
I'm marking the snapd task as invalid as it seems to be a problem with the set of snaps available in offline mode. ** Changed in: snapd Status: New => Invalid ** Changed in: snapd (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16)
I'm not sure there was a fix or anything, the original message was: > $ sudo snap install ./etcd_230.snap > error: cannot perform the following tasks: > - Ensure prerequisites for "etcd" are available (cannot install system snap > "snapd": Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp > 91.189.92.20:443: connect: connection refused) Which is a bit unclear, but states that it cannot install system snap "snapd". Adding that to the bunch should satisfy the dependencies and allow etcd to be installed. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16)
> On top of the already existing snaps, can you also download the snapd snap > and ack its assertion? > > So the command sequence looks like this: > > snap download snapd > snap download core18 > snap download etcd > > # on the host > snap ack ./snapd_*.assert > snap ack ./core18_*.assert > snap ack ./etcd_*.assert > sudo snap install ./snapd_*.snap > sudo snap install ./core18_*.snap > sudo snap install ./etcd_*.snap > > This works in a 18.04 VM for me. Interesting, it works for me too. Does that suggest that there is a "fix" for the original issue somewhere between snapd 2.45.1+18.04.2 (packaged) and 2.45.3.1 (snap)? $ snap version snap2.45.3.1 snapd 2.45.3.1 series 16 ubuntu 18.04 kernel 4.15.0-112-generic $ snap list NameVersion Rev Tracking Publisher Notes core18 20200724 1885 - canonical✓ base etcd3.4.5 230 - canonical✓ - snapd 2.45.3.1 8790 - canonical✓ snapd -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16)
On top of the already existing snaps, can you also download the snapd snap and ack its assertion? So the command sequence looks like this: snap download snapd snap download core18 snap download etcd # on the host snap ack ./snapd_*.assert snap ack ./core18_*.assert snap ack ./etcd_*.assert sudo snap install ./snapd_*.snap sudo snap install ./core18_*.snap sudo snap install ./etcd_*.snap This works in a 18.04 VM for me. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16)
** Summary changed: - snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments + snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments as snapd always requires core(16) To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
Hi, > In this environment, can you show all of the places that snapd could be > re-execing to? The assumption here is that the unit is deployed by Juju and based on a cloud image instead of a standard desktop or server image. Thus, there is no core snap available out of the box. > What is the output of > > ``` > snap list core $ snap list core error: no matching snaps installed > snap list snapd $ snap list snapd error: no matching snaps installed > apt show snapd > apt show snapd 2>/dev/null | grep Version: I'm giving the output of policy instead of show. $ apt policy snapd snapd: Installed: 2.45.1+18.04.2 Candidate: 2.45.1+18.04.2 Version table: *** 2.45.1+18.04.2 500 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages 100 /var/lib/dpkg/status 2.32.5+18.04 500 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages > snap version $ snap version snap2.45.1+18.04.2 snapd 2.45.1+18.04.2 series 16 ubuntu 18.04 kernel 4.15.0-112-generic > ``` > > and also > > ``` > snap list > ``` $ snap list No snaps are installed yet. Try 'snap install hello-world'. ** Changed in: snapd Status: Incomplete => New ** Changed in: snapd (Ubuntu) Status: Incomplete => New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
apport information ** Tags added: apport-collected bionic uec-images ** Description changed: Simpler reproducer: $ snap version snap2.42.1+18.04 snapd 2.42.1+18.04 series 16 ubuntu 18.04 kernel 4.15.0-91-generic $ snap info --verbose etcd | grep base: base:core18 $ snap download core18 Fetching snap "core18" Fetching assertions for "core18" Install the snap with: snap ack core18_1885.assert snap install core18_1885.snap $ snap download --channel 3.3/stable etcd Fetching snap "etcd" Fetching assertions for "etcd" Install the snap with: snap ack etcd_229.assert snap install etcd_229.snap $ sudo iptables -A OUTPUT -p tcp --destination-port 80 -j REJECT --reject-with tcp-reset $ sudo iptables -A OUTPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset $ sudo snap install --dangerous ./core18_1885.snap core18 20200724 installed $ sudo snap install --dangerous ./etcd_229.snap error: cannot perform the following tasks: - Ensure prerequisites for "etcd" are available (Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp 91.189.92.41:443: connect: connection refused) === How to reproduce: 1. set apt-http-proxy for deb package downloads $ juju model-config apt-http-proxy http://squid-deb-proxy.lxd:8000/ 2. block outgoing connections to port 80 and 443 to simulate the air- gapped env $ cat ./userdata.yaml cloudinit-userdata: | preruncmd: - iptables -A OUTPUT -p tcp --destination-port 80 -j REJECT --reject-with tcp-reset - iptables -A OUTPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset $ juju model-config ./userdata.yaml 3. deploy the charm with the pre-downloaded charm and pre-downloaded resources (note: core.snap is core18.snap required by the etcd 3.3/stable snap). juju deploy -n 1 --resource core=./resources/etcd/core.snap --resource etcd=./resources/etcd/etcd.snap --resource snapshot=./resources/etcd/snapshot.gz ./charms/etcd Then, the charm will fail with the following: 2020-08-12 01:50:29 ERROR juju-log Hook error: Traceback (most recent call last): File "/var/lib/juju/agents/unit-etcd-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main bus.dispatch(restricted=restricted_mode) File "/var/lib/juju/agents/unit-etcd-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch _invoke(other_handlers) File "/var/lib/juju/agents/unit-etcd-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke handler.invoke() File "/var/lib/juju/agents/unit-etcd-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke self._action(*args) File "/var/lib/juju/agents/unit-etcd-0/charm/reactive/etcd.py", line 313, in snap_install snap.install('etcd', channel=channel, classic=False) File "lib/charms/layer/snap.py", line 66, in install _install_local(res_path, **kw) File "lib/charms/layer/snap.py", line 328, in _install_local subprocess.check_call(cmd) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['snap', 'install', '--channel=3.3/stable', '--dangerous', '/var/lib/juju/agents/unit-etcd-0/resources/etcd/etcd.snap']' returned non-zero exit status 1. 2020-08-12 01:50:29 ERROR juju.worker.uniter.operation runhook.go:136 hook "install" (via explicit, bespoke hook script) failed: exit status 1 by running the command by hand, I get the following: ubuntu@juju-cb1bd7-1:~$ sudo snap install --channel=3.3/stable --dangerous /var/lib/juju/agents/unit-etcd-0/resources/etcd/etcd.snap error: cannot perform the following tasks: - Ensure prerequisites for "etcd" are available (cannot install system snap "snapd": Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp 91.189.92.41:443: connect: connection refused) + --- + ProblemType: Bug + ApportVersion: 2.20.9-0ubuntu7.16 + Architecture: amd64 + DistroRelease: Ubuntu 18.04 + Package: snapd 2.45.1+18.04.2 + PackageArchitecture: amd64 + ProcEnviron: + TERM=screen-256color + PATH=(custom, no user) + XDG_RUNTIME_DIR= + LANG=C.UTF-8 + SHELL=/bin/bash + ProcVersionSignature: User Name 4.15.0-112.113-generic 4.15.18 + Tags: bionic uec-images + Uname: Linux 4.15.0-112-generic x86_64 + UpgradeStatus: No upgrade log present (probably fresh install) + UserGroups: adm audio cdrom dialout dip floppy lxd netdev plugdev sudo video + _MarkForUpload: True + modified.conffile..etc.sudoers.d.99-snapd.conf: [deleted] ** Attachment added: "Dependencies.txt" https://bugs.launchpad.net/bugs/1891259/+attachment/5402959/+files/Dependencies.txt -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu.
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
In this environment, can you show all of the places that snapd could be re-execing to? What is the output of ``` snap list core snap list snapd apt show snapd apt show snapd 2>/dev/null | grep Version: snap version ``` and also ``` snap list ``` ** Changed in: snapd Status: New => Incomplete ** Changed in: snapd (Ubuntu) Status: New => Incomplete -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
snap ack vs --dangerous doesn't make a difference in this case I believe. $ snap download etcd $ snap download core18 $ sudo iptables -A OUTPUT -p tcp --destination-port 80 -j REJECT --reject-with tcp-reset $ sudo iptables -A OUTPUT -p tcp --destination-port 443 -j REJECT --reject-with tcp-reset $ sudo snap ack core18_1885.assert $ sudo snap ack etcd_230.assert $ sudo snap install ./core18_1885.snap $ sudo snap install ./etcd_230.snap error: cannot perform the following tasks: - Ensure prerequisites for "etcd" are available (cannot install system snap "snapd": Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp 91.189.92.20:443: connect: connection refused) ** Changed in: snapd Status: Incomplete => New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
Dear reporter, please check if: snap download etcd snap download core18 snap ack *.assert snap install ./core18_*.snap snap install ./etcd_*.snap fixes the problem for you. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
I think that you will find that using `snap ack...` is the right thing to do. I didn't test this manually but the use of `--dangerous` creates quite a different environment than without it. ** Changed in: snapd Status: New => Incomplete -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
** Changed in: charm-etcd Importance: Undecided => Medium ** Changed in: charm-etcd Status: New => Triaged -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
Unsubscribing ~field-high for the time being. I've been told that Air-gapped mode of Snap Store Proxy which is in a closed internal beta currently might be a better solution in the long term so I will try it out. https://docs.ubuntu.com/snap-store-proxy/en/airgap -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
In terms of the etcd snap, the bump of the base image happened around April according to the git history: https://github.com/juju-solutions/etcd-snaps/commit/3fa8df6aaacb32add9fb40ac297894765f6b0746#diff-5fde7a6d86053f0e1d88c0a2a238941f It's not a regression strictly speaking, but the bump seems to have revealed this "regression". -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1891259] Re: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments
Subscribing ~field-high. This is breaking a document behavior around the local resource upload through the charm and it affects both OpenStack and Kubernetes deployments with the air-gapped requirement because of Vault's dependency. A quick and dirty workaround is to copy the core snap into the units in error out side of the charm, install it by hand, and re-run the failed hook. ** Summary changed: - snap installation fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments + snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1891259 Title: snap installation with core18 fails at 'Ensure prerequisites for "etcd" are available' in air-gapped environments To manage notifications about this bug go to: https://bugs.launchpad.net/charm-etcd/+bug/1891259/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs