-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docker] git clone via SSH fails #5894
Comments
The |
@fb33 could you post the exact series of Docker commands you are using to do a ORT scan of a public (open source) project. Looking for "steps to reproduce" the issue. |
@fb33 How ( and where ) are you storing the ssh credentials ? Then i do recommend you try on the docker runtime do something similar like this:
This of course is the most basic bind type, you can be more restrict if your environment need, like labeling, selinux, etc.. |
Hi, The implementation is a bit complexe due to the our CI process. ORT usage is drived by a jenkins pipeline in a docker in docker context. 1/ launch ORT container : 2/ connect in container and prepare ssh context : (here some logs)
3/ exec ORT command |
Here:
First -u is unecessary unless you are running with a complete different user |
@heliocastro 👍 |
So, I go a step further.
Ort Git try to clone the project with SSH, but github seems to authorize clone only via https or git cli on "anonymous mode" I've got the same error, if I try to clone the project on my ubuntu via ssh. |
@fb33 Can you please paste the very first lines of ort run ( the ones where the ASCII ORT appears ? I'm pretty sure that ort is running with a complete different user then not finding yours .ssh files |
here are the lines :
|
I think, with my previous version of ORT docker image (build in august), the VCS url was with HTTPS and not with git SSH. |
If was https, and not ssh, and you are behind proxy, that would explain most of everything |
Since 4c57907 ort/utils/ort/src/main/kotlin/Utils.kt Lines 181 to 183 in 4c57907
it should fix my problem ! :) |
Feel free to close this issue then after you were able to verify the fix 😉 |
Hi @sschuberth and @fviernau I think a case is missing in the process to "Stop using the unauthenticated Git protocol in VCS processed" I made a PR : #5951 |
I've commented over there. |
I still get the ssh error in the scanner step for all repositories cloned by ssh. I reproduced it for one sample dependency:
When I change the vcs_processed to
the scan is without the error. I used the docker image of ort updated today. What could be a quick fix in my case to succesfully scan all repositories cloned by ssh? Thank you very much. |
In contrast to HTTP(S), you cannot clone unauthenticated via SSH. That means, you have to provide credentials when cloning via SSH. So, when cloning via SSH from GitHub, you need to have an account on GitHub that you can use and authenticate with. And ideally, the credentials should be provided by an SSH agent; then JSch used by JGit will pick them up. |
Hi! I also had problemes with ssh + auth fail and added a SSH Key for our private repository via the SSH-Agent. While testing i mounted my local ssh-agent into docker: -v $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent This resolved the Auth fail exception (Thanks!) but now i get the following error:
Do you have any idea what causes this error? |
@sschuberth I do not use a custom ORT distribution. I cloned the repository (on 19.10.22) and executed |
@limod despite the ordering in the stacktrace, it seems that |
Sorry for the delay, the |
The paths needs to include "ssh" to match the class's package name. This resolves Caused by: TransportException: ssh://[email protected]/xx/xx.git: remote hung up unexpectedly Caused by: TranslationBundleLoadingException: Loading of translation bundle failed for [org.eclipse.jgit.internal.transport.ssh.jsch.JSchText, en_US] Caused by: MissingResourceException: Can't find bundle for base name org.eclipse.jgit.internal.transport.ssh.jsch.JSchText, locale en_US Also see [1] for reference. [1]: oss-review-toolkit/ort#5894 (comment) Change-Id: Ie27b9fc1cdd1d83f8123821be42e65da59ecf49d Signed-off-by: Sebastian Schuberth <[email protected]>
FYI, this specific issue has been fixed with #6148. |
Hi,
Since I updated the source code from August 19 to September 29 for my docker ort image, I've some troubles during the scan.
Now, when I'm running ORT, I add
-u ort:ort
, but I'm facing with some errors during git clone due to the user.Any idea ?
The text was updated successfully, but these errors were encountered: