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

Most upvoted comments

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 .netrc support 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 .netrc support 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.

do you mean that writing a .netrc should work out of the box?

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.