"inappropriate ioctl for device" with --password-stdin and an empty password
I run Gitlab CI on my Kubernetes cluster, in which I use skopeo in jobs to copy container images around.
I am using the latest quay.io/skopeo/stable:latest image.
I login using credentials using:
cat $SKOPEO_PUBLISH_CREDENTIALS | skopeo login -v --username _json_key --password-stdin $GAR_HOST
Sometimes this will result in this error:
Password: time="2024-02-09T01:11:37Z" level=fatal msg="getting username and password: reading password: inappropriate ioctl for device"
I suspect it has something to do with the particular node or shell environment because rerunning a failed usually continues to fail when in close time-proximity.
Any ideas why this could be happening?
I found the issue. The file wasn't created. --debug helped, but would be nice if the default error message told you something more useful.
Then… let’s track that as an open bug?
Thanks for reporting it.
AFAICS:
In pkg/auth.Login, if opts.StdinPassword is set, but stdin is empty, we still end up calling getUserAndPass and trying to read the password interactively, again, from the same stdin (which we have already read until EOF, so it can’t possibly help). And that interactive read is trying to use stdin as a TTY.