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.12k stars 5.41k forks source link

Migration from self hosted gitlab does not work with project name in URL #13269

Open pboguslawski opened 3 years ago

pboguslawski commented 3 years ago

Migration from self hosted gitlab-ce (checked many different versions with api v4: 9.x, 10.x, 11.x, 12.x and finally 13.3.7) to gitea v1.13 does not work if source repository URL contains project namespace + name like

https://my.gitlab.domain/me/myproject.git https://my.gitlab.domain/me/myproject

Gitea throws error:

modules/task/task.go:51:handle() [E] Run task failed: GET https://my.gitlab.domain/api/v4/projects/me/myproject: 404 failed to parse unknown error format

Opening this URL in web browser returns

{"error":"404 Not Found"}

URL-s that work in web browser:

Tested that migration from such gitlab to gitea works when source URL is specified with repo ID not name like this:

https://my.gitlab.domain/10

Please verify and fix or (if using ID is required) update instruction in UI for users to know what to enter as URL.

c-4-m commented 3 years ago

I'm also having problems with mirroring from a self-hosted gitLab instance. However using the ID does not work for me. Have you tested the ID method with private repos?

pboguslawski commented 3 years ago

Have you tested the ID method with private repos?

As far as I remember there were internal repos also (limited access for logged in users with repo permissions assigned) but all were from "organization" namespaces (which user had permissions to) not user private namespace. Unfortunatelly no source gitlab available to test it.

6543 commented 3 years ago

I tested a gitlab migration and it worked on my side ... (v1.14.0-dev 7d2700c8be5da8f2073a576dae209ae07ac6ed22)

6543 commented 3 years ago

same issue happend here: https://github.com/go-gitea/gitea/pull/13646#issuecomment-731973386

I think in this case it's not gitea's fault, since the migrator relay on a working api on the gitlab side ...

rekcah1986 commented 3 years ago

image image

lennyluosz commented 2 weeks ago

after 4 years, the issue is still there when I am using Gitlab CE v17.3 . Also, I checked gitlab API document as following https://docs.gitlab.com/ee/api/projects.html#get-single-project it seems that Gitlab don't have api like https://gitlab.server.domain/api/v4/projects/group-name/project-name , and it has only api like https://gitlab.server.domain/api/v4/projects/:id