Juju 1.24-beta6.1 unit commands in debug-hooks hang indefinitely
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | juju-core |
High
|
Jesse Meek | ||
| | 1.24 |
High
|
Jesse Meek | ||
Bug Description
Symptom: Attach to any unit via juju debug-hooks, when in a hook context none of the unit agent commands work, such as:
- config-get
- unit-get
- juju-log
These commands appear to just hang, as if they are attempting to speak to the socket but are unable to authenticate(?)
as an illustration:
$ time config-get
^C
real 0m13.632s
user 0m0.025s
sys 0m0.055s
I'm going to dump a rather large subset of environmental information in hopes that I capture what would be causing the error. There is no indicator in the logs that something has gone awry - if i were to detach from the debug-hooks session and re-execute the failing hook it completes as intended. This only appears to effect active debug sessions, on any substrate, in 1.24-beta6.1
dump of env:
JUJU_API_
JUJU_UNIT_
TERM=screen
SHELL=/bin/bash
CHARM_DIR=
JUJU_REMOTE_
JUJU_METER_INFO=
JUJU_RELATION=
JUJU_CHARM_
USER=root
JUJU_ENV_
SUDO_USER=ubuntu
SUDO_UID=1000
JUJU_ENV_
USERNAME=root
TMUX=/tmp/
BYOBU_BACKEND=tmux
PATH=/var/
MAIL=/var/mail/root
JUJU_MACHINE_ID=3
PWD=/var/
LANG=en_US.UTF-8
TMUX_PANE=%2
JUJU_CONTEXT_
PS1=${debian_
SUDO_COMMAND=
SHLVL=1
HOME=/home/ubuntu
JUJU_AVAILABILI
LOGNAME=root
APT_LISTCHANGES
DEBIAN_
JUJU_METER_
JUJU_HOOK_
JUJU_RELATION_
SUDO_GID=1000
JUJU_AGENT_
JUJU_DEBUG=
_=/usr/bin/env
Networking output - full environment connectivity is working. eg: i'm able to ping the state server.
docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 22:00:0a:b9:86:fe
inet addr:10.185.134.254 Bcast:10.
inet6 addr: fe80::2000:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86160 errors:0 dropped:0 overruns:0 frame:0
TX packets:18324 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:119611778 (119.6 MB) TX bytes:2025178 (2.0 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Let me know if there is any additional information i can provide about this.
| Changed in juju-core: | |
| status: | New → Triaged |
| importance: | Undecided → High |
| milestone: | none → 1.25.0 |
| Charles Butler (lazypower) wrote : | #1 |
| summary: |
- Juju 1.24-beta6.1 unit commands hang indefinately + Juju 1.24-beta6.1 unit commands hang indefinitely |
This also appears to hang commands in an action context, i.e., action-get, action-set, etc.
| Tim Penhey (thumper) wrote : | #3 |
It seems that 1.24 beta 5 was ok, beta 6 no.
Need to check what changed between those two releases.
| Jesse Meek (waigani) wrote : | #4 |
The bug was introduced in commit f35a8c6, which aimed to fix bug #1454678. The problem is at cmd/jujud/
stdin, err := ioutil.
As opposed to jujuc commands run by agents without a terminal, debug-hooks is run via the terminal - which means ioutil.ReadAll waits indefinitely for stdin, but never gets any.
I explored several solutions and discussed with axw. In summary:
A possible solution is to pass through the file descriptor so the alias command can be executed directly from the terminal, though this may not work on Windows. Another solution could be to ditch net/rpc for juju/rpc, so we can have the server request data from stdin on demand. In the short term, reverting f35a8c6 will fix this bug and the underlying problem should be tackled in a proper fix to 1454678, which I'll reopen.
PR to revert it: http://
| Changed in juju-core: | |
| status: | Triaged → In Progress |
| summary: |
- Juju 1.24-beta6.1 unit commands hang indefinitely + Juju 1.24-beta6.1 unit commands in debug-hooks hang indefinitely |
| Changed in juju-core: | |
| assignee: | nobody → Jesse Meek (waigani) |
| Changed in juju-core: | |
| status: | In Progress → Fix Committed |
| Changed in juju-core: | |
| status: | Fix Committed → Fix Released |


Attaching all unit logs that seem relevant:
machine-3.log paste.ubuntu. com/11653320/
http://
unit-registrato r-0.log paste.ubuntu. com/11653329/
http://
machine-0.log paste.ubuntu. com/11653353/
http://
all-machines.log paste.ubuntu. com/11653354/
http://