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

Handle non-success error codes in healthcheck #1651

Merged

Conversation

stuartleeks
Copy link
Contributor

PR fixes #1593

What is being addressed

When the App Gateway returns a 502 Bad Gateway response, the body is HTML rather than JSON and we get an error: parse error: Invalid numeric literal at line 1, column 7

How is this addressed

This PR changes the healthcheck to only attempt to parse response as JSON for 200 success responses. This avoids attempting to parse HTML from 502 Bad Gateway responses as JSON.

Only attempt to parse response as JSON for 200 success responses
Avoids attempting to parse HTML from 502 Bad Gateway responses
@stuartleeks
Copy link
Contributor Author

/test

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

@stuartleeks
Copy link
Contributor Author

/test

Previous run got the 502 Bad Gateway which confirmed the PR fixes the error output!
Re-running in the hope that the Bad Gateway is resolved to test the success path

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

@stuartleeks
Copy link
Contributor Author

/test

Previous run got Gateway timeout on registering bundles

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

Set .gitignore in tmp folder (and remove from main gitignore)
Tidy handling of showing output
@stuartleeks
Copy link
Contributor Author

/test

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

@stuartleeks stuartleeks merged commit db5cc7c into microsoft:main Apr 6, 2022
@stuartleeks stuartleeks deleted the sl/handle-healthcheck-gateway-error branch April 6, 2022 08:15
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.

API healthcheck error: parse error: Invalid numeric literal
3 participants