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

Incomplete artifactory uploads cause the marketplace to crash #68

Closed
janLo opened this issue Oct 29, 2024 · 1 comment · Fixed by #69
Closed

Incomplete artifactory uploads cause the marketplace to crash #68

janLo opened this issue Oct 29, 2024 · 1 comment · Fixed by #69
Labels
bug Something isn't working

Comments

@janLo
Copy link
Contributor

janLo commented Oct 29, 2024

If there is an incomplete upload to Artifactory, meaning, the folder structure down to the version is there, but the actual manifest is missing, I get the following crash:

2024-10-29 11:37:11.497 [erro]  Unable to read extension manifest  error="file does not exist"  id=golang.Go@0.42.1  targetPlatform=""
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7e184d]

goroutine 494 [running]:
github.com/coder/code-marketplace/storage.NewArtifactoryStorage.func1.1()
        /home/losinski/devel/code-marketplace/storage/artifactory.go:97 +0x2d
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/losinski/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/losinski/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0xa5

I ended up with this using our extension mirror which used the upstream extensionquery endpoint for metadata which gave for the Golang extension golang.Go while the actual manifest that is used by the marketplace for the metadata states golang.go. This meant we put the signature file in golang/Go/0.42.1 instead of golang/go/0.42.1 where the code-marketplace put the manifest.

As I totally understand that there is nothing code-marketplace can do about the incomplete hierarchy (and we've fixed the metadata on our side since), I think it should not crash.

I'll try to come up with a PR to ignore incomplete directories.

@coder-labeler coder-labeler bot added the bug Something isn't working label Oct 29, 2024
janLo added a commit to janLo/code-marketplace that referenced this issue Oct 29, 2024
This ignores extensions where the manifest download from
artifactory failed instead of crashing the process with a
segfault.

It fixes coder#68
@code-asher
Copy link
Member

Good catch!

janLo added a commit to janLo/code-marketplace that referenced this issue Oct 30, 2024
This ignores extensions where the manifest download from
artifactory failed instead of crashing the process with a
segfault.

It fixes coder#68
code-asher pushed a commit that referenced this issue Oct 30, 2024
This ignores extensions where the manifest download from
artifactory failed instead of crashing the process with a
segfault.

It fixes #68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants