Can't migrate from github without login + login does not work with 2FA #3700

Closed
opened 2025-11-02 05:22:09 -06:00 by GiteaMirror · 22 comments
Owner

Originally created by @theAkito on GitHub (Jul 31, 2019).

  • Gitea version (or commit ref): b84a251fc
  • Git version: 2.11.0
  • Operating system: DietPi (based on Raspbian Stretch)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: x

Description

I want to clone (migrate) a public repository from Github to my account. I don't want to migrate any Issues, Wikis or anything. Just the repository. Every time I try to do that, it tells me I have to put in my credentials (I should not have to). If I put in my credentials, it still does not work, because it does not accept 2FA.

Originally created by @theAkito on GitHub (Jul 31, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): b84a251fc - Git version: 2.11.0 - Operating system: DietPi (based on Raspbian Stretch) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: x ## Description I want to clone (migrate) a public repository from Github to my account. I don't want to migrate any Issues, Wikis or anything. Just the repository. Every time I try to do that, it tells me I have to put in my credentials (I should not have to). If I put in my credentials, it still does not work, because it does not accept 2FA.
Author
Owner

@lunny commented on GitHub (Jul 31, 2019):

Are you migrating a private repository?

@lunny commented on GitHub (Jul 31, 2019): Are you migrating a private repository?
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

Are you migrating a private repository?

No, absolutely not. Else I would not have access to it myself. 😄

@theAkito commented on GitHub (Jul 31, 2019): > > > Are you migrating a private repository? No, absolutely not. Else I would not have access to it myself. 😄
Author
Owner

@mrsdizzie commented on GitHub (Jul 31, 2019):

You should be able to use a personal access token for this:

At github go to https://github.com/settings/tokens and create one then you can use that token as the username on the migration form

@mrsdizzie commented on GitHub (Jul 31, 2019): You should be able to use a personal access token for this: At github go to https://github.com/settings/tokens and create one then you can use that token as the username on the migration form
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

You should be able to use a personal access token for this:

At github go to https://github.com/settings/tokens and create one then you can use that token as the username on the migration form

Well, even if I can do it after setting the token, this does not solve the root cause, yet. The root cause is that I have to put in credentials, at all, to be able to access a public repository. I shouldn't have to set any token or put in any credentials, in the first place.

@theAkito commented on GitHub (Jul 31, 2019): > > > You should be able to use a personal access token for this: > > At github go to https://github.com/settings/tokens and create one then you can use that token as the username on the migration form Well, even if I can do it after setting the token, this does not solve the root cause, yet. The root cause is that I have to put in credentials, at all, to be able to access a public repository. I shouldn't have to set any token or put in any credentials, in the first place.
Author
Owner

@mrsdizzie commented on GitHub (Jul 31, 2019):

Unauthenticated requests are very limited by Github API and would fail for many migrations

@mrsdizzie commented on GitHub (Jul 31, 2019): Unauthenticated requests are very limited by Github API and would fail for many migrations
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

Unauthenticated requests are very limited by Github API and would fail for many migrations

Every migration that happened before the update that added the feature to migrate more than just the repository was successful. That said, if it was hard to (lite) fork a clean repository, then it would be also hard to clone the repository. The server basically just has to clone the repository.

@theAkito commented on GitHub (Jul 31, 2019): > > > Unauthenticated requests are very limited by Github API and would fail for many migrations Every migration that happened before the update that added the feature to migrate more than just the repository was successful. That said, if it was hard to (lite) fork a clean repository, then it would be also hard to clone the repository. The server basically just has to clone the repository.
Author
Owner

@zeripath commented on GitHub (Jul 31, 2019):

It's not just a clone of a repository over git anymore, we're getting things like issues - stuff which has to be obtained over the API.

@zeripath commented on GitHub (Jul 31, 2019): It's not just a clone of a repository over git anymore, we're getting things like issues - stuff which has to be obtained over the API.
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

It's not just a clone of a repository over git anymore, we're getting things like issues - stuff which has to be obtained over the API.

That is what I am addressing. I do not want to migrate any issues or anything like that. I just want to have a clean repository. That's it. No need for any API whatsoever. Just git clone https://github.com/user/myrepo. That's it.

