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 inside of getWebidFromTokenPayload when using node 16 #3004

Open
2 of 5 tasks
elf-pavlik opened this issue Jun 23, 2023 · 1 comment
Open
2 of 5 tasks

Error inside of getWebidFromTokenPayload when using node 16 #3004

elf-pavlik opened this issue Jun 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@elf-pavlik
Copy link

Impacted package

Which packages do you think might be impacted by the bug ?

  • solid-client-authn-browser
  • solid-client-authn-node
  • solid-client-authn-core
  • oidc-client-ext
  • Other (please specify): ...

Bug description

This only happens with node 16, pinning node to 18 solves the problem in our case

To Reproduce

@jeswr it might be a bit complicated, but I'm available for a LiveShare session in (VScode) to show it in the debugger using my local setup.

https://github.com/janeirodigital/sai-js

  1. start CSS in css-storage-fixture package
  2. start redis docker run --name sai-redis -p 6379:6379 -d redis
  3. start the service in service package with yarn debug
  4. attach to the process with the debugger and set to break on exceptions
  5. start the frontend https://github.com/elf-pavlik/sai-impl-web
  6. open http://localhost:4200 and Login into the frontend
  7. click Connect Server to Login into the backend/service

Expected result

Solid-OIDC OP should redirect to the backend

Actual result

The backend is not responding so the redirect is pending

Environment

Please run

npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers

in your project folder and paste the output here:

$ npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers


  System:
    OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 24.33 GB / 31.24 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 16.20.1 - ~/.volta/tools/image/node/16.20.1/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.4 - ~/.volta/tools/image/node/16.20.1/bin/npm
  npmPackages:
    @janeirodigital/sai-api-messages: ^0.10.0 => 0.10.0 
  npmGlobalPackages:
    corepack: 0.17.0
    npm: 8.19.4

Additional information

Looking at the call stack it looks that errors inside of getWebidFromTokenPayload -> fetchJwks in @inrupt/solid-client-authn-core

Exception has occurred: TypeError: ReadableStream.prototype.pipeTo's first argument must be a WritableStream
  at ReadableStream.pipeTo (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/web-streams-ponyfill/dist/polyfill.js:1681:29)
    at ReadableStream.pipeThrough (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/web-streams-ponyfill/dist/polyfill.js:1669:26)
    at fetchFinale (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:973:52)
    at mainFetch (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:773:5)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
pipeTo (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/web-streams-ponyfill/dist/polyfill.js:1681)
pipeThrough (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/web-streams-ponyfill/dist/polyfill.js:1669)
fetchFinale (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:973)
mainFetch (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:773)
processTicksAndRejections (internal/process/task_queues:96)
async function (Unknown Source:0)
fetching (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:517)
fetch (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/lib/fetch/index.js:245)
fetch (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/undici/index.js:107)
fetchJwks (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-core/dist/index.js:71)
getWebidFromTokenPayload (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-core/dist/index.js:85)
handle (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-node/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js:79)
async function (Unknown Source:0)
handle (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-core/dist/index.js:55)
processTicksAndRejections (internal/process/task_queues:96)
async function (Unknown Source:0)
ClientAuthentication.handleIncomingRedirect (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-node/dist/ClientAuthentication.js:57)
Session.handleIncomingRedirect (/home/elf-pavlik/code/solid/sai/sai-js/node_modules/@inrupt/solid-client-authn-node/dist/Session.js:57)
handleAsync (/home/elf-pavlik/code/solid/sai/sai-js/packages/service/src/handlers/login-redirect-handler.ts:28)
processTicksAndRejections (internal/process/task_queues:96)
@elf-pavlik elf-pavlik added the bug Something isn't working label Jun 23, 2023
@jeswr
Copy link
Contributor

jeswr commented Jun 23, 2023

Thanks for reporting - we'll aim to properly delve into this and #3001 next week and let you know if we have any follow up questions then.

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