installation fails on because of invalid pgp key

Bug #2004303 reported by Guillaume Boutry
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
InfluxDB Charm
Fix Released
Undecided
Unassigned

Bug Description

Installing influxdb using: `juju deploy influxdb` fails on apt hook. Influxdata repository cannot be verified because of bad gpg key.

Logs:
```
unit-influxdb-6: 15:17:17 ERROR unit.influxdb/6.juju-log Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-influxdb-6/charm/reactive/apt.py", line 41, in update
    charms.apt.update()
  File "/var/lib/juju/agents/unit-influxdb-6/charm/lib/charms/apt.py", line 105, in update
    fetch.apt_update(fatal=True) # Friends don't let friends set fatal=False
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charmhelpers/fetch/ubuntu.py", line 401, in apt_update
    _run_apt_command(cmd, fatal)
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charmhelpers/fetch/ubuntu.py", line 952, in _run_apt_command
    _run_with_retries(
  File "/var/lib/juju/agents/unit-influxdb-6/.venv/lib/python3.8/site-packages/charmhelpers/fetch/ubuntu.py", line 929, in _run_with_retries
    result = subprocess.check_call(cmd, env=env, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['apt-get', 'update']' returned non-zero exit status 100.
unit-influxdb-6: 15:17:17 ERROR juju.worker.uniter.operation hook "install" (via explicit, bespoke hook script) failed: exit status 1
unit-influxdb-6: 15:17:17 INFO juju.worker.uniter awaiting error resolution for "install" hook
unit-influxdb-6: 15:17:27 INFO juju.worker.uniter awaiting error resolution for "install" hook
unit-influxdb-6: 15:17:27 INFO unit.influxdb/6.juju-log Reactive main running for hook install
unit-influxdb-6: 15:17:28 INFO unit.influxdb/6.juju-log Initializing Apt Layer
unit-influxdb-6: 15:17:35 WARNING unit.influxdb/6.install W: GPG error: https://repos.influxdata.com/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
unit-influxdb-6: 15:17:35 WARNING unit.influxdb/6.install E: The repository 'https://repos.influxdata.com/ubuntu xenial InRelease' is not signed.
unit-influxdb-6: 15:17:35 INFO unit.influxdb/6.juju-log Failed executing 'add-apt-repository --yes deb https://repos.influxdata.com/ubuntu xenial stable'. Will retry in 10 seconds
unit-influxdb-6: 15:17:45 INFO unit.influxdb/6.juju-log Invoking reactive handler: reactive/apt.py:39:update
unit-influxdb-6: 15:17:45 INFO unit.influxdb/6.juju-log status-set: maintenance: Updating apt cache
unit-kapacitor-2: 15:17:48 INFO unit.kapacitor/2.juju-log Reactive main running for hook update-status
unit-kapacitor-2: 15:17:48 INFO juju.worker.uniter.operation ran "update-status" hook (via explicit, bespoke hook script)
unit-influxdb-6: 15:17:49 WARNING unit.influxdb/6.install W: GPG error: https://repos.influxdata.com/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
unit-influxdb-6: 15:17:49 WARNING unit.influxdb/6.install E: The repository 'https://repos.influxdata.com/ubuntu xenial InRelease' is not signed.
....

```

Influxdata is referencing an other gpg key for installing legacy influxdb: https://docs.influxdata.com/influxdb/v1.8/introduction/install/

Current workaround:
```
INFLUXDB_PGP=$(curl -s https://repos.influxdata.com/influxdata-archive_compat.key)
juju deploy influxdb --config install_keys="$INFLUXDB_PGP"
```

Following their documentation, the fix could:
- using the Archive Compat gpg key as default `install_keys` value
- using `deb https://repos.influxdata.com/ubuntu stable main` as default `install_sources` value

Revision history for this message
Tom Haddon (mthaddon) wrote :

This has been fixed in revision 27 (in the stable channel).

Changed in influxdb-charm:
status: New → Fix Released
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.