Install hook fails with "hook "install" (via explicit, bespoke hook script) failed: exit status 1" and zero useful output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Elasticsearch Charm |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
As seen on this test run: https:/
Crashdump here: https:/
The elasticsearch/2 unit fails on its install hook with an unhelpful error:
2021-02-18 23:19:53 WARNING juju-log Passing NO_PROXY string that includes a cidr. This may not be compatible with software you are running in your shell.
2021-02-18 23:20:12 WARNING install Traceback (most recent call last):
2021-02-18 23:20:12 WARNING install File "/var/lib/
2021-02-18 23:20:12 WARNING install hooks.execute(
2021-02-18 23:20:12 WARNING install File "/var/lib/
2021-02-18 23:20:12 WARNING install charmhelpers.
2021-02-18 23:20:12 WARNING install File "/var/lib/
2021-02-18 23:20:12 WARNING install subprocess.
2021-02-18 23:20:12 WARNING install File "/usr/lib/
2021-02-18 23:20:12 WARNING install raise CalledProcessEr
2021-02-18 23:20:12 WARNING install subprocess.
2021-02-18 23:20:12 ERROR juju.worker.
And there are no logs created for the ansible playbook to indicate what went wrong, or any ansible logs at all. In order to effectively debug issues with this charm it needs to log these to somewhere.
Changed in charm-elasticsearch: | |
status: | New → Confirmed |
Changed in charm-elasticsearch: | |
importance: | High → Medium |
I was able to reproduce this issue. This seems to be a bug in charmhelpers, which uses check_call [0], but I think should use check_output, similar to the fix for LP#1928336 [1]. I filed a bug on the upstream project [2].
After patching the call to ansible to see the error, in my case I got the following (might not have been the same issue for this bug, impossible for me to say.
2021-06-21 03:05:31 WARNING install TASK [Install dependent packages.] ******* ******* ******* ******* ******* ******* *** u'openjdk- 8-jre-headless' , u'ufw']) => {"changed": false, "item": ["openjdk- 8-jre-headless" , "u juju/agents/ unit-elasticsea rch-0/charm/ playbook. retry
2021-06-21 03:05:31 WARNING install failed: [localhost] (item=[
fw"], "msg": "Failed to update apt cache."}
2021-06-21 03:05:31 WARNING install to retry, use: --limit @/var/lib/
So a failure to update the apt cache successfully. This happens because of the use of ES 5.x
# apt-get update /artifacts. elastic. co/packages/ 5.x/apt stable InRelease /artifacts. elastic. co/packages/ 5.x/apt stable Release archive. ubuntu. com/ubuntu bionic InRelease archive. ubuntu. com/ubuntu bionic-updates InRelease security. ubuntu. com/ubuntu bionic-security InRelease [88.7 kB] archive. ubuntu. com/ubuntu bionic-backports InRelease /artifacts. elastic. co/packages/ 5.x/apt stable Release' does not have a Release file.
Ign:1 https:/
Err:2 https:/
Could not handshake: The TLS connection was non-properly terminated. [IP: 10.0.0.1 3142]
Hit:3 http://
Hit:4 http://
Get:5 http://
Hit:6 http://
Reading package lists... Done
E: The repository 'https:/
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Updating the default to a more recent version is being tracked in LP#1895484 [3]
[0] https:/ /github. com/juju/ charm-helpers/ blob/master/ charmhelpers/ contrib/ ansible/ __init_ _.py#L216 /bugs.launchpad .net/charm- juju-lint/ +bug/1928336 /github. com/juju/ charm-helpers/ issues/ 612 /bugs.launchpad .net/charm- elasticsearch/ +bug/1895484
[1] https:/
[2] https:/
[3] https:/