ort: Git HTTPS authentication error
ORT has trouble accessing password-protected GIT repository This surprises me as I think it used to work fine.
I have configured .git-credentials to store the username/password, and it works well when running git clone manually.
But when run via Gradle, I run in this error Authentication is required but no CredentialsProvider has been registered.
I found this issue in Gradle, about non-working authentication, but for Git protocol
17:40:56.526 [ScanCode-1] INFO kotlinx.coroutines.CoroutineScope - No stored results found, scanning package Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05 in thread 'ScanCode-1' (1/1).
17:40:56.527 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.Downloader - Trying to download source code for 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05'.
17:40:56.529 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.Downloader - Trying to download 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05' sources to '/data/ort-home/download/_project_ScanCode_20200505_174051/Unmanaged/unknown/POC/4213d9ba0ecb5ef96f080e233945751443cb6b05' from VCS...
17:40:56.529 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.Downloader - Using processed VcsInfo(type=Git, url=https://<git-url>, revision=4213d9ba0ecb5ef96f080e233945751443cb6b05, resolvedRevision=null, path=). Original was VcsInfo(type=, url=, revision=, resolvedRevision=null, path=).
17:40:56.771 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.Downloader - Detected VCS type 'Git' from type name 'Git'.
17:40:56.976 [ScanCode-1] INFO org.ossreviewtoolkit.utils.ProcessCapture - Running 'git --version' in '/opt/ORT/oss-review-toolkit'...
17:40:57.552 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.VersionControlSystem - Meta-data has invalid Git revision '4213d9ba0ecb5ef96f080e233945751443cb6b05': IOException: Unable to list the remote branches.
Caused by: TransportException: https://<git-url>: Authentication is required but no CredentialsProvider has been registered
Caused by: TransportException: https://<git-url>: Authentication is required but no CredentialsProvider has been registered
17:40:57.577 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.VersionControlSystem - No Git revision for version '4213d9ba0ecb5ef96f080e233945751443cb6b05' found: IOException: Unable to list the remote tags.
Caused by: TransportException: https://<git-url>: Authentication is required but no CredentialsProvider has been registered
Caused by: TransportException: https://<git-url>: Authentication is required but no CredentialsProvider has been registered
17:40:57.581 [ScanCode-1] INFO org.ossreviewtoolkit.downloader.Downloader - Trying to download source artifact for 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05' from ...
17:40:57.584 [ScanCode-1] ERROR java.lang.Object - Could not download 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05': DownloadException: Download failed for 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05'.
Suppressed: DownloadException: Unable to determine a revision to checkout.,
Suppressed: DownloadException: No source artifact URL provided for 'Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05'.
17:40:57.584 [ScanCode-1] INFO kotlinx.coroutines.CoroutineScope - Finished scanning Unmanaged::POC:4213d9ba0ecb5ef96f080e233945751443cb6b05 (1/1).
17:40:57.587 [main] INFO org.ossreviewtoolkit.model.OrtResult - Computing excluded projects which may take a while...
17:40:57.589 [main] INFO org.ossreviewtoolkit.model.OrtResult - Computing excluded projects done.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- utils: Add password authentication for (non-proxy) servers For now, only support authentication stored in .netrc files [1] in plain text as that is also support by the Git CLI which still gets called... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- utils: Add password authentication for (non-proxy) servers For now, only support authentication stored in .netrc files [1] in plain text as that is also support by the Git CLI which still gets called... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- utils: Add password authentication for (non-proxy) servers For now, only support authentication stored in .netrc files [1] in plain text as that is also supported by the Git CLI which still gets call... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
And by the way, sorry for not getting back on this, but it works for me too š
Hi Exactly the same came to my mind last night š I copied to $HOME/.netrc and that worked !!! Thank you Sebastien
@NicolasToussaint thanks for you input. I somewhat āhadā to still go for
.netrcsupport as weāre still calling Git CLI in addition to using JGit, and Git CLI already supports.netrc, so that was the āsmallest common denomiatorā.If you can spend some time, Iād appreciate if you could give the
.netrcsupport in my http-auth branch a try.Actually, it does not really matters, but since you ask (thanks!), I would have a slight preference for using the ORT configuration file (so itās all in the same place).
But any way is fine, really.
Thatās what I thought. But it looks like JGit only uses its NetRCCredentialsProvider when using the JGit CLI (aka
jgit.pgm), not when using the JGit API šHere is some background info.