Problems upgrading to node 18 for App engine Flex

I attempted to upgrade the app engine from Node 16 to Node 18 for a App engine Flex. I updated the engine's node and npm to 18.12.1 and 8.11.0 in package.json. When I attempt to deploy using gcloud app deploy --stop-previous-version, the deployment fails with

 

 

 

 

node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
error building image: error building stage: waiting for process to exit: exit status 1

 

 

 

 It appears that the version of OS may not be compatible. What can I do to workaround the issue. I have attempted to change to different version of Node 18, but nothing has worked.

0 3 1,546
3 REPLIES 3

Hi @Suhuy,

Welcome to Google Cloud Community!

The error message you are receiving indicates that the version of Node.js you are attempting to deploy is incompatible with the runtime that App Engine Flex is using. This is due to the fact that App Engine Flex employs a customised Linux system with a particular installation of glibc.

You can try the following in order to get around this problem:

  1. Use a different version of Node.js. The latest version of App Engine Flex supports Node.js 16, 17, and 18. Try deploying a version of your app that is using one of these older versions of Node.js.
  2. Use a different runtime. App Engine Flex supports a variety of runtimes, including Node.js, Python, Java, and Go. If you are able to, try switching to a different runtime. For example, you could switch to Python or Go.
  3. Use a different deployment environment. If you need to use Node.js 18, you could try deploying your app to a different environment, such as App Engine Standard or Cloud Run.

Thanks

@Suhuy @christianpaula 

I just wanted to touch on this issue as I experienced a similar situation, and the answer above was less than helpful.

The actual resolution to this issue was to update the app.yaml being used by your flex environment to include specification of an operating system, as per the release notes.

This is also now stated in the documentation for the Node.js runtime documentation for flex environments here: 

Hope this helps someone resolve this issue~!

Thanks for this!

Also to add, for those that are using a custom runtime and extending from "gcr.io/google_appengine/nodejs", it's going to be a bit harder to migrate to Node 18+. Unfortunately, they don't seem to be working on supporting newer NodeJS versions: https://github.com/GoogleCloudPlatform/nodejs-docker/issues/234