go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.62k stars 5.45k forks source link

"404 failed to parse unknown error format" when migrating from private gitlab to gitea #21493

Open martijnschouten opened 2 years ago

martijnschouten commented 2 years ago

Description

I'm trying to migrate a private git from the GitLab server from work. I made a personal access token, copied the https link from the repository and filled both in into the migration page. When I click migrate repository I get:

Migrating from https://git.ram.eemcs.utwente.nl/schoutenm/analyse-mfeit.git failed.

When I look in the logs of my app I see:

...ervices/task/task.go:56:handle() [E] Run task failed: GET https://git.ram.eemcs.utwente.nl/api/v4/projects/schoutenm/analyse-mfeit: 404 failed to parse unknown error format

If I migrate a private git from github with an access code everything goes fine.

Gitea Version

1.17.2_9.0.22

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://github.com/go-gitea/gitea/files/9804253/gitea_gitea-56745bbc6b-pzxjp_gitea.1.zip

Screenshots

No response

Git Version

not sure

Operating System

truenas scale (debian+docker)

How are you running Gitea?

I installed Gitea on Truenas Scale from the TrueCharts catalog. For the time being I'm running the server behind a nat (access it using a internal IP address and port number). I added this IP address and port number as a custom configuration parameter as server.root_url

Database

No response

techknowlogick commented 2 years ago

Which version of Gitlab is your remote using?

martijnschouten commented 2 years ago

It is using GitLab Enterprise Edition 15.4.2-ee

martijnschouten commented 2 years ago

I now clicked on git instead of gitlab in the migrate options. If I then fill in the https link, my account name and my access code it does work.

techknowlogick commented 2 years ago

Thanks for those details and update <3

I'll suggest this is left open in case Gitlab 15 changes anything with their API in terms of us importing.

x45dev commented 11 months ago

Same problem for Gitlab 16.2+

zadjadr commented 2 months ago

Using the read_api (instead of read_repository) fixed it for me on 17.2

lunny commented 2 months ago

Using the read_api (instead of read_repository) fixed it for me on 17.2

How did you change to read_api?

zadjadr commented 2 months ago

Using the read_api (instead of read_repository) fixed it for me on 17.2

How did you change to read_api?

During gitlab token creation, you need to choose the read_api scope:

https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#personal-access-token-scopes