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 Fastly API unresponsiveness Errors on Authentication #1211

Closed

Conversation

marceloboeira
Copy link
Contributor

When Fastly servers are unresponsive (indicated by a 5xx response), the CLI currently shows a cryptic error message due to unexpected values in the response body (e.g., unable to parse body as JSON).

The last incident caused the CLI to display:

ERROR: failed to configure authentication processes: failed to unmarshal OpenID Connect .well-known metadata: invalid character 'I' looking for beginning of value

The 'I' referred to the "Internal Server Error" in the response body, which is unclear/unactionable from a user perspective.

This change introduces a validation to handle this specific scenario:

If the authentication request returns a 5xx status code, it is now recognized as an error. The CLI will display a more actionable message, informing clients that the error is likely due to an outage or incident on the Fastly side. Clients can then check the status page or contact support.

Context:

When Fastly servers are unresponsive (indicated by a 5xx response), the CLI currently shows a cryptic error message due to unexpected values in the response body (e.g., unable to parse body as JSON).

The last incident caused the CLI to display:

> ERROR: failed to configure authentication processes: failed to unmarshal OpenID Connect .well-known metadata: invalid character 'I' looking for beginning of value

The 'I' referred to the "Internal Server Error" in the response body, which is unclear/unactionable from a user perspective.

This change introduces a validation to handle this specific scenario:

If the authentication request returns a 5xx status code, it is now recognized as an error. The CLI will display a more actionable message, informing clients that the error is likely due to an outage or incident on the Fastly side. Clients can then check the status page or contact support.

Context:
* fastly#1210
* https://www.fastlystatus.com/incident/376536
@Integralist Integralist added the enhancement New feature or request label May 22, 2024
pkg/app/run.go Outdated Show resolved Hide resolved
pkg/app/run.go Outdated Show resolved Hide resolved
pkg/app/run.go Outdated Show resolved Hide resolved
@Integralist
Copy link
Collaborator

This will teach me to make edits via the GitHub UI. I'll pull your branch and fix these things up locally 🙂

@Integralist
Copy link
Collaborator

Superseded by #1212

@marceloboeira marceloboeira deleted the handle-server-outages branch May 23, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants