Skip to content

Client network socket disconnected before secure TLS connection was established #2098

Open
@thomaseizinger

Description

@thomaseizinger

Describe the bug

We've been having repeated CI failures (10+ in the last few days) where the toolkit is unable to fetch the ID token.

To Reproduce

Somewhat difficult to reproduce because it only happens sporadically. I do believe we've only noticed this since we moved to larger (and faster) GitHub-hosted runners. Those seem to be more prone to experience this error but I can't say for certain.

Expected behavior

Reliable CI.

Additional context

We have originally reported this issue in a downstream action. See google-github-actions/auth#496. The troubleshooting there revealed that it is actually an error from the toolkit. Specifically from here:

private static async getCall(id_token_url: string): Promise<string> {
const httpclient = OidcClient.createHttpClient()
const res = await httpclient
.getJson<TokenResponse>(id_token_url)
.catch(error => {
throw new Error(
`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n
Error Message: ${error.message}`
)
})
const id_token = res.result?.value
if (!id_token) {
throw new Error('Response json body do not have ID Token field')
}
return id_token
}

Here are some test-runs where this failure occurred:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions