Can login with docker login but can't do a docker push #11058

Closed
opened 2025-11-02 09:26:20 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @carolosf on GitHub (Jun 19, 2023).

Description

I can't reproduce on try.gitea.io but using the hostname for the example

I am using ldap for authentication with a kubernetes ingress accepting a particular hostname.

When I do docker login hostname it logs in fine even if I enter the wrong password

docker login try.gitea.io

I get an authorisation required message when I try push.

docker tag ubuntu try.gitea.io/carolosf/ubuntu:latest
docker push try.gitea.io/carolosf/ubuntu:latest
The push refers to repository [git.example.com/demo/ubuntu]
ab318285541e: Preparing
unauthorized: authentication required

I can upload other packages ok

curl -X PUT -u carolosf:password -T file.yaml https://git.example.com/api/packages/carolosf/generic/depploytest/v1/file.yaml

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

k3s kubernetes latest docker image

Database

SQLite

Originally created by @carolosf on GitHub (Jun 19, 2023). ### Description I can't reproduce on try.gitea.io but using the hostname for the example I am using ldap for authentication with a kubernetes ingress accepting a particular hostname. When I do `docker login hostname` it logs in fine even if I enter the wrong password ``` docker login try.gitea.io ``` I get an authorisation required message when I try push. ``` docker tag ubuntu try.gitea.io/carolosf/ubuntu:latest docker push try.gitea.io/carolosf/ubuntu:latest The push refers to repository [git.example.com/demo/ubuntu] ab318285541e: Preparing unauthorized: authentication required ``` I can upload other packages ok ``` curl -X PUT -u carolosf:password -T file.yaml https://git.example.com/api/packages/carolosf/generic/depploytest/v1/file.yaml ``` ### Gitea Version 1.19.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? k3s kubernetes latest docker image ### Database SQLite
GiteaMirror added the topic/packagesissue/needs-feedback labels 2025-11-02 09:26:20 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Jun 20, 2023):

Can't try at the moment but that should be fixed... See #20563 and #22119.

@KN4CK3R commented on GitHub (Jun 20, 2023): Can't try at the moment but that should be fixed... See #20563 and #22119.
Author
Owner

@KN4CK3R commented on GitHub (Jun 20, 2023):

Tried it and can't reproduce the login error with the current main branch.

@KN4CK3R commented on GitHub (Jun 20, 2023): Tried it and can't reproduce the login error with the current main branch.
Author
Owner

@carolosf commented on GitHub (Jun 20, 2023):

Strange - just tried with gitea/gitea:nightly-rootless arm64 image (docker sha f68db5dd1094, Version: 1.20.0+rc0-100-ge50c3e843
and still getting the login issue... Any idea why?

@carolosf commented on GitHub (Jun 20, 2023): Strange - just tried with gitea/gitea:nightly-rootless arm64 image (docker sha f68db5dd1094, Version: [1.20.0+rc0-100-ge50c3e843](https://git.ubuspace.com/admin/config) and still getting the login issue... Any idea why?
Author
Owner

@KN4CK3R commented on GitHub (Jun 21, 2023):

gitea/gitea:1.19.3:
grafik

gitea/gitea:nightly-rootless:
grafik

First is a wrong password, second is the correct password.

@KN4CK3R commented on GitHub (Jun 21, 2023): `gitea/gitea:1.19.3`: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/7e6b12da-e42d-4a99-9c66-7f23c03f328e) `gitea/gitea:nightly-rootless`: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/7e354c2e-fbb1-45fc-addc-7b5452f1c1b6) First is a wrong password, second is the correct password.
Author
Owner

@carolosf commented on GitHub (Jun 21, 2023):

Could it be because I'm authenticating with LDAP?

@carolosf commented on GitHub (Jun 21, 2023): Could it be because I'm authenticating with LDAP?
Author
Owner

@KN4CK3R commented on GitHub (Jun 21, 2023):

There should be no difference. Could you test it with a local account / another test instance without LDAP?

@KN4CK3R commented on GitHub (Jun 21, 2023): There should be no difference. Could you test it with a local account / another test instance without LDAP?
Author
Owner

@carolosf commented on GitHub (Jun 21, 2023):

So I deployed a new kubernetes deployment of gitea with the latest nightly and it worked.
I then connected LDAP to it and that also worked as expected.

Eventually I found that my original instance had ROOT_URL= set to http://git.example.com instead of https://git.example.com I changed the config and restarted it and it started working.

By working I mean it started rejecting incorrect logins as expected and also a docker push worked.

@carolosf commented on GitHub (Jun 21, 2023): So I deployed a new kubernetes deployment of gitea with the latest nightly and it worked. I then connected LDAP to it and that also worked as expected. Eventually I found that my original instance had ROOT_URL= set to http://git.example.com instead of https://git.example.com I changed the config and restarted it and it started working. By working I mean it started rejecting incorrect logins as expected and also a docker push worked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11058