Open popey opened 1 month ago
Also fails if you don't specify the tag:
Pulling grype
[19/Jul/2024:16:35:02 +0000] "CONNECT github.com:443 HTTP/1.1" 200 5117245 "-" "git/2.34.1"
Failed to pull source: command ['git', 'clone', '--recursive', 'https://github.com/anchore/grype.git', '/build/snapcraft-grype-b106cde28bf55aa27c4a803831e37e81/parts/grype/src'] exited with code 1.
Make sure sources are correctly specified.
Works if I pull the tarball, as you might expect...
parts:
grype:
plugin: go
source: https://github.com/anchore/grype/archive/refs/tags/v0.79.3.tar.gz
build-snaps:
- go
Log:
Pulling grype
[19/Jul/2024:16:44:53 +0000] "CONNECT github.com:443 HTTP/1.0" 200 7334 "-" "-"
[19/Jul/2024:16:44:53 +0000] "CONNECT codeload.github.com:443 HTTP/1.0" 200 1189336 "-" "-"
Running build phase...
Initializing parts lifecycle
Installing build-packages
Installing build-snaps
Skipping pull for grype (already ran)
Building grype
:: + go mod download all
[19/Jul/2024:16:44:58 +0000] "CONNECT proxy.golang.org:443 HTTP/1.1" 200 11103 "-" "Go-http-client/1.1"
[19/Jul/2024:16:44:58 +0000] "CONNECT proxy.golang.org:443 HTTP/1.1" 200 11103 "-" "Go-http-client/1.1"
[19/Jul/2024:16:44:58 +0000] "CONNECT proxy.golang.org:443 HTTP/1.1" 200 11105 "-" "Go-http-client/1.1"
:: + go install -p 4 ./...
[19/Jul/2024:16:48:07 +0000] "CONNECT proxy.golang.org:443 HTTP/1.1" 200 226596747 "-" "Go-http-client/1.1"
[19/Jul/2024:16:48:07 +0000] "CONNECT sum.golang.org:443 HTTP/1.1" 200 3422023 "-" "Go-http-client/1.1"
[19/Jul/2024:16:48:07 +0000] "CONNECT storage.googleapis.com:443 HTTP/1.1" 200 431837387 "-" "Go-http-client/1.1"
Staging grype
Priming grype
Extracting and updating metadata...
Copying snap assets...
Generating snap metadata...
Generated snap metadata
'--enable-manifest' is deprecated, and will be removed in core24.
Generating snap manifest...
Generated snap manifest
Reading snap metadata...
Running linters...
Running linter: classic
Running linter: library
Lint OK:
- classic: Snap confinement is set to classic.
Lint warnings:
- classic: bin/generate: ELF interpreter should be set to '/snap/core22/current/lib64/ld-linux-x86-64.so.2'. (https://snapcraft.io/docs/linters-classic)
- classic: bin/generate: ELF rpath should be set to '/snap/core22/current/lib/x86_64-linux-gnu'. (https://snapcraft.io/docs/linters-classic)
- classic: bin/grype: ELF interpreter should be set to '/snap/core22/current/lib64/ld-linux-x86-64.so.2'. (https://snapcraft.io/docs/linters-classic)
- classic: bin/grype: ELF rpath should be set to '/snap/core22/current/lib/x86_64-linux-gnu'. (https://snapcraft.io/docs/linters-classic)
Creating snap package...
Created snap package grype_v0.79.3_amd64.snap
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3258.
This message was autogenerated
I've reached out to the Launchpad team about this, as I suspect it's something with launchpad's environment. (maybe being firewalled?) Given the nature of the app I could imagine a very zealous scanner picking up what the code does and shutting it down thinking it's trying to sniff out vulnerabilities in Launchpad, but that's just my uninformed hypothesis
@lengau Thanks Alex. That would be wild, given I am working around this issue by grabbing the binary from the same repo, and can do the same security scans with it. :)
@popey agree, but there definitely seems to be something specific to the Launchpad environment. I've made #821 to get us better error messaging out of git that should help isolate this, but it's a long pipeline unfortunately.
Can you try changing the submodule URL to be accessible via https://
?
Command tries to clone recursively, and it will fail in the environment that does not have SSH keys for GitHub available (such as Launchpad)
https://github.com/anchore/grype/blob/fbdab6e1ecefad6d61a0a2819d97c4ce17d3bf20/.gitmodules#L3
Thanks @dariuszd21 - I've certainly seen this before, and would agree this is likely going to be the quick fix. Thanks!
Bug Description
I am making a prototype of three snaps of syft, grype, and grant. They all use the same yaml, and come from the same org on GitHub. Syft and Grant clone and start building fine. Grype is unable to be cloned.
To Reproduce
Use the yaml below, start a remote build. It will fail.
part yaml
Relevant log output