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

Unable to start DDEV with nodejs_version: 18 (upstream problem, fix with nodejs 16) #4614

Closed
1 task done
davereid-pfg opened this issue Feb 6, 2023 · 22 comments
Closed
1 task done

Comments

@davereid-pfg
Copy link

davereid-pfg commented Feb 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Run a Diagnostic and Paste Link Here

No response

Expected Behavior

For startup to succeed without fail.

Actual Behavior

Preparing to unpack .../nodejs_18.14.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (18.14.0-deb-1nodesource1) ...
Setting up nodejs (18.14.0-deb-1nodesource1) ...
npm ERR! `unsafe-perm` is not a valid npm option
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-02-06T18_20_13_278Z-debug-0.log
ERROR: executor failed running [/bin/sh -c bash /tmp/setup_node.sh && apt-get install nodejs && npm config set unsafe-perm true && npm install --global gulp-cli yarn]: exit code: 1
------
 > [drud/ddev-webserver:v1.21.4-houston-built  9/12] RUN bash /tmp/setup_node.sh && apt-get install nodejs && npm config set unsafe-perm true && npm install --global gulp-cli yarn:

Steps To Reproduce

  • ddev version v1.21.4
  • Macbook M1 - OS X Ventura
  • Github Actions ubuntu-latest - Ubuntu 22.04

In config.yaml:

type: drupal9
docroot: web
php_version: "8.0"
webserver_type: nginx-fpm
database:
  type: mariadb
  version: "10.3"
php_version: 8.1
nodejs_version: 18

Anything else?

This job used to succeed four days ago and started failing three days ago. I can confirm this in GIthub Actions as well as my local machine.

@davereid-pfg davereid-pfg changed the title Unable to start DDEV with node_version: 18 Unable to start DDEV with nodejs_version: 18 Feb 6, 2023
@deviantintegral
Copy link
Collaborator

Strangely I can't reproduce this on my Apple Silicon Mac. One of my coworkers pointed out there's breaking npm changes in the latest nodejs release :(

https://nodejs.org/es/blog/release/v18.14.0/

@davereid-pfg
Copy link
Author

Looks like npm config set unsafe-perm true is only supported on NPM 6: https://docs.npmjs.com/cli/v6/using-npm/config?v=true (NodeJS 14) and is no longer supported on NodeJS 16+ / NPM 7+?

@davereid-pfg
Copy link
Author

davereid-pfg commented Feb 6, 2023

I cannot replicate a failure with npm config set unsafe-perm true on my local NPM 8.19.2 / NodeJS 18.12.1 install on my Mac, this only happens as a failure inside the DDEV container/start.

@davereid-pfg
Copy link
Author

I can confirm that the last Github Action job that passed without error was using:

NodeJS version: v18.13.0
NPM version: 8.19.3

So this does seem to be caused by npm 18.14.0

@davereid-pfg
Copy link
Author

I can replicate it locally now:

> node --version
v18.14.0

> npm config set unsafe-perm true
npm ERR! `unsafe-perm` is not a valid npm option

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/R654600/.npm/_logs/2023-02-06T19_27_37_218Z-debug-0.log

@davereid-pfg
Copy link
Author

Looks like I need to copy the fix from #4610 to the Dockerfile.

@deviantintegral
Copy link
Collaborator

Given that node intentionally added breaking changes in an LTS release, I think ddev should consider pinning the minor version, or at least allowing the minor to be specified in config.yaml.

Normally, I'd also want to report this upstream... but they clearly knew there were breaking changes and released it anyways: nodejs/node#46396

@rfay
Copy link
Member

rfay commented Feb 6, 2023

I'm pretty sure this was already solved in

I hope you'll try HEAD, brew install --HEAD --fetch-head ddev

@deviantintegral
Copy link
Collaborator

@rfay do you expect to roll a new release to fix this soon? If not, that's fine, but then we'll probably invest some time in working on jonaseberle/github-action-setup-ddev#15.

@rfay
Copy link
Member

rfay commented Feb 6, 2023

v1.21.5 is planned to be released on March 5.

Do you think it needs some kind of emergency patch release?

@rfay
Copy link
Member

rfay commented Feb 6, 2023

I think there might be a possible workaround that could be implemented with a Dockerfile.pre.*

@rfay
Copy link
Member

rfay commented Feb 6, 2023

@deviantintegral I'm not even sure that they make packages available for non-current versions, but they may. Many debian package providers don't provide the old ones. We could probably figure out how to move to nvm-only. But wow, this was sure nasty. Thanks for tracking down the issue. I was really annoyed when all the tests broke at once.

@deviantintegral
Copy link
Collaborator

I was just able to replicate on my Mac after wiping my docker images completely - I must have had some dangling docker images I thought I'd removed.

This is certainly broken for node 18. Node 16 works correctly. As far as a hotfix goes, I guess it depends how many users you expect to be on node 18?

@deviantintegral
Copy link
Collaborator

For anyone else searching: The files are pre.Dockerfile.*: https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-dockerfiles-for-webimage-and-dbimage

From our read, because there's no conditional on the line that errors there isn't a way to use that file to fix this.

@rfay
Copy link
Member

rfay commented Feb 6, 2023

I'll take a look this afternoon and see if I can see a workaround.

@deviantintegral
Copy link
Collaborator

It looks like we don't have any hard node 18 dependencies so we can actually downgrade to 16 for now. Given there's only a few in this issue I'm guessing the majority of ddev users are on 16 and not 18.

@rfay rfay pinned this issue Feb 6, 2023
@rfay rfay changed the title Unable to start DDEV with nodejs_version: 18 Unable to start DDEV with nodejs_version: 18 Feb 6, 2023
@rfay
Copy link
Member

rfay commented Feb 6, 2023

I don't see a way to use a .ddev/web-build/pre.Dockerfile.npm and solve this.

So the options I can think of are these, given a release is scheduled for the first Sunday in March, March 6:

  1. People can try to get by with nodejs_version: 16 (or lower) in the meantime. (node 16 is the default version)
  2. People can use the HEAD version of DDEV.
  3. We can do a tiny patch release (on its own branch) just fixing this and ddev get --list is not showing the official add-ons #4608
  4. We can do an edge/prerelease now that includes everything currently on master; this is likely to be low risk.

@rfay
Copy link
Member

rfay commented Feb 6, 2023

Added a 4th option to the possibilities in #4614 (comment)

@rfay rfay changed the title Unable to start DDEV with nodejs_version: 18 Unable to start DDEV with nodejs_version: 18 (upstream problem, fix with nodejs 16) Feb 7, 2023
@davereid-pfg
Copy link
Author

davereid-pfg commented Feb 8, 2023

I'd probably support 3 or 4.

@deviantintegral
Copy link
Collaborator

I've been running HEAD since Monday and it's been fine. I would lean towards towards #4. Make sure that the release notes indicate this is all changes and reflects the upcoming release, and then if you get feedback about bugs you could roll a hotfix only release but you'd have the benefit of the bug reports for the March release.

@gilbertsoft
Copy link
Member

Prerelease fixing this issue is available https://github.com/drud/ddev/releases/tag/v1.21.5-alpha1

@rfay
Copy link
Member

rfay commented Feb 9, 2023

Closing, leaving it pinned. This had already been fixed in #4610

@rfay rfay closed this as completed Feb 9, 2023
@rfay rfay unpinned this issue Mar 6, 2023
agentrickard added a commit to palantirnet/drupal-10-development that referenced this issue Jun 29, 2023
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 a pull request may close this issue.

4 participants