apport information

** Tags added: apport-collected bionic uec-images

** Description changed:

  Simpler reproducer:
  
  $ snap version
  snap    2.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=<set>
+  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.
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
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to