Transfering repo ownership breaks repo URLs #6822

Closed
opened 2025-11-02 07:07:32 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @bazsodombiandras on GitHub (Feb 7, 2021).

Description

  1. Create a gitea user named UserA (admin).
  2. Create a repository named repo1 while logged in as UserA. The URL of the repo, as shown on the gitea web interface is: https://gitea.myhost.com/UserA/repo1.git
  3. Push some content into the repo repo1.
  4. Create a gitea user named UserB (also admin)
  5. While logged in as UserA, transfer the ownership of repo1 to UserB. The URL of the repo on the gitea web interface changes to https://gitea.myhost.com/UserB/repo1.git
  6. Log in as UserB and de-activate user account UserA (the whole point of this is to get rid of UserA and give the repos of UserA to UserB).
  7. On a remote machine try to do anything with the remote repo repo1 (eg. clone the repo repo1). You get the error: "fatal: https://gitea.myhost.com/UserB/repo1.git/info/refs not valid: could not determine hash algorithm; is this a git repository?"

Screenshots

Originally created by @bazsodombiandras on GitHub (Feb 7, 2021). - Gitea version: 1.13.2 armv6 - Git version: 2.25.1 - Operating system: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.87-218 armv7l) - Gitea was downloaded as binary from: https://dl.gitea.io/gitea/1.13.2/gitea-1.13.2-linux-arm-6 - Gitea runs as a service (no Docker) - Database (use `[x]`): - [ ] PostgreSQL - [x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No (I have no admin rights at http://try.giteo.io and this requires it) ## Description 1. Create a gitea user named UserA (admin). 2. Create a repository named repo1 while logged in as UserA. The URL of the repo, as shown on the gitea web interface is: https://gitea.myhost.com/UserA/repo1.git 3. Push some content into the repo repo1. 4. Create a gitea user named UserB (also admin) 5. While logged in as UserA, transfer the ownership of repo1 to UserB. The URL of the repo on the gitea web interface changes to https://gitea.myhost.com/UserB/repo1.git 6. Log in as UserB and de-activate user account UserA (the whole point of this is to get rid of UserA and give the repos of UserA to UserB). 7. On a remote machine try to do anything with the remote repo repo1 (eg. clone the repo repo1). You get the error: "fatal: https://gitea.myhost.com/UserB/repo1.git/info/refs not valid: could not determine hash algorithm; is this a git repository?" ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@bazsodombiandras commented on GitHub (Feb 7, 2021):

IT seems that the problem is that the account of the original user UserA was de-activated. If I re-activate it, I can interact with the remote gitea repos as UserB. UserA is the very first admin user created in gitea, perhaps this is causing problems.

@bazsodombiandras commented on GitHub (Feb 7, 2021): IT seems that the problem is that the account of the original user UserA was de-activated. If I re-activate it, I can interact with the remote gitea repos as UserB. UserA is the very first admin user created in gitea, perhaps this is causing problems.
Author
Owner

@zeripath commented on GitHub (Feb 7, 2021):

Are you sure that says:

fatal: https://gitea.myhost.com/UserB/repo1.git/info/refs not valid: could not determine hash algorithm; is this a git repository?"

As in UserB?

I suspect you'll find it's UserA

@zeripath commented on GitHub (Feb 7, 2021): Are you sure that says: ``` fatal: https://gitea.myhost.com/UserB/repo1.git/info/refs not valid: could not determine hash algorithm; is this a git repository?" ``` As in UserB? I suspect you'll find it's UserA
Author
Owner

@bazsodombiandras commented on GitHub (Feb 7, 2021):

False alarm. The problem was on the remote machine which was trying to communicate with the gitea server. It was still trying to authenticate with the old username (UserA). The solution:

git config --global credential.username "UserB"
git config --global credential.password "password of user B"
@bazsodombiandras commented on GitHub (Feb 7, 2021): False alarm. The problem was on the remote machine which was trying to communicate with the gitea server. It was still trying to authenticate with the old username (UserA). The solution: ``` git config --global credential.username "UserB" git config --global credential.password "password of user B" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6822