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

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

Closed
marceloboeira opened this issue May 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@marceloboeira
Copy link
Contributor

marceloboeira commented May 21, 2024

Version

Fastly CLI version v10.8.0 (8b3c0372)
Built with go version go1.21.5 linux/amd64 (2024-05-21)
Viceroy version: viceroy 0.9.3

A new version of the Fastly CLI is available.
Current version: 10.8.0

What happened

We have a pipeline, that hasn't changed in a while, with this command:

fastly compute publish --verbose

It normally publishes the application to compute @ edge, now it started failing with:

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

Note: It seems to be related to https://www.fastlystatus.com/incident/376536, I'm guessing the invalid character 'I' looking for beginning of value is for Internal Server Error but thought of reporting it here should other people face it too.

@marceloboeira marceloboeira added the bug Something isn't working label May 21, 2024
@Integralist
Copy link
Collaborator

Integralist commented May 21, 2024

Hi @marceloboeira

You're correct, there was an incident that appears to have caused an issue with the OICD endpoint used by the CLI (I myself just ran into this). The endpoint is back up already but I'll leave this issue open for now until I get a confirmation that the underlying issue is confirmed resolved.

Thanks!

@marceloboeira
Copy link
Contributor Author

marceloboeira commented May 22, 2024

@Integralist looking good now, thanks!

I'm wondering if that's an opportunity to catch that type of error and improve the message (e.g.: if a 5xx is returned then switch the message to "An unexpected authentication error occurred, check http://fastlystatus.com for any possible incidents" and then some debug details (e.g.: statuscode/body)).

Happy to work on an MR for that if the behaviour is desired.

In any case, I'll close this issue since the original problem is resolved.

@Integralist
Copy link
Collaborator

Hi @marceloboeira

I'm wondering if that's an opportunity to catch that type of error and improve the message
Happy to work on an MR for that if the behaviour is desired.

Yes please! That would be very much appreciated 🙂 🙇🏻

marceloboeira added a commit to marceloboeira/fastly-cli that referenced this issue May 22, 2024
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
marceloboeira added a commit to marceloboeira/fastly-cli that referenced this issue May 22, 2024
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 added a commit that referenced this issue May 22, 2024
…ve (#1212)

* Handle Fastly API unresponsiveness Errors on Authentication

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:
* #1210
* https://www.fastlystatus.com/incident/376536

* fix(app): use %d for int type

* fix(app): read body for use in error response

* refactor(app): use http constant

* fix(app): write valid code

---------

Co-authored-by: Marcelo Boeira <marcelo@boeira.me>
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

No branches or pull requests

2 participants