-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils: improve error message if path not executable #1672
utils: improve error message if path not executable #1672
Conversation
podman system tests failed. @containers/packit-build please check. |
{ | ||
*out = xstrdup (executable_path); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be no return here anymore which means even in the absolute path you fall back to looking up PATH. That seems wrong? should this set last_error = ret and then have en else branch for the PATH lookup?
39abc01
to
8f3e370
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025-02-14T12:04:23.5782745Z Summarizing 8 Failures:
2025-02-14T12:04:23.5783188Z [FAIL] Podman exec [It] podman exec cannot be invoked
2025-02-14T12:04:23.5783867Z /root/go/src/github.com/containers/podman/test/e2e/exec_test.go:436
2025-02-14T12:04:23.5784630Z [FAIL] Podman run [It] podman run --rm failed container should delete itself
2025-02-14T12:04:23.5785117Z /root/go/src/github.com/containers/podman/test/e2e/run_test.go:1453
2025-02-14T12:04:23.5785606Z [FAIL] Podman run [It] podman run failed container should NOT delete itself
2025-02-14T12:04:23.5786107Z /root/go/src/github.com/containers/podman/test/e2e/run_test.go:1465
2025-02-14T12:04:23.5786731Z [FAIL] Podman run exit [It] podman run exit ExecErrorCodeCannotInvoke
2025-02-14T12:04:23.5787542Z /root/go/src/github.com/containers/podman/test/e2e/run_exit_test.go:25
2025-02-14T12:04:23.5789852Z [FAIL] Podman run exit [It] podman run exit ExecErrorCodeNotFound
2025-02-14T12:04:23.5790572Z /root/go/src/github.com/containers/podman/test/e2e/run_exit_test.go:31
2025-02-14T12:04:23.5791262Z [FAIL] Podman start [It] podman start --rm removed on failure
2025-02-14T12:04:23.5791928Z /root/go/src/github.com/containers/podman/test/e2e/start_test.go:41
2025-02-14T12:04:23.5792629Z [FAIL] Podman start [It] podman start --rm --attach removed on failure
2025-02-14T12:04:23.5793331Z /root/go/src/github.com/containers/podman/test/e2e/start_test.go:54
2025-02-14T12:04:23.5794023Z [FAIL] Podman run entrypoint [It] podman run no command, entrypoint, or cmd
2025-02-14T12:04:23.5794747Z /root/go/src/github.com/containers/podman/test/e2e/run_entrypoint_test.go:21
That is not blocker of course but something we should fix ahead of time in podman I think, though one thing I noticed in "podman run failed container should NOT delete itself"
$ bin/podman --runtime /home/pholzing/CODE/crun/crun run --rm quay.io/libpod/testimage:20241011 blah
Error: /home/pholzing/CODE/crun/crun: cannot find executable `blah`: No such file or directory: OCI runtime attempted to invoke a command that was not found
# with current crun
$ bin/podman --runtime crun run --rm quay.io/libpod/testimage:20241011 blah
Error: crun: executable file `blah` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
The not found in $PATH
is missing now and I think that has some value to know that crun checks PATH so maybe consider keeping it?
Aside from that LGTM, I agree that the new message is overall better
072dba0
to
3bf019e
Compare
3bf019e
to
2cd3915
Compare
not important but a small improvement would be changing updateor show the error in runc style:
|
2cd3915
to
ec6e413
Compare
what do you think of the new version? |
lgtm |
0dfca41
to
9ada14f
Compare
how do we move forward with the Podman tests? I think we should just drop that checks, there is no guarantee about the error messages and makes testing of different versions more difficult than it should be. |
We should not drop error message checks, the reason we must do that is because people keep adding tests for errors that caused a totally different error and if you don't check the message you will never find out. The way to move forward is to change the string we match, if there is a partial overlap between the old and new error we can use that (assuming it is still useful and not just "error") |
sorry for bothering you so late on a Friday night. I know the rationale behind these checks, but I still disagree with that because it is not possible to test with different OCI runtimes. In any case, I'll take care of these incompatibilities, since I am introducing them :-) |
9ada14f
to
12bd6a8
Compare
Needed-by: containers/crun#1672 Signed-off-by: Giuseppe Scrivano <[email protected]>
12bd6a8
to
1437baa
Compare
@Luap99 opened a PR for Podman: containers/podman#25340 |
1437baa
to
9fdb879
Compare
Needed-by: containers/crun#1672 Signed-off-by: Giuseppe Scrivano <[email protected]>
Needed-by: containers/crun#1672 Signed-off-by: Giuseppe Scrivano <[email protected]>
Needed-by: containers/crun#1672 Signed-off-by: Giuseppe Scrivano <[email protected]>
Needed-by: containers/crun#1672 Signed-off-by: Giuseppe Scrivano <[email protected]>
9fdb879
to
8f9d583
Compare
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
8f9d583
to
4f0333b
Compare
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
4f0333b
to
5c7dca7
Compare
5c7dca7
to
013f69c
Compare
Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
if a handler is specified, do not return an early error if the executable path could not be found. Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
improve the error returned when the specified path is not executable. Return the reason why the lookup failed when the path is not a regular file, or has no executable bit set. Closes: containers#1671 Signed-off-by: Giuseppe Scrivano <[email protected]>
013f69c
to
5393867
Compare
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
5393867
to
d92b070
Compare
unify the error codes returned by runc and crun. Fix the tests to work with both runtimes, as well as the containers/crun#1672 changes in progress for crun. Follow-up for containers#25340 Signed-off-by: Giuseppe Scrivano <[email protected]>
d92b070
to
3721355
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
improve the error returned when the specified path is not executable.
Return the reason why the lookup failed when the path is not a regular file, or has no executable bit set.
Closes: #1671