Skip to content
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

Unable to clone private repo within docker container: unable to find any valid known_hosts file, set SSH_KNOWN_HOSTS env variable #1412

Closed
1 task done
manuel-koch opened this issue Mar 17, 2023 · 1 comment
Labels

Comments

@manuel-koch
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Since installing labours failed ( installing scipy stuff ) on my platform (MacOS 12.6.3 M1) I tried to use the docker image to run hercules.
I want to analyze a private repo on bitbucket, hence I need to provide my SSH key to hercules.
Somehow the clone of the repo fails:

( redacted private information regarding the repo )

$ docker run -v ~/.ssh/id_rsa:/key/id_rsa  --rm srcd/hercules hercules --burndown --pb --ssh-identity /key/id_rsa git@bitbucket.org:<MY_PRIVATE_REPO>.git
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
2023/03/17 12:06:32 failed to open git@bitbucket.org:<MY_PRIVATE_REPO>.git: unable to find any valid known_hosts file, set SSH_KNOWN_HOSTS env variable
panic: failed to open git@bitbucket.org:<MY_PRIVATE_REPO>: unable to find any valid known_hosts file, set SSH_KNOWN_HOSTS env variable

goroutine 1 [running]:
log.Panicf(0x148268a, 0x15, 0xc000139a48, 0x2, 0x2)
	/usr/local/go/src/log/log.go:345 +0xc0
main.loadRepository(0x4000800efd, 0x42, 0x0, 0x0, 0x1, 0x4000800eea, 0x12, 0x370000c000139bb0)
	/root/src/cmd/hercules/root.go:120 +0x4c9
main.glob..func3(0x20cca60, 0xc000bd0550, 0x1, 0x5)
	/root/src/cmd/hercules/root.go:218 +0x2f5
github.com/spf13/cobra.(*Command).execute(0x20cca60, 0xc000032250, 0x5, 0x5, 0x20cca60, 0xc000032250)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x20cca60, 0xc000bce800, 0xc000139f50, 0x839ecf)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
	/root/src/cmd/hercules/root.go:516 +0x31

How can I use hercules to analyze a private repo ?

$ docker image ls | grep hercules
srcd/hercules                                                       latest    5c0c71aebf8c   2 years ago     1.23GB

Found a similar ticket that mentions an updated go-git package that fixes the problem. Maybe the docker image is way out-of-date ( looks like 2 years old ) and may not include the latest hercules build.

Expected Behavior

hercules can analyze a private repo too.

Steps To Reproduce

No response

Environment

- Architecture:
- Fleet Version:
- Cluster:
  - Provider:
  - Options:
  - Kubernetes Version:

Logs

No response

Anything else?

No response

@manuel-koch
Copy link
Author

Oh no - posted the issue for the wrong repo - I'm sorry. Please close this issue.

@manno manno closed this as completed May 9, 2023
@zube zube bot removed the [zube]: Done label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants