Describe the bug
Deploys for NextJS backends are failing due to the recent version update in the NextJS apphosting adapter.
After combing through the logs for my last successful deploy and the first failing deploy, I noticed that the only difference was that the @apphosting/adapter-nextjs version was bumped up to version 14.0.5 in the failing case. I believe this is the cause of the issues. All of my failing deploy install and try to run 14.0.5.
Those two deploys were just over an hour apart and the only change between the two commits a text change, so it would not affect deploys.
Additional context
How are you using GCP buildpacks?
Did this used to work?
Yes, it used to work.
The last working deploy and first failing deploy were 1hr and 10mins apart, with no breaking code changes.
What language is your project primarily written in?
Node.js
Steps To Reproduce
Steps to reproduce the behavior:
- Anything that triggers a deploy
Expected behavior
The app to deploy.
Actual behavior
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
Success Log Snippet
2024-07-25 01:44:14.143 EDT
Step #2: === Node.js - Firebasenextjs (google.nodejs.firebasenextjs@0.0.1) ===
2024-07-25 01:44:14.145 EDT
Step #2: WARNING: *** You are using a custom build command (your build command is NOT 'next build'), we will accept it as is but will error if output structure is not as expected ***
2024-07-25 01:44:14.145 EDT
Step #2: ***** CACHE MISS: "npm_modules"
2024-07-25 01:44:14.146 EDT
Step #2: Installing nextjs adaptor 14.0.4
2024-07-25 01:44:16.869 EDT
Step #2: === Node.js - Yarn (google.nodejs.yarn@2.1.0) ===
2024-07-25 01:44:16.869 EDT
Step #2: 2024/07/25 05:44:16 [DEBUG] GET https://registry.npmjs.org/yarn
2024-07-25 01:44:16.973 EDT
Step #2: ***** CACHE MISS: "yarn_engine"
2024-07-25 01:44:16.974 EDT
Step #2: Installing Yarn v1.22.22
2024-07-25 01:44:16.974 EDT
Step #2: 2024/07/25 05:44:16 [DEBUG] GET https://yarnpkg.com/downloads/1.22.22/yarn-v1.22.22.tar.gz
2024-07-25 01:44:17.534 EDT
Step #2: Setting environment variable PATH=/layers/google.nodejs.yarn/yarn_engine/bin:/layers/google.nodejs.runtime/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2024-07-25 01:44:17.552 EDT
Step #2: ***** CACHE MISS: "yarn_modules"
2024-07-25 01:44:17.553 EDT
Step #2: --------------------------------------------------------------------------------
2024-07-25 01:44:17.553 EDT
Step #2: Running "yarn install --non-interactive --prefer-offline --modules-folder=/layers/google.nodejs.yarn/yarn_modules/node_modules --frozen-lockfile --production=false (PATH=/layers/google.nodejs.yarn/yarn_engine/bin:/layers/google.nodejs.runtime/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/layers/google.nodejs.yarn/yarn_modules/node_modules/.bin)"
2024-07-25 01:44:17.929 EDT
Step #2: yarn install v1.22.22
2024-07-25 01:44:18.045 EDT
Step #2: [1/4] Resolving packages...
2024-07-25 01:44:18.670 EDT
Step #2: [2/4] Fetching packages...
2024-07-25 01:45:11.713 EDT
Step #2: [3/4] Linking dependencies...
2024-07-25 01:45:11.741 EDT
Step #2: warning " > @graphql-codegen/typescript-react-apollo@4.3.0" has unmet peer dependency "graphql-tag@^2.0.0".
2024-07-25 01:45:34.769 EDT
Step #2: [4/4] Building fresh packages...
2024-07-25 01:45:35.604 EDT
Step #2: Done in 77.68s.
2024-07-25 01:45:35.646 EDT
Step #2: Done "yarn install --non-interactive --prefer-offline --modules-fo..." (1m18.092596983s)
2024-07-25 01:45:35.646 EDT
Step #2: --------------------------------------------------------------------------------
2024-07-25 01:45:35.646 EDT
Step #2: Running "npm exec --prefix /layers/google.nodejs.firebasenextjs/npm_modules apphosting-adapter-nextjs-build"
2024-07-25 01:45:36.427 EDT
Step #2:
2024-07-25 01:45:36.428 EDT
Step #2: > infinit-spaces@0.1.0 build
2024-07-25 01:45:36.428 EDT
Step #2: > next build
2024-07-25 01:45:36.645 EDT
Step #2: yarn run v1.22.22
2024-07-25 01:45:37.253 EDT
Step #2:
2024-07-25 01:45:37.267 EDT
Step #2: Done in 0.63s.
2024-07-25 01:45:38.171 EDT
Step #2: ▲ Next.js 14.2.3
2024-07-25 01:45:38.172 EDT
Step #2:
2024-07-25 01:45:38.193 EDT
Step #2: Creating an optimized production build ...
2024-07-25 01:46:30.648 EDT
Step #2: ✓ Compiled successfully
Failure Log Snippet
2024-07-25 14:51:00.928 EDT
Step #2: === Node.js - Firebasenextjs (google.nodejs.firebasenextjs@0.0.1) ===
2024-07-25 14:51:00.930 EDT
Step #2: WARNING: *** You are using a custom build command (your build command is NOT 'next build'), we will accept it as is but will error if output structure is not as expected ***
2024-07-25 14:51:00.930 EDT
Step #2: ***** CACHE MISS: "npm_modules"
2024-07-25 14:51:00.931 EDT
Step #2: Installing nextjs adaptor 14.0.5
2024-07-25 14:51:04.210 EDT
Step #2: === Node.js - Yarn (google.nodejs.yarn@2.1.0) ===
2024-07-25 14:51:04.210 EDT
Step #2: 2024/07/25 18:51:04 [DEBUG] GET https://registry.npmjs.org/yarn
2024-07-25 14:51:04.346 EDT
Step #2: ***** CACHE MISS: "yarn_engine"
2024-07-25 14:51:04.347 EDT
Step #2: Installing Yarn v1.22.22
2024-07-25 14:51:04.347 EDT
Step #2: 2024/07/25 18:51:04 [DEBUG] GET https://yarnpkg.com/downloads/1.22.22/yarn-v1.22.22.tar.gz
2024-07-25 14:51:04.895 EDT
Step #2: Setting environment variable PATH=/layers/google.nodejs.yarn/yarn_engine/bin:/layers/google.nodejs.runtime/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2024-07-25 14:51:04.912 EDT
Step #2: ***** CACHE MISS: "yarn_modules"
2024-07-25 14:51:04.914 EDT
Step #2: --------------------------------------------------------------------------------
2024-07-25 14:51:04.914 EDT
Step #2: Running "yarn install --non-interactive --prefer-offline --modules-folder=/layers/google.nodejs.yarn/yarn_modules/node_modules --frozen-lockfile --production=false (PATH=/layers/google.nodejs.yarn/yarn_engine/bin:/layers/google.nodejs.runtime/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/layers/google.nodejs.yarn/yarn_modules/node_modules/.bin)"
2024-07-25 14:51:05.297 EDT
Step #2: yarn install v1.22.22
2024-07-25 14:51:05.420 EDT
Step #2: [1/4] Resolving packages...
2024-07-25 14:51:06.065 EDT
Step #2: [2/4] Fetching packages...
2024-07-25 14:52:03.232 EDT
Step #2: [3/4] Linking dependencies...
2024-07-25 14:52:03.270 EDT
Step #2: warning " > @graphql-codegen/typescript-react-apollo@4.3.0" has unmet peer dependency "graphql-tag@^2.0.0".
2024-07-25 14:52:27.858 EDT
Step #2: [4/4] Building fresh packages...
2024-07-25 14:52:28.737 EDT
Step #2: Done in 83.45s.
2024-07-25 14:52:28.781 EDT
Step #2: Done "yarn install --non-interactive --prefer-offline --modules-fo..." (1m23.867885204s)
2024-07-25 14:52:28.782 EDT
Step #2: --------------------------------------------------------------------------------
2024-07-25 14:52:28.782 EDT
Step #2: Running "npm exec --prefix /layers/google.nodejs.firebasenextjs/npm_modules apphosting-adapter-nextjs-build"
2024-07-25 14:54:01.403 EDT
Step #2: /layers/google.nodejs.firebasenextjs/npm_modules/node_modules/@apphosting/common/dist/index.js:22
2024-07-25 14:54:01.403 EDT
Step #2: reject(new Error(`Process exited with error code ${code}. Output: ${buildOutput}`));
2024-07-25 14:54:01.403 EDT
Step #2: ^
2024-07-25 14:54:01.403 EDT
Step #2:
2024-07-25 14:54:01.403 EDT
Step #2: Error: Process exited with error code 1.
Describe the bug
Deploys for NextJS backends are failing due to the recent version update in the NextJS apphosting adapter.
After combing through the logs for my last successful deploy and the first failing deploy, I noticed that the only difference was that the
@apphosting/adapter-nextjsversion was bumped up to version14.0.5in the failing case. I believe this is the cause of the issues. All of my failing deploy install and try to run14.0.5.Those two deploys were just over an hour apart and the only change between the two commits a text change, so it would not affect deploys.
Additional context
How are you using GCP buildpacks?
packand thegcr.io/buildpacks/builderDid this used to work?
Yes, it used to work.
The last working deploy and first failing deploy were 1hr and 10mins apart, with no breaking code changes.
What language is your project primarily written in?
Node.js
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
The app to deploy.
Actual behavior
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
Success Log Snippet
Failure Log Snippet