bug: user org vs repo SMTP login does not work with git push #1134

Closed
opened 2025-11-02 03:49:38 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @mckaygerhard on GitHub (Oct 9, 2017).

  • Gitea version: stable 1.1.4
  • Git version: 1.8.3
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    xorm log seems have some releveant
2017/10/09 07:43:20 [I] [sql] SELECT "id", "owner_id", "lower_name", "name", "description", "website", "default_branch", "num_watches", "num_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "is_private", "is_bare", "is_mirror", "is_fork", "fork_id", "created_unix", "updated_unix" FROM "repository" WHERE "owner_id"=$1 AND "lower_name"=$2 LIMIT 1 [args] [4 ekstra]
2017/10/09 07:43:21 [I] [sql] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "description", "num_teams", "num_members", "diff_view_style" FROM "user" WHERE "lower_name"=$1 LIMIT 1 [args] [usuario_name]

Description

there's org1 with ekstra repo, and org no has member:

  1. added the 'usuario_name' to the org1 and then later configure a SMTP login, when try to make a push, login failed for the git command..
  2. in this behaviour, i cannot added that user to the repo, said that user member are already organization member
  3. remove from org membership and add manually to the repo ekstra now later added also again to the org1 organization.. now the user are in both repo and organization with explicy write access

in any case, user cannot make push, always got: error when push some piece of code using SMTP auth:

error: Cannot access URL http://192.168.1.100/lagranja/org1/ekstra.git/, return code 22
fatal: git-http-push failed

but if i do not have any to upload and make a push, everithing it looks good! say "everyting its up to date"

Originally created by @mckaygerhard on GitHub (Oct 9, 2017). - Gitea version: stable 1.1.4 - Git version: 1.8.3 - Operating system: Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: xorm log seems have some releveant ``` 2017/10/09 07:43:20 [I] [sql] SELECT "id", "owner_id", "lower_name", "name", "description", "website", "default_branch", "num_watches", "num_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "is_private", "is_bare", "is_mirror", "is_fork", "fork_id", "created_unix", "updated_unix" FROM "repository" WHERE "owner_id"=$1 AND "lower_name"=$2 LIMIT 1 [args] [4 ekstra] 2017/10/09 07:43:21 [I] [sql] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "description", "num_teams", "num_members", "diff_view_style" FROM "user" WHERE "lower_name"=$1 LIMIT 1 [args] [usuario_name] ``` ## Description there's `org1` with `ekstra` repo, and org no has member: 1. added the 'usuario_name' to the `org1` and then later configure a SMTP login, when try to make a push, login failed for the git command.. 2. in this behaviour, i cannot added that user to the repo, said that user member are already organization member 3. remove from org membership and add manually to the repo `ekstra` now later added also again to the `org1` organization.. now the user are in both repo and organization with explicy write access in any case, user cannot make push, always got: error when push some piece of code using SMTP auth: ``` error: Cannot access URL http://192.168.1.100/lagranja/org1/ekstra.git/, return code 22 fatal: git-http-push failed ``` but if i do not have any to upload and make a push, everithing it looks good! say "everyting its up to date"
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 03:49:38 -06:00
Author
Owner

@mckaygerhard commented on GitHub (Oct 9, 2017):

NEW: if i swicth to local auth, make a commit, and then returns to SMTP auth, now works..

i got the problem, as xorg log said, gitea search for user on the tables event auth directly to the SMTP!

i guest that if i created the user and use auth directly first time, this problem does not happened!

i mean, if a entry in database exits this bug happened, the process must avoid search at the database if another auth method are defined for user

also please notify the specific commit that solves this problem.

@mckaygerhard commented on GitHub (Oct 9, 2017): NEW: if i swicth to local auth, make a commit, and then returns to SMTP auth, now works.. i got the problem, as xorg log said, gitea search for user on the tables event auth directly to the SMTP! i guest that if i created the user and use auth directly first time, this problem does not happened! i mean, if a entry in database exits this bug happened, the process must avoid search at the database if another auth method are defined for user also please notify the specific commit that solves this problem.
Author
Owner

@mckaygerhard commented on GitHub (Mar 26, 2018):

this it's a important issue found in 1.1.0 and gitea raises 1.4 and still happened? features and features unusefully eye-candy stuffs and important things still unresolved!

what it's the progress of this issue?

@mckaygerhard commented on GitHub (Mar 26, 2018): this it's a important issue found in 1.1.0 and gitea raises 1.4 and still happened? features and features unusefully eye-candy stuffs and important things still unresolved! what it's the progress of this issue?
Author
Owner

@lafriks commented on GitHub (Mar 26, 2018):

@mckaygerhard can you verify that in latest version bug is still present?

@lafriks commented on GitHub (Mar 26, 2018): @mckaygerhard can you verify that in latest version bug is still present?
Author
Owner

@mckaygerhard commented on GitHub (Mar 26, 2018):

in 1.3.3 still present i'll test right now 1.4 but seems need newer mysql database.. i must recompile due the binaries ofers are too high (segfault in my linux box)

@mckaygerhard commented on GitHub (Mar 26, 2018): in 1.3.3 still present i'll test right now 1.4 but seems need newer mysql database.. i must recompile due the binaries ofers are too high (segfault in my linux box)
Author
Owner

@mckaygerhard commented on GitHub (Dec 5, 2018):

i now have 1.5.1 tested for a week and still hapened! user cannot make push using SMTP if are addeed only to the org and not to the repo xplicy!

@mckaygerhard commented on GitHub (Dec 5, 2018): i now have 1.5.1 tested for a week and still hapened! user cannot make push using SMTP if are addeed only to the org and not to the repo xplicy!
Author
Owner

@mckaygerhard commented on GitHub (Dec 23, 2018):

now 1.6.1 and this bugs are still present @lafriks the solution as i reply seems easy to you programmers, just need a "OR" beetween id/username and also id/mailname backend

@mckaygerhard commented on GitHub (Dec 23, 2018): now 1.6.1 and this bugs are still present @lafriks the solution as i reply seems easy to you programmers, just need a "OR" beetween id/username and also id/mailname backend
Author
Owner

@stale[bot] commented on GitHub (Feb 21, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 21, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

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

Take a look at the current implementation, I think this has been resolved. Please feel free to reopen if it's still a problem.

@lunny commented on GitHub (Jun 20, 2023): Take a look at the current implementation, I think this has been resolved. Please feel free to reopen if it's still a problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1134