Can't import Git project "... is not a valid HTTP Git repository"

I’ve been using GitLab 8.7.4 for a long time now, and am looking to get on the latest release on a new server. Migrating from 8.7.4 appears to be undocumented and involve a million steps, so I decided to try installing fresh and importing all my projects as git projects.

Using the import URL repository feature, I give it the http project reference that the old GitLab gives me “http://172.16.100.18:8888/MyGroup/MyProject.git” (I’ve had to swap in the IP because DNS from here can’t be resolved) and it gives me the error “… is not a valid HTTP Git repository”

I’ve also tried via the API
curl --location --request POST ‘http://localhost/api/v4/projects
–header ‘PRIVATE-TOKEN: n7…’
–header ‘Content-Type: application/json’
–data-raw ‘{“name”:“MyProject”,“import_url”:“http://user:password@172.16.100.18:8888/MyGroup/MyProject.git”}’

and I get the same error.

I can git clone without issue using the same URL on the new server.

If anybody can shed some light on what I may have mistaken that would be much appreciated.

You said that you swapped the DNS for the ipv4 - so I assume that you used the FQDN when importing the project, right? If so, is the FQDN the same for this (new) installation? If yes, then you’ve just been telling the new installation to import the project from itself :stuck_out_tongue:

I didn’t swap the DNS, the new machine has a different FQDN, it just can’t resolve the DNS for the old machine. But nowhere did I use an FQDN. I only used IP to get the old project. This works when i manually run git clone; so unless GitLab flat out refuses to use IPs then I don’t think that’s the issue.

I would try to use PAT instead of username/password combination and also try to call the import_url using curl with verbose to make sure you are not redirected to login page or something.

The custom port might also be a problem and possibly ignored (just a guess).

Okay…
Have you verified that the new machine has access to the old one? Something like nmap -p 80 OLD_ADDR ?
If so, is it possible that the (old) address is not allowed to be accessed because it’s in a private IP range?
I remember configuring that stuff for my instance in Admin Area > Settings > Network > Outbound requests.

Yeah, as I mentioned before I was able to clone the repo fine from the new machine.

In any case we just worked around it by creating a blank project in the new gut lab then pulling and pushing the project from the old one and into the new one.