@theAkito commented on GitHub (Jul 31, 2019): > > > It's not just a clone of a repository over git anymore, we're getting things like issues - stuff which has to be obtained over the API. That is what I am addressing. I do not want to migrate any issues or anything like that. I just want to have a clean repository. That's it. No need for any API whatsoever. Just `git clone https://github.com/user/myrepo.` That's it.
Author
Owner

@mrsdizzie commented on GitHub (Jul 31, 2019):

Yes you can still enter no authentication information and have the repo cloned as normal without any issues, pr, etc from Github just as it was before.

Just put in the address of the repo and leave username/password blank

@mrsdizzie commented on GitHub (Jul 31, 2019): Yes you can still enter no authentication information and have the repo cloned as normal without any issues, pr, etc from Github just as it was before. Just put in the address of the repo and leave username/password blank
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

Yes you can still enter no authentication information and have the repo cloned as normal without any issues, pr, etc from Github just as it was before.

Just put in the address of the repo and leave username/password blank

Please read the OP before commenting.

@theAkito commented on GitHub (Jul 31, 2019): > > > Yes you can still enter no authentication information and have the repo cloned as normal without any issues, pr, etc from Github just as it was before. > > Just put in the address of the repo and leave username/password blank Please read the OP before commenting.
Author
Owner

@jolheiser commented on GitHub (Jul 31, 2019):

I just successfully cloned a repo on try with no user/pass. I was also able to migrate using my personal instance running 1.9.0
https://try.gitea.io/jolheiser/athens

Can you reproduce on try?

@jolheiser commented on GitHub (Jul 31, 2019): I just successfully cloned a repo on try with no user/pass. I was also able to migrate using my personal instance running `1.9.0` https://try.gitea.io/jolheiser/athens Can you reproduce on try?
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

I just successfully cloned a repo on try with no user/pass.
https://try.gitea.io/jolheiser/athens

Can you reproduce on try?

I do have a very new version of Gitea, but it is not the absolutely newest. Should I update? I did not do it yet, because I didn't think that those couple of days would've already implied a fix.

@theAkito commented on GitHub (Jul 31, 2019): > > > I just successfully cloned a repo on try with no user/pass. > https://try.gitea.io/jolheiser/athens > > Can you reproduce on try? I do have a very new version of Gitea, but it is not the absolutely newest. Should I update? I did not do it yet, because I didn't think that those couple of days would've already implied a fix.
Author
Owner

@mrsdizzie commented on GitHub (Jul 31, 2019):

Can you provide an example of a public Github repo that doesn't work and requires authentication?

@mrsdizzie commented on GitHub (Jul 31, 2019): Can you provide an example of a public Github repo that doesn't work and requires authentication?
Author
Owner

@theAkito commented on GitHub (Jul 31, 2019):

Can you provide an example of a public Github repo that doesn't work and requires authentication?

Ironically, when I wanted to clone the repository I wanted to save it from being deleted or lost, because of controversies regarding this repository. Now, I did not get to migrate the repository because of this Gitea bug and well what do you know, I can't find the repository anymore and it might be lost. What a failure.

@theAkito commented on GitHub (Jul 31, 2019): > > > Can you provide an example of a public Github repo that doesn't work and requires authentication? Ironically, when I wanted to clone the repository I wanted to save it from being deleted or lost, because of controversies regarding this repository. Now, I did not get to migrate the repository because of this Gitea bug and well what do you know, I can't find the repository anymore and it might be lost. What a failure.
Author
Owner

@lunny commented on GitHub (Aug 1, 2019):

Migrating public git repository has been released since gitea forked from gogs and I have used that feature over 200 times. Haven't found that issue.

@lunny commented on GitHub (Aug 1, 2019): Migrating public git repository has been released since gitea forked from gogs and I have used that feature over 200 times. Haven't found that issue.
Author
Owner

@theAkito commented on GitHub (Aug 1, 2019):

Migrating public git repository has been released since gitea forked from gogs and I have used that feature over 200 times. Haven't found that issue.

Same. Until the new feature came in, where you could also migrate issues, etc.

@theAkito commented on GitHub (Aug 1, 2019): > > > Migrating public git repository has been released since gitea forked from gogs and I have used that feature over 200 times. Haven't found that issue. Same. Until the new feature came in, where you could also migrate issues, etc.
Author
Owner

