graylog fails installation in offlline even with snap resources attached
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Graylog Charm |
Fix Released
|
High
|
Unassigned |
Bug Description
When in an offline environment, Graylog charm will fail during the installation phase during the snap installation.
Both core and graylog snaps are specified with the resource attached to the charm.
And confirmed that the snaps are indeed installed.
$ juju run --unit graylog/0 -- sudo snap list
Name Version Rev Tracking Publisher Notes
core 16-2.50.1 x6 - - core
core18 20210507 2066 latest/stable canonical* base
graylog 3.0.1 x1 - - -
lxd 4.0.6 20326 4.0/stable/… canonical* -
snapd 2.50.1 12057 latest/stable canonical* snapd
However, the charm is in error state with the following error message in the logs.
2021-07-11 12:59:07 INFO juju-log Reactive main running for hook install
2021-07-11 12:59:07 INFO juju-log Initializing Leadership Layer (is leader)
2021-07-11 12:59:08 INFO juju-log Initializing Snap Layer
2021-07-11 12:59:10 INFO juju-log Installing /var/lib/
2021-07-11 12:59:15 INFO juju-log Invoking reactive handler: reactive/
2021-07-11 12:59:18 INFO juju-log Installing /var/lib/
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: reactive/
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: reactive/
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: reactive/
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: hooks/relations
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: hooks/relations
2021-07-11 12:59:27 INFO juju-log Invoking reactive handler: reactive/
2021-07-11 12:59:27 INFO juju-log Get channel for snap graylog
2021-07-11 12:59:41 INFO juju.worker.
"", Size:0x37, FilesystemType:
3, FilesystemType:
ype:"squashfs", InUse:true, MountPoint:
s", InUse:true, MountPoint:
MountPoint:
snap/core/x6", SerialId:""}, storage.
, SerialId:""}, storage.
Label:"", UUID:"", HardwareId:"", WWN:"", BusAddress:"", Size:0x4a81, FilesystemType:"", InUse:true, MountPoint:"", SerialId:
a-part1", "/dev/disk/
UID:"", HardwareId:"", WWN:"", BusAddress:"", Size:0x1, FilesystemType:"", InUse:false, MountPoint:"", SerialId:
ev/disk/
, "/dev/disk/
61dc1b4c-
2021-07-11 13:00:07 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
if get_channel_
File "lib/charms/
cur_channel = snap.get_
File "lib/charms/
return subprocess.
IndexError: list index out of range
It fails to retrieve a "tracking" info from "snap info graylog", which is not available from snaps installed locally.
$ snap info graylog
name: graylog
summary: Graylog server snap, https:/
publisher: –
license: unset
description: |
Graylog is a full-featured log management system allowing for centralized
management, processing and alerting on logs from applications and systems.
At a miniumum update the configuration at /var/snap/
to set the admin password and mongodb connection string. Connection
information for elastic search is also needed, refer to the Graylog
documentation.
services:
graylog: simple, enabled, active
refresh-date: today at 12:59 UTC
installed: 3.0.1 (x1) 157MB -
Related branches
- Paul Goins: Approve
- 🤖 prod-jenkaas-bootstack (community): Needs Fixing (continuous-integration)
- BootStack Reviewers: Pending requested
-
Diff: 13 lines (+2/-0)1 file modifiedsrc/lib/charms/layer/graylog/snap_change.py (+2/-0)
Changed in charm-graylog: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in charm-graylog: | |
status: | Fix Committed → Fix Released |
milestone: | none → 21.10 |
I believe the issue is in ./reactive/ graylog. py with refresh_graylog() and report_status() functions, where it tries to get snap's channel information.
I think this should not be called at all when the graylog snap is installed via a local resource.
As of now I couldn't find a smart way to workaround this issue.