[GH-ISSUE #754] TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer #3550

Closed
opened 2026-04-20 07:32:56 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @SamuelBoerlin on GitHub (May 20, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/754

Hi

While setting up OAuth2/OIDC I ran into the following issue:

Connecting to IdP
Validating your identity

There was a problem connecting to IdP. Please contact your administrator.
An error occurred

along with the following error log

2025-05-20T20:09:39.610Z [error]: Failed to send request
Stack: Error: Failed to send request
    at sendTokenRequest (file:///app/node_modules/arctic/dist/request.js:76:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.validateAuthorizationCode (file:///app/node_modules/arctic/dist/client.js:71:24)
    at async gg (file:///app/dist/server.mjs:31:139872)

and after adding some debug console logging

TypeError: fetch failed
    at async gg (server/routers/idp/validateOidcCallback.ts:164:23)
  162 |         }
  163 |
> 164 |         const tokens = await client.validateAuthorizationCode(
      |                       ^
  165 |             ensureTrailingSlash(existingIdp.idpOidcConfig.tokenUrl),
  166 |             code,
  167 |             codeVerifier {
  [cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer
      at ArrayBuffer.slice (<anonymous>)

I ended up tracking this down to this request in arctic: https://github.com/pilcrowonpaper/arctic/blob/main/src/request.ts#L14-L18

All works fine if I replace that in /app/node_modules/arctic/dist/request.js with

const request = new Request(endpoint, {
    method: "POST",
    body: body.toString()
});

I will shortly open a PR in the arctic repo and hope it can be integrated here soon if it is accepted.

Using fosrl/pangolin:1.4.0

Originally created by @SamuelBoerlin on GitHub (May 20, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/754 Hi While setting up OAuth2/OIDC I ran into the following issue: ``` Connecting to IdP Validating your identity There was a problem connecting to IdP. Please contact your administrator. An error occurred ``` along with the following error log ``` 2025-05-20T20:09:39.610Z [error]: Failed to send request Stack: Error: Failed to send request at sendTokenRequest (file:///app/node_modules/arctic/dist/request.js:76:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async OAuth2Client.validateAuthorizationCode (file:///app/node_modules/arctic/dist/client.js:71:24) at async gg (file:///app/dist/server.mjs:31:139872) ``` and after adding some debug console logging ``` TypeError: fetch failed at async gg (server/routers/idp/validateOidcCallback.ts:164:23) 162 | } 163 | > 164 | const tokens = await client.validateAuthorizationCode( | ^ 165 | ensureTrailingSlash(existingIdp.idpOidcConfig.tokenUrl), 166 | code, 167 | codeVerifier { [cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer at ArrayBuffer.slice (<anonymous>) ``` I ended up tracking this down to this request in arctic: https://github.com/pilcrowonpaper/arctic/blob/main/src/request.ts#L14-L18 All works fine if I replace that in `/app/node_modules/arctic/dist/request.js` with ``` const request = new Request(endpoint, { method: "POST", body: body.toString() }); ``` I will shortly open a PR in the arctic repo and hope it can be integrated here soon if it is accepted. Using fosrl/pangolin:1.4.0
GiteaMirror added the stale label 2026-04-20 07:32:56 -05:00
Author
Owner

@SamuelBoerlin commented on GitHub (May 20, 2025):

https://github.com/pilcrowonpaper/arctic/pull/308

<!-- gh-comment-id:2895771960 --> @SamuelBoerlin commented on GitHub (May 20, 2025): https://github.com/pilcrowonpaper/arctic/pull/308
Author
Owner

@miloschwartz commented on GitHub (May 22, 2025):

Thanks for spotting this.

<!-- gh-comment-id:2899861738 --> @miloschwartz commented on GitHub (May 22, 2025): Thanks for spotting this.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 6, 2025):

This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.

<!-- gh-comment-id:2947244066 --> @github-actions[bot] commented on GitHub (Jun 6, 2025): This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 20, 2025):

This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.

<!-- gh-comment-id:2989472993 --> @github-actions[bot] commented on GitHub (Jun 20, 2025): This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#3550