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

Improve error message when bundle server doesn't serve a bundle #4278

Closed
anderseknert opened this issue Jan 25, 2022 · 2 comments · Fixed by #4432
Closed

Improve error message when bundle server doesn't serve a bundle #4278

anderseknert opened this issue Jan 25, 2022 · 2 comments · Fixed by #4432

Comments

@anderseknert
Copy link
Member

When pointing OPA to fetch bundles from an endpoint that doesn't serve bundles (likely due to typo or misconfiguration in the remote), the error message looks like this:

{"level":"error","msg":"Bundle load failed: bundle read failed: archive read failed: gzip: invalid header","name":"authz","plugin":"bundle","time":"2022-01-25T06:28:49Z"}

This has led many users to believe there is something wrong with the bundle packaging itself, leading them to debug the bundle creation process, when the real problem is that the remote doesn't serve the bundle in the first place.

It would be good if we printed this error message only when a broken bundle was served. If we can't differentiate, we might want to print just something like "no bundle found at remote or invalid bundle format".

@stale
Copy link

stale bot commented Feb 24, 2022

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Feb 24, 2022
@anderseknert
Copy link
Member Author

I think we can improve the error message by looking at the Content-Type response header. If it isn't application/octet-stream (as a tarball is just binary data) but something like text/html, we can print a more informative message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant