`core.getIDToken` discards the original error, so callers cannot tell a network failure from an HTTP error
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- backend-api-design
Research direction
Find the implementation of core.getIDToken in the toolkit and read the error handling around the failed token request. Check how its tests cover network failures and HTTP errors, then run the relevant tests. Done means the thrown error retains the original error as cause, preserving fields such as code and statusCode.
Written by the indexing model from the issue text.
Description
What happened?
core.getIDToken sometimes fails because of a transient network error, for
example socket hang up or a TLS disconnect (see #2098 and #1441). An action
that calls getIDToken should be able to retry those failures and fail fast on
a real HTTP error, such as a 403.
The action cannot do that. getIDToken throws a new Error that holds only a
formatted message. The original error is not attached as cause, and the
thrown error has no code or statusCode. The only way to tell a dropped
connection from a 403 is to parse the message text.
Example
A local server stands in for ACTIONS_ID_TOKEN_REQUEST_URL. In one case it
destroys the socket. In the other case it returns 403. With @actions/core
3.0.1:
try { await core.getIDToken('aud') }
catch (e) { console.log({ message: e.message, cause: e.cause, code: e.code, statusCode: e.statusCode }) }
== socket destroyed
{ message: 'Error message: Failed to get ID Token. \n \n Error Code : undefined\n \n Error Message: socket hang up',
cause: undefined, code: undefined, statusCode: undefined }
== HTTP 403
{ message: 'Error message: Failed to get ID Token. \n \n Error Code : 403\n \n Error Message: forbidden',
cause: undefined, code: undefined, statusCode: undefined }
Expected: The thrown error keeps the original error as cause, so a caller
can read cause.code (ECONNRESET) or cause.statusCode (403).
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/toolkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
@actions/io: `mv(file, dest)` replaces `dest` when it is a symlink to a directory instead of moving into itPossibly taken @bardrop claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
@actions/exec: `exec(commandLine)` drops `""` arguments and trims trailing spaces of the last argumentPossibly taken @bardrop claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
@actions/cache: downloadCacheHttpClientConcurrent never stops its progress timer on failure, so the step hangs until the job times outPossibly taken @YodHeVauHe claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
device-management-toolkit/sample-web-ui#3711 ·
Maintainers usually reply within 1 day
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/kibana#306401 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentes-chat/agentes-chat#927 ·
Maintainers usually reply within 1 day
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabPossibly taken @seenimohamed claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ardia-browser/ardia#2769 ·
Maintainers usually reply within 1 day