-
Looks like your Gitea base url is incorrect and Gitea returns repository clone url incorrectly.
-
Re-read my issue and it seems that I mistyped the port number in my report. Gitea is in fact running on port 8081 (corrected it). 😮
Investigated a bit further and if I change the settings for my organization "mango-internal" in gitea so the visibility is public, the import works fine. The problem seems to be when my organization is set to be "private" (and thus, checking out the repository requires a login).
-
Just tested with OneDev and Gitea running on docker and import can run successfully. Please check if http clone url of the repository is "http://mango-services:8081/mango-internal/buildbot.git" at Gitea side. Also please run below from command from within OneDev's container to see if it works:
git clone http://git:<gitea access token>mango-services:8081/mango-internal/buildbot.git -
Hi again,
Cloning from the onedev container using the access token seems to work. I'm half wondering here if either gitea or onedev isn't providing the access token correctly when cloning in this circumstance.
I've reproduced the issue in a test setup, as follows:
- gitea hosted at http://mango-test:3001 (with docker)
- onedev hosted at http://mango-test:6610 (with docker, can also access docker host via mango-test)
- gitea has organizations "org1" and "org2" with respective projects "org1/repo1" and "org2/repo2"
- "org2" is set to be private
I can't seem to reproduce the "git needs input before the web dialog completes" behavior using the docker containers, though it could be something weird going on with my other standalone setup.
A test environment can be grabbed from here: https://1drv.ms/u/s!AoBL85OZXmkc9CCjWFei_DMYbLul?e=PusXx5
Which can be started on a system with docker installed by running:
tar -xzpf containers.tar.gz cd containers ./launch_gitea.sh <server ip address for mango-test>If I use the following details to import from gitea (with username=mango, password=password):
url: http://mango-test:3001/api/v1 token: 0103e4e7a68ef908cdbc72885c8456155a27b4fb3 different scenarios can occur when going through the Import wizard...
- Importing org1/repo1 and org2/repo2 at the same time
The following is reported in the dialog:
Please wait... Cloning code from repository org1/repo1... Cloning code from repository org2/repo2... Failed to run command: git clone --mirror http://mango-test:3001/org2/repo2.git ., return code: 128 Cloning into bare repository '.'... fatal: could not read Username for 'http://mango-test:3001': No such device or addressNo projects are generated in onedev.
- Importing org1/repo1
repo1 is successfully imported into onedev.
- Importing org2/repo2
The following is reported in the dialog:
Please wait... Cloning code from repository org2/repo2... Failed to run command: git clone --mirror http://mango-test:3001/org2/repo2.git ., return code: 128 Cloning into bare repository '.'... fatal: could not read Username for 'http://mango-test:3001': No such device or addressNo projects are generated in onedev.
For now, I seem to be able to workaround the issue by making everything public on my gitea instance before importing, but this might not be a desirable option for someone operating in some form of public cloud environment.
Thanks for your assistance so far!
-
Thanks for the info. Turns out that a public repo inside a private org still needs access token for clone. Will fix that in next patch release.
-
OneDev
changed state to 'Closed' 3 years ago
Previous Value Current Value Open
Closed
-
OneDev
changed state to 'Released' 3 years ago
Previous Value Current Value Closed
Released
-
State changed as build #2856 is successful
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
Not Found
|
Setup:
Started import via Projects -> Import -> From Gitea.
When running Import, the dialog reports:
Curiously in my server console for onedev I get this printed:
If I press enter on the console the import dialog then changes to:
If I manually import http://mango-services:8081/mango-internal/buildbot.git using "Import -> From URL" and specify my username and password for gitea, there are no problems.
I would guess based on the behavior I'm seeing that onedev doesn't seem to be handling git authentication correctly in the case of importing projects from gitea.