Search code examples
node.jsexpressgoogle-app-enginegcloudapp-engine-flexible

Unable to deploy node.js app to google cloud app engine


I have an API deployed to google cloud app engine working correctly. I did a successfully deploy yesterday (Nov 26) and everything flows well.

But today, without changing my app.yaml file or installed any new dependecies (my package.json and package-lock.json are the same), I'm not able to deploy it anymore.

The error message is not helping me and I have no idea where this bug came from (error after gcloud app deploy ):

starting build "0e9f3841-1627-44b2-92f1-97745eb6b73f"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://staging.emcantomeu-api.appspot.com/ae/60a880db-d388-4db3-9bef-9d233841ff13/manifest.json.
Step #0 - "fetcher": Processing 82 files.
Step #0 - "fetcher": ******************************************************
Step #0 - "fetcher": Status: SUCCESS
Step #0 - "fetcher": Started: 2018-11-27T18:06:20Z
Step #0 - "fetcher": Completed: 2018-11-27T18:06:23Z
Step #0 - "fetcher": Requested workers: 200
Step #0 - "fetcher": Actual workers: 82
Step #0 - "fetcher": Total files: 82
Step #0 - "fetcher": Total retries: 2
Step #0 - "fetcher": GCS timeouts: 2
Step #0 - "fetcher": MiB downloaded: 7.75 MiB
Step #0 - "fetcher": MiB/s throughput: 3.40 MiB/s
Step #0 - "fetcher": Time for manifest: 864.31 ms
Step #0 - "fetcher": Total time: 3.15 s
Step #0 - "fetcher": ******************************************************
Finished Step #0 - "fetcher"
Starting Step #1 - "builder"
Step #1 - "builder": Pulling image: gcr.io/gae-runtimes/nodejs10_app_builder:nodejs10_10_13_0_20181111_RC00
Step #1 - "builder": nodejs10_10_13_0_20181111_RC00: Pulling from gae-runtimes/nodejs10_app_builder
Step #1 - "builder": Digest: sha256:dcaad09757154246bebf1c802bb43b7002301409d9261ad21faa1864a9138d69
Step #1 - "builder": Status: Downloaded newer image for gcr.io/gae-runtimes/nodejs10_app_builder:nodejs10_10_13_0_20181111_RC00
Step #1 - "builder": INFO FTL version node-v0.11.0
Step #1 - "builder": INFO Beginning FTL build for node
Step #1 - "builder": INFO FTL arg passed: exposed_ports None
Step #1 - "builder": INFO FTL arg passed: cache_repository us.gcr.io/emcantomeu-api/app-engine-tmp/build-cache/ttl-7d
Step #1 - "builder": INFO FTL arg passed: tar_base_image_path None
Step #1 - "builder": INFO FTL arg passed: builder_output_path /builder/outputs
Step #1 - "builder": INFO FTL arg passed: name us.gcr.io/emcantomeu-api/app-engine-tmp/app/ttl-2h:60a880db-d388-4db3-9bef-9d233841ff13
Step #1 - "builder": INFO FTL arg passed: ttl 168
Step #1 - "builder": INFO FTL arg passed: global_cache False
Step #1 - "builder": INFO FTL arg passed: cache True
Step #1 - "builder": INFO FTL arg passed: upload True
Step #1 - "builder": INFO FTL arg passed: sh_c_prefix False
Step #1 - "builder": INFO FTL arg passed: fail_on_error True
Step #1 - "builder": INFO FTL arg passed: base gcr.io/gae-runtimes/nodejs10:nodejs10_10_13_0_20181111_RC00
Step #1 - "builder": INFO FTL arg passed: output_path None
Step #1 - "builder": INFO FTL arg passed: cache_key_version v0.11.0
Step #1 - "builder": INFO FTL arg passed: cache_salt 
Step #1 - "builder": INFO FTL arg passed: directory /workspace
Step #1 - "builder": INFO FTL arg passed: entrypoint None
Step #1 - "builder": INFO FTL arg passed: additional_directory None
Step #1 - "builder": INFO FTL arg passed: destination_path /srv
Step #1 - "builder": INFO FTL arg passed: verbosity NOTSET
Step #1 - "builder": INFO starting: full build
Step #1 - "builder": INFO starting: builder initialization
Step #1 - "builder": INFO Loading Docker credentials for repository 'gcr.io/gae-runtimes/nodejs10:nodejs10_10_13_0_20181111_RC00'
Step #1 - "builder": INFO Loading Docker credentials for repository 'us.gcr.io/emcantomeu-api/app-engine-tmp/app/ttl-2h:60a880db-d388-4db3-9bef-9d233841ff13'
Step #1 - "builder": INFO builder initialization took 0 seconds
Step #1 - "builder": INFO starting: build process for FTL image
Step #1 - "builder": INFO starting: rm_node_modules
Step #1 - "builder": INFO rm_node_modules rm -rf /workspace/node_modules
Step #1 - "builder": INFO `rm_node_modules` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO rm_node_modules took 0 seconds
Step #1 - "builder": INFO starting: checking_cached_packages_json_layer
Step #1 - "builder": DEBUG Checking cache for cache_key e21be12699e5e087245dc8e246f7a17e1d5571d3c7dc004195afa63b46b39fc9
Step #1 - "builder": INFO No cached base image found for entry: us.gcr.io/emcantomeu-api/app-engine-tmp/build-cache/ttl-7d/node-cache:e21be12699e5e087245dc8e246f7a17e1d5571d3c7dc004195afa63b46b39fc9.
Step #1 - "builder": INFO Cache miss on local cache for us.gcr.io/emcantomeu-api/app-engine-tmp/build-cache/ttl-7d/node-cache:e21be12699e5e087245dc8e246f7a17e1d5571d3c7dc004195afa63b46b39fc9
Step #1 - "builder": INFO No cached dependency layer for e21be12699e5e087245dc8e246f7a17e1d5571d3c7dc004195afa63b46b39fc9
Step #1 - "builder": INFO [CACHE][MISS] v0.11.0:NODE->e21be12699e5e087245dc8e246f7a17e1d5571d3c7dc004195afa63b46b39fc9
Step #1 - "builder": INFO checking_cached_packages_json_layer took 0 seconds
Step #1 - "builder": INFO starting: building_packages_json_layer
Step #1 - "builder": INFO starting: npm_install
Step #1 - "builder": INFO npm_install npm install --production
Step #1 - "builder": INFO `npm_install` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO `npm_install` had stderr output:


Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/package.json'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/CHANGELOG.md'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/index.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/README.md'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/each.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/constant.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/eachRight.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/conforms.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/endsWith.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/cond.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/entries.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/protobufjs-5cf86b95/dist/light/README.md'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/concat.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/bluebird-e8847f49/js/browser/bluebird.min.js'

