-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman image save
results in Error: open /dev/stdout: permission denied
#12402
Comments
I don't believe this is a podman issue. I have no idea but there is nothing about podman which would cause /dev/stderr would be read/only. I am sure this is caused by something else on your system. |
@mtrmac could you have a quick look at this issue? I don't have a Mac. https://discussions.apple.com/thread/251125990 suggests there may be issues on Mac OS when opening |
I didn’t test Podman itself, but from experimenting with the code below, it looks like % (ls -la /dev/stdout /dev/fd) | cat
lr-xr-xr-x 1 root wheel 0 17 lis 08:51 /dev/stdout -> fd/1
/dev/fd:
total 9
dr-xr-xr-x 1 root wheel 0 17 lis 08:51 .
dr-xr-xr-x 3 root wheel 4459 17 lis 08:51 ..
crw--w---- 1 mitr tty 16, 3 24 lis 14:35 0
prw-rw---- 0 mitr staff 0 24 lis 14:35 1
crw--w---- 1 mitr tty 16, 3 24 lis 14:35 2
drw-r--r-- 33 mitr staff 1056 24 lis 14:29 3
dr--r--r-- 1 root wheel 0 17 lis 08:51 4 package main
import (
"os"
"fmt"
)
func main () {
//fh, err := os.OpenFile("/dev/stdout", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
fh, err := os.OpenFile("/dev/stdout", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
//fh, err := os.OpenFile("/dev/stdout", os.O_WRONLY|os.O_CREATE, 0644)
//fh, err := os.Create("/dev/stdout")
_, err2 := fh.Write([]byte("Hello\n"))
fmt.Fprintf(os.Stderr, "fh=%#v err=%v err2=%#v", fh, err, err2)
} That’s certainly an interesting quirk, but should be trivial to fix. |
So you think
Would fix this issue? |
|
Ok so it is failing to open it for read. |
The previous code fails on a MAC when opening /dev/stdout Fixes: containers#12402 [NO NEW TESTS NEEDED] No easy way to test this. Signed-off-by: Daniel J Walsh <[email protected]>
The previous code fails on a MAC when opening /dev/stdout Fixes: containers#12402 [NO NEW TESTS NEEDED] No easy way to test this. Signed-off-by: Daniel J Walsh <[email protected]>
With [a fix][1] in [podman v3.4.3][2], these commands now work as expected in macOS. Potentially, it might make sense to version check podman to ensure that the minimum version is met, but I'm not sure that's needed because it's unlikely that people have an older version installed _and_ wish to use this tool. I'm unsure whether the commands work on Windows so I left the unsupported version there compiling with the negation of the supported flags. [1]: containers/podman#12402 [2]: https://github.com/containers/podman/blob/4ba71f955a944790edda6e007e6d074009d437a7/RELEASE_NOTES.md#bugfixes-2
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
podman image save centos:7 | gzip -9c > test
Describe the results you received:
test
is empty (except for the gzip header).Describe the results you expected:
A gzipped tarball at
test
.Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: