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

fix: Ignore HTTP store client errors trying to get content length #2874

Merged
merged 17 commits into from
Apr 12, 2024

Conversation

vrongmeal
Copy link
Contributor

The HEAD method might not be supported. Ignore client side errors and assume we have 0 content length.

Fixes: #2828

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
@vrongmeal vrongmeal requested review from tychoish and talagluck April 10, 2024 10:08
@vrongmeal vrongmeal changed the title fix(HTTP): Ignore client errors when trying to get content length fix: Ignore HTTP store client errors when trying to get content length Apr 10, 2024
@vrongmeal vrongmeal changed the title fix: Ignore HTTP store client errors when trying to get content length fix: Ignore HTTP store client errors trying to get content length Apr 10, 2024
Copy link
Contributor

@tychoish tychoish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

Comment on lines 340 to 341
"{err}\n\
Note that globbing is not supported for HTTP.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid newlines in errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is usually very long. Moreover, we just want to append a "note" here for the user (easier to read).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I think it's fine.

If it's very long it's going to wrap anyway and adding our own new line character isn't going to actually be a great place in all cases.

My concern is that it's going to end up in log messages with a new line that's going to be hard to read and maybe hard to parse.

I'd also change it to put the summary at the beginning: HTTP sources do not support globbing: {err}

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
@vrongmeal
Copy link
Contributor Author

A test fails with a less precise error, should we just let it be for now. There isn't a better work around to improve the error message...

@talagluck
Copy link
Contributor

It looks like we're removing tests here - are there any tests we could add?

The `HEAD` method might not be supported. Ignore client side errors and
assume we have `0` content length.

Fixes: #2828

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
Signed-off-by: Vaibhav <vrongmeal@gmail.com>
@vrongmeal vrongmeal force-pushed the vrongmeal/http-fix branch from 70fcffe to 82a198e Compare April 11, 2024 13:13
@vrongmeal
Copy link
Contributor Author

It looks like we're removing tests here - are there any tests we could add?

So, to make most of the things work, we had to do a bit of hacky stuff which messes up the error messages. So the tests removed are simply not checking some particular error messages (related to HTTP). We still have the same tests below checking another error message so our coverage is still the same.

@vrongmeal vrongmeal enabled auto-merge (squash) April 12, 2024 06:48
@vrongmeal vrongmeal merged commit fd6303f into main Apr 12, 2024
27 checks passed
@vrongmeal vrongmeal deleted the vrongmeal/http-fix branch April 12, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: unexpected handling of http 400 error
4 participants