@jolheiser commented on GitHub (Aug 1, 2019):

I created a local build at the specified commit (b84a251) and was able to successfully clone public GitHub repositories with no credentials.

I'm sorry this happened to you, however I don't know where else to look since I cannot reproduce it. If you are able to reproduce it in the future, please let us know so we can track down any potential bug.

@jolheiser commented on GitHub (Aug 1, 2019): I created a local build at the specified commit (b84a251) and was able to successfully clone public GitHub repositories with no credentials. I'm sorry this happened to you, however I don't know where else to look since I cannot reproduce it. If you are able to reproduce it in the future, please let us know so we can track down any potential bug.
Author
Owner

@theAkito commented on GitHub (Aug 1, 2019):

I created a local build at the specified commit (b84a251) and was able to successfully clone public GitHub repositories with no credentials.

I'm sorry this happened to you, however I don't know where else to look since I cannot reproduce it. If you are able to reproduce it in the future, please let us know so we can track down any potential bug.

I found an example:
https://github.com/TakmingMark/Plumble-1.git

Whenever I try to clone this, I get this

Authentication failed: GET https://api.github.com/repos/TakmingMark/Plumble-1: 401 Bad credentials []

I didn't even put in my username or password, at all. I also didn't select to migrate issues or anything like that.

@theAkito commented on GitHub (Aug 1, 2019): > > > I created a local build at the specified commit ([b84a251](https://github.com/go-gitea/gitea/commit/b84a251fca78784682d49e3699eaae51203f8ffd)) and was able to successfully clone public GitHub repositories with no credentials. > > I'm sorry this happened to you, however I don't know where else to look since I cannot reproduce it. If you are able to reproduce it in the future, please let us know so we can track down any potential bug. I found an example: https://github.com/TakmingMark/Plumble-1.git Whenever I try to clone this, I get this ``` Authentication failed: GET https://api.github.com/repos/TakmingMark/Plumble-1: 401 Bad credentials [] ``` I didn't even put in my username or password, at all. I also didn't select to migrate issues or anything like that.
Author
Owner

@jolheiser commented on GitHub (Aug 1, 2019):

Is your browser filling in credentials for some reason?
I can migrate/clone that repo successfully on both try as well as my local build with no credentials.

@jolheiser commented on GitHub (Aug 1, 2019): Is your browser filling in credentials for some reason? I can migrate/clone that repo successfully on both try as well as my local build with no credentials.
Author
Owner

@sapk commented on GitHub (Aug 1, 2019):

How do you run gitea ? Via docker? From your running user ?
I suspect that you may have a global or user git config that may alter the request.

@sapk commented on GitHub (Aug 1, 2019): How do you run gitea ? Via docker? From your running user ? I suspect that you may have a global or user git config that may alter the request.
Author
Owner

@theAkito commented on GitHub (Aug 1, 2019):

Is your browser filling in credentials for some reason?
I can migrate/clone that repo successfully on both try as well as my local build with no credentials.

Well.
I didn't know it even fills in hidden entries. I purposefully never opened it to not even let it think about filling in anything. This seemed to be it. Sorry about all the fuzz.

@theAkito commented on GitHub (Aug 1, 2019): > > > Is your browser filling in credentials for some reason? > I can migrate/clone that repo successfully on both try as well as my local build with no credentials. Well. I didn't know it even fills in hidden entries. I purposefully never opened it to not even let it think about filling in anything. This seemed to be it. Sorry about all the fuzz.
Author
Owner

@mjanssens commented on GitHub (May 1, 2020):

Glad I found this issue, my username was filled in automatically, but the credentials fields weren't visible by default.
Perhaps it would be better to give a regular user more specific feedback about the issue. Feedback is indeed in the log as "401 bad credentials". But in the web interface, the only message is " failed".

@mjanssens commented on GitHub (May 1, 2020): Glad I found this issue, my username was filled in automatically, but the credentials fields weren't visible by default. Perhaps it would be better to give a regular user more specific feedback about the issue. Feedback is indeed in the log as "401 bad credentials". But in the web interface, the only message is " failed".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3700