....
....
....

Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/fsevents-355423a2/node_modules/iconv-lite/encodings/tables/shiftjis.json'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, lstat '/workspace/node_modules/.staging/google-proto-files-4307fece/google/iam/v1/logging'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/google-proto-files-4307fece/google/iam/v1/policy.proto'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, lstat '/workspace/node_modules/.staging/google-proto-files-4307fece/google/logging'
Step #1 - "builder": npm WARN [email protected] No repository field.
Step #1 - "builder": 
Step #1 - "builder": npm ERR! code E404
Step #1 - "builder": npm ERR! 404 Not Found: [email protected]
Step #1 - "builder": 
Step #1 - "builder": npm ERR! A complete log of this run can be found in:
Step #1 - "builder": npm ERR! /builder/home/.npm/_logs/2018-11-27T18_06_41_641Z-debug.log
Step #1 - "builder": 
Step #1 - "builder": ERROR error: `npm_install` returned code: 1
Step #1 - "builder": INFO npm_install took 15 seconds
Step #1 - "builder": INFO building_packages_json_layer took 15 seconds
Step #1 - "builder": INFO build process for FTL image took 15 seconds
Step #1 - "builder": INFO full build took 15 seconds
Step #1 - "builder": ERROR `npm_install` had stderr output:


Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/package.json'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/CHANGELOG.md'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/index.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/empower-core-17c5c138/README.md'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/each.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/constant.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/eachRight.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/conforms.js'
Step #1 - "builder": npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/lodash-321678b3/endsWith.js'

Step #1 - "builder": npm WARN [email protected] No repository field.
Step #1 - "builder": 
Step #1 - "builder": npm ERR! code E404
Step #1 - "builder": npm ERR! 404 Not Found: [email protected]
Step #1 - "builder": 
Step #1 - "builder": npm ERR! A complete log of this run can be found in:
Step #1 - "builder": npm ERR! /builder/home/.npm/_logs/2018-11-27T18_06_41_641Z-debug.log
Step #1 - "builder": 
Step #1 - "builder": error: `npm_install` returned code: 1
Finished Step #1 - "builder"
ERROR
ERROR: build step 1 "gcr.io/gae-runtimes/nodejs10_app_builder:nodejs10_10_13_0_20181111_RC00" failed: exit status 1

app.yaml file:

runtime: nodejs8

p.s 1: I'm correctly authenticated (gcloud auth login).

p.s 2: I'm using the right project (gcloud config set project <MY_PROJECT_ID>)

p.s 3: I already created a new gcloud project and when I tried to deploy and I got the same error.

Anybody has any idea?


Solution

  • flatmap-stream has been removed from npm here

    That's why it is getting a 404 error. Make sure to update the dependant package that is using flatmap-stream, maybe the new version is not using that anymore.

    This nodemon issue has some useful information.