Comment 1 for bug 1981410

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1981410] [NEW] debug-hooks - strange behaviour

When you run `juju debug-hooks` we drop you into a tmux session with
multiple windows. The first window is just a session on the machine, the
latter ones are the actual hook executions. Indeed we will jump you from
the current session to the hook that is requested.
We need to sit you in *an* environment so that the session stays alive.

So I would say this is by design, I'm not sure your particular needs. It
can be true that you have a bunch of hooks pending you may struggle to exit
the current one and exit the terminal overall. (I believe as it is just
tmux, though, you can do ^B D to exit the session completely (it might be
^A, but I think that is the default for Screen while Tmux default is ^B))

On Tue, Jul 12, 2022 at 3:20 AM Jordan Barrett <email address hidden>
wrote:

> Public bug reported:
>
> When I execute `juju debug-hooks`, sometimes I see the terminal screen
> with instructions (I think this is intended:
> ------------------------------------------------
> This is a Juju debug-hooks tmux session. Remember:
> 1. ...
>
> root@juju-c218bc-4:/var/lib/juju/agents/unit-wordpress-3/charm#
> ------------------------------------------------
>
> However, at other times, I only see a blank screen with
> ------------------------------------------------
> root@juju-c218bc-4:/home/ubuntu#
> ------------------------------------------------
>
> I've noticed some other strange things. Sometimes while I am waiting at
> the second screen, the first screen will suddenly appear. Also, when I
> try to exit the first screen using `exit` or Ctrl-D, I am taken to the
> second screen (which sometimes will take me back to the first screen,
> making it hard to exit).
>
> It seems like the second screen is calling the first screen as a
> "subshell" or something, but that it fails to do this sometimes. As for
> the timing, I think this is related to the status of the unit and/or if
> there is a hook running. It seems that I will get stuck at the second
> screen while a hook is running, and then once the hook finishes, it will
> take me to the first screen. I'm not 100% sure about this theory though.
>
> This is using:
> - Juju v3.0-beta2 (SHA 47e53008)
> - Ubuntu 20.04 LTS
> - GoLand 2022.1.3 integrated terminal
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> When I execute `juju debug-hooks`, sometimes I see the terminal screen
> with instructions (I think this is intended:
> - ```
> + ------------------------------------------------
> This is a Juju debug-hooks tmux session. Remember:
> 1. ...
>
> - root@juju-c218bc-4:/var/lib/juju/agents/unit-wordpress-3/charm#
> - ```
> + root@juju-c218bc-4:/var/lib/juju/agents/unit-wordpress-3/charm#
> + ------------------------------------------------
>
> However, at other times, I only see a blank screen with
> - ```
> - root@juju-c218bc-4:/home/ubuntu#
> - ```
> + ------------------------------------------------
> + root@juju-c218bc-4:/home/ubuntu#
> + ------------------------------------------------
>
> I've noticed some other strange things. Sometimes while I am waiting at
> the second screen, the first screen will suddenly appear. Also, when I
> try to exit the first screen using `exit` or Ctrl-D, I am taken to the
> second screen (which sometimes will take me back to the first screen,
> making it hard to exit).
>
> It seems like the second screen is calling the first screen as a
> "subshell" or something, but that it fails to do this sometimes. As for
> the timing, I think this is related to the status of the unit and/or if
> there is a hook running. It seems that I will get stuck at the second
> screen while a hook is running, and then once the hook finishes, it will
> take me to the first screen. I'm not 100% sure about this theory though.
>
> This is using:
> - Juju v3.0-beta2 (SHA 47e53008)
> - Ubuntu 20.04 LTS
> - GoLand 2022.1.3 integrated terminal
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1981410
>
> Title:
> debug-hooks - strange behaviour
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1981410/+subscriptions
>
>