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

Run using node20 (not node16) #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MPV
Copy link

@MPV MPV commented Jul 4, 2024

What

Let's start runs.using: 'node20' in this action.

Why

This action has started failing for us this week, where we're getting errors such as:

TypeError: Cannot read properties of null (reading 'length')
      at getStateLength (/home/runner/_work/_actions/pass-culture-github-actions/gcs-cache/a15865adf837a570fa52671cab4d83baad2aceab/dist/main/index.js:198:27987)
      at shift (/home/runner/_work/_actions/pass-culture-github-actions/gcs-cache/a15865adf837a570fa52671cab4d83baad2aceab/dist/main/index.js:198:27851)
      at Duplexify._forward (/home/runner/_work/_actions/pass-culture-github-actions/gcs-cache/a15865adf837a570fa52671cab4d83baad2aceab/dist/main/index.js:177:11566)
      at PassThrough.onreadable (/home/runner/_work/_actions/pass-culture-github-actions/gcs-cache/a15865adf837a570fa52671cab4d83baad2aceab/dist/main/index.js:177:10980)
      at PassThrough.emit (node:events:519:28)
      at emitReadable_ (node:internal/streams/readable:832:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
  Node.js v20.13.1

We also get this warning:

The following actions uses Node.js version which is deprecated and will be forced to run on node20: pass-culture-github-actions/gcs-cache@v1.0.0 For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/

...where they say:

Following on from our warning in workflows using Node16 we will start enforcing the use of Node20 rather than Node16 on the 3rd of June.

To avoid the warning:
`The following actions uses Node.js version which is deprecated and will be forced to run on node20: `pass-culture-github-actions/gcs-cache@v1.0.0`

As per:
https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/

Where they say:
>Following on from our warning in workflows using Node16 we will start enforcing the use of Node20 rather than Node16 on the 3rd of June.
@MPV
Copy link
Author

MPV commented Jul 4, 2024

@kopax could you take a look? 🙏

@MPV
Copy link
Author

MPV commented Jul 4, 2024

It seems this change doesn't fix the problem (it's just what happens automatically behind the scenes inside the runners, that they automatically pick node20 over node16 nowadays).

There is a workaround available for now, setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true at the workflow level (sadly not at the step/action level).

Would you be up for looking into why this action doesn't work on NodeJS 20?

I have tried merging the equivalent PR of this (and using my own fork), but the result is still the error above:

@MPV
Copy link
Author

MPV commented Jul 4, 2024

By adding source maps...

...I was able to get a clearer error / stack trace:

  /home/runner/_work/_actions/pagero/gcs-cache/4857aab4515c00e04051f4da50c145f2a1d11019/dist/webpack:/gcs-cache/node_modules/stream-shift/index.js:16
      return state.buffer[0].length
  ^
  TypeError: Cannot read properties of null (reading 'length')
      at getStateLength (/home/runner/_work/_actions/pagero/gcs-cache/4857aab4515c00e04051f4da50c145f2a1d11019/dist/webpack:/gcs-cache/node_modules/stream-shift/index.js:16:1)
      at shift (/home/runner/_work/_actions/pagero/gcs-cache/4857aab4515c00e04051f4da50c145f2a1d11019/dist/webpack:/gcs-cache/node_modules/stream-shift/index.js:6:1)
      at Duplexify._forward (/home/runner/_work/_actions/pagero/gcs-cache/4857aab4515c00e04051f4da50c145f2a1d11019/dist/webpack:/gcs-cache/node_modules/duplexify/index.js:170:1)
      at PassThrough.onreadable (/home/runner/_work/_actions/pagero/gcs-cache/4857aab4515c00e04051f4da50c145f2a1d11019/dist/webpack:/gcs-cache/node_modules/duplexify/index.js:136:1)
      at PassThrough.emit (node:events:519:28)
      at emitReadable_ (node:internal/streams/readable:832:12)
      at processTicksAndRejections (node:internal/process/task_queues:81:21)

@MPV
Copy link
Author

MPV commented Jul 4, 2024

@MPV
Copy link
Author

MPV commented Jul 4, 2024

Here's a separate PR trying to make that specific change:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant