Problems on Import from private repository using username/password authentication
Summary
When importing a private repository configured to be mirrored, you need to give a username and password for authentication. But the import breaks (not because of a time limit), maybe due to a too strong password containing special chars.
Notes
I looked for other issues here that had the same problem, most notably gitlab-ce#49080. I was also not able to go the the page Setting > Repository as in gitlab-ce#61022 while importing. I don't know if it has something to do with the issue. There seem to be other, maybe related issues as well (like gitlab-ce#51693) but I wasn't sure so I did the bug report.
Steps to reproduce
Assuming a free private repository on gitlab.com:
- Click "New Project"
- Select "Import Project" and use Repo by URL
- Enter the project URL of the private repository using
HTTPS
- Specify the username and password of a user that has access to the private repository
- Check the box "Mirror repository"
- Give it a project name, slug and description whatever you like but set the visibility to private (I don't think it's necessary, but I did it this way)
It opens the Import page saying Import in progress. It displays the command git clone --bare https://*****:*****@gitlab.com/namespace/project
(just normal).
However, if one executes the command locally using the username/password combination, git breaks with the message: fatal: unable to access 'https://username:pass/': Illegal port number
. This is due to the special char |
.
Also, other special chars result in other errors (some saying file not found as with ;
or could not resolve host with :?
).
After around 15 minutes, the importing page breaks with the following message:
The repository could not be imported.
Every import attempt has failed: Error importing repository https://*****:*****@gitlab.com/namespace/source-project into namespace/destination-project - 13:CreateRepositoryFromURL: clone cmd wait: exit status 128. Please try again.
What is the current bug behavior?
The import fails after some minutes displaying an error message. This error message tells you to try it again, but this doesn't fix anything.
What is the expected correct behavior?
The import could break earlier, as there are a lot of attempts to import the project. It should give a better explanation of what happened and (even better) tell you to use SSH keys if available.
Output of checks
This bug happens on GitLab.com