Skip to content
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 logout doesn't work if logged in with docker login #2735

Closed
TomSweeneyRedHat opened this issue Mar 21, 2019 · 4 comments · Fixed by #2971
Closed

Podman logout doesn't work if logged in with docker login #2735

TomSweeneyRedHat opened this issue Mar 21, 2019 · 4 comments · Fixed by #2971
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@TomSweeneyRedHat
Copy link
Member

TomSweeneyRedHat commented Mar 21, 2019

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

kind bug

Description
If you login to a registry server with docker login and then later try to log in the same registry server with podman login, you're told the credentials already exist. If you try to logout using podman logout you're told you're not logged in.

Steps to reproduce the issue:

  1. docker login quay.io

  2. podman login quay.io

  3. podman logout quay.io

Describe the results you received:

# docker login quay.io
Username: tomsweeneyredhat
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
#  podman login quay.io
Authenticating with existing credentials...
Existing credentials are valid. Already logged in to quay.io
# podman logout quay.io
Error: error logging out of "quay.io": error updating "/run/user/0/containers/auth.json": not logged in

Describe the results you expected:
I'm not quite sure what the expected behaviour should be. My leaning is the first login message should change from

Existing credentials are valid. Already logged in to quay.io

to

Existing credentials are valid. Already logged in to quay.io via docker login.

and/or perhaps a similar message should be added to podman logout rather than the error. Perhaps

Existing credentials were established via docker login.  Please use docker logout instead.

We could instead just remove the docker credentials, but I'm a bit leery about that. Or we could just ignore that the credentials are in the docker cache and create our own. That though might cause confusion if the user logs into both, then later removes from one and is still able to authenticate even though they'd logged out.

Additional information you deem important (e.g. issue happens only occasionally):
n/a

Output of podman version:

$ podman version
Version:            1.1.2
RemoteAPI Version:  1
Go Version:         go1.11.5
Git Commit:         a95a49d3038462d033f84ac314ec8a3064a99cff
Built:              Tue Mar  5 13:10:31 2019
OS/Arch:            linux/amd64

Output of podman info --debug:

podman info --debug
debug:
  compiler: gc
  git commit: a95a49d3038462d033f84ac314ec8a3064a99cff
  go version: go1.11.5
  podman version: 1.1.2
host:
  BuildahVersion: 1.7.1
  Conmon:
    package: podman-1.1.2-1.git0ad9b6b.fc29.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.12.0-dev, commit: a95a49d3038462d033f84ac314ec8a3064a99cff'
  Distribution:
    distribution: fedora
    version: "29"
  MemFree: 930054144
  MemTotal: 2087501824
  OCIRuntime:
    package: runc-1.0.0-69.dev.git6635b4f.fc29.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc6+dev
      commit: 1281cf10155a1881fbc87ee7d1401adf180963b7-dirty
      spec: 1.0.1-dev
  SwapFree: 2145894400
  SwapTotal: 2147479552
  arch: amd64
  cpus: 1
  hostname: localhost.localdomain
  kernel: 4.20.15-200.fc29.x86_64
  os: linux
  rootless: true
  uptime: 1h 7m 47.94s (Approximately 0.04 days)
insecure registries:
  registries: []
registries:
  registries:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/tom/.config/containers/storage.conf
  ContainerStore:
    number: 2
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/tom/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 9
  RunRoot: /run/user/1000
  VolumePath: /home/tom/.local/share/containers/storage/volumes

Additional environment details (AWS, VirtualBox, physical, etc.):

@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2019

@QiWang19 Could you check this out and see if it is still an issue, if yes then please fix it.

@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2019

I would think podman login should succeed even if docker login has happened.

@rhatdan
Copy link
Member

rhatdan commented Apr 17, 2019

I think we should check to see if you are logged in via podman if not then tell the user it is using docker login, If I try podman logout, and we are not logged in, then check if docker auth exists and report it as an error, But do not touch the file.

@QiWang19
Copy link
Contributor

use docker.checkAuth() in /containers/image/pkg/docker/config/config.go will cause import cycle problem and needs to pass context as an argument.
Can I use checkAuth in podman logout? if not logged in podman and checkAuth success I will assume it is logged with docker?

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants