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

login doesn't display server-side error message #3884

Closed
saschpe opened this issue Aug 26, 2019 · 5 comments · Fixed by containers/image#709
Closed

login doesn't display server-side error message #3884

saschpe opened this issue Aug 26, 2019 · 5 comments · Fixed by containers/image#709
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@saschpe
Copy link

saschpe commented Aug 26, 2019

/kind bug

Description

podman login doesn't display server-side error message when it fails.

Steps to reproduce the issue:

  1. podman login registry.gitlab.com
  2. enter random credentials

Describe the results you received:
The following response seems hardcoded:

error logging into "registry.gitlab.com": invalid username/password

Describe the results you expected:
While it should have returned the error message as provided by the authentication endpoint (Docker daemon ouput):

Error response from daemon: Get https://registry.gitlab.com/v2/: unauthorized: HTTP Basic: Access denied
You must use a personal access token with 'api' scope for Git over HTTP.
You can generate one at https://gitlab.com/profile/personal_access_tokens

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

Output of podman version:

Version:            1.5.1
RemoteAPI Version:  1
Go Version:         go1.12.7
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.7
  podman version: 1.5.1
host:
  BuildahVersion: 1.10.1
  Conmon:
    package: podman-1.5.1-3.fc30.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.0, commit: d728afa06cd2df86a27f32a4692c7099a56acc97-dirty'
  Distribution:
    distribution: fedora
    version: "30"
  MemFree: 4078399488
  MemTotal: 33664155648
  OCIRuntime:
    package: runc-1.0.0-93.dev.gitb9b6cc6.fc30.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc8+dev
      commit: e3b4c1108f7d1bf0d09ab612ea09927d9b59b4e3
      spec: 1.0.1-dev
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: festor
  kernel: 5.2.9-200.fc30.x86_64
  os: linux
  rootless: true
  uptime: 73h 41m 21.39s (Approximately 3.04 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/saschpe/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/saschpe/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 8
  RunRoot: /run/user/1000
  VolumePath: /home/saschpe/.local/share/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

podman-1.5.1-3.fc30.x86_64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 26, 2019
@vrothberg
Copy link
Member

Hi @saschpe, thanks for opening the issue! @QiWang19, would you have a look at it? I guess we might need some changes in c/image as well.

@vrothberg
Copy link
Member

I have a weak preference to put this error into the debugging logs to avoid cluttering the output but maybe others feel differently about it.

@saschpe
Copy link
Author

saschpe commented Aug 26, 2019

Depends on how output for other registries looks like but this is important information for end users. It took me quite a while to figure out the issue. In fact I had to install docker again to double-check the matter ;-)

@QiWang19
Copy link
Contributor

server-side error message is in the http response

https://github.com/containers/image/blob/634605d06e738aec8332bcfd69162e7509ac7aaf/docker/docker_client.go#L529

we return hard code error invalid username/password if http.StatusUnauthorized...should we return the message from http response...?

@mheon
Copy link
Member

mheon commented Sep 16, 2019

Providing it in --log-level=debug at a minimum would be a good idea

QiWang19 added a commit to QiWang19/image that referenced this issue Sep 24, 2019
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 25, 2019
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 26, 2019
fix containers/podman#3884
Returns http response error message from  server-side.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 26, 2019
fix containers/podman#3884
Returns http response error message from  server-side.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 26, 2019
fix containers/podman#3884
Returns http response error message from  server-side.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 27, 2019
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 27, 2019
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/image that referenced this issue Sep 27, 2019
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. 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.

5 participants