Digging through the code, the issue is that if ps.Start() returns an error, then we trigger a code path that doesn't wait for the process to exit (which is correct), but then we don't handle the error correctly, because the rest of the code is *only* looking at the exit error.
Something like:
--- a/worker/uniter/runner/runner.go
+++ b/worker/uniter/runner/runner.go
@@ -515,6 +515,8 @@ func (runner *runner) runCharmHookOnLocal(hookName string, env []string, charmLo runner.context.SetProcess(hookProcess{ps.Process})
// Block until execution finishes exitErr = ps.Wait()
+ } else {
+ exitErr = err
}
// Ensure hook loggers are stopped before reading stdout/stderr
// so all the output is captured.
Digging through the code, the issue is that if ps.Start() returns an error, then we trigger a code path that doesn't wait for the process to exit (which is correct), but then we don't handle the error correctly, because the rest of the code is *only* looking at the exit error.
Something like:
--- a/worker/ uniter/ runner/ runner. go uniter/ runner/ runner. go ocal(hookName string, env []string, charmLo
runner. context. SetProcess( hookProcess{ ps.Process} )
exitErr = ps.Wait()
+++ b/worker/
@@ -515,6 +515,8 @@ func (runner *runner) runCharmHookOnL
// Block until execution finishes
+ } else {
+ exitErr = err
}
// Ensure hook loggers are stopped before reading stdout/stderr
// so all the output is captured.
should fix this case.