I have an adonis app that I'm trying to deploy to google cloud by mirroring a gitlab repo. I have my cloudbuild.yaml files set up and have deployed different builds of this app in the past but for some reason now I get this error when trying to build.
cloudbuild.yaml
steps:
# Install node.js dependencies
- name: node
entrypoint: npm
args: ["install"]
# Fetch gcp-service-account.json from storage
- name: gcr.io/cloud-builders/gsutil
args:
[
"cp",
"gs://api-vampfi-deployment-files/deployment-files/gcp-service-account.json",
"gcp-service-account.json",
]
# Fetch environment variables from storage
- name: gcr.io/cloud-builders/gsutil
args:
[
"cp",
"gs://api-vampfi-deployment-files/deployment-files/${_ENV}.env",
".env",
]
# Fetch app.yaml from storage
- name: gcr.io/cloud-builders/gsutil
args:
[
"cp",
"gs://api-vampfi-deployment-files/deployment-files/${_ENV}.yaml",
"app.yaml",
]
# Run Migrations
- name: node
entrypoint: node
args: ["ace", "migration:run", "--force"]
# Run Seeders -- Resource heavy, enable only when neccesary
- name: node
entrypoint: node
args: ["ace", "seed", "--files", "DatabaseSeeder.js", "--force"]
# Deploy application
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
package.json
{
"name": "vamp",
"version": "4.1.0",
"adonis-version": "4.1.0",
"description": "Rethink Facility Management",
"main": "index.js",
"scripts": {
"dev": "adonis serve --dev",
"start": "node server.js",
"test": "node ace test",
"seed": "node ace seed --files "DatabaseSeeder.js" --force",
"update-env": "gsutil -m cp -r tmp/deployment-files gs://api-vampfi-deployment-files"
},
"keywords": [
"adonisjs",
"adonis-app"
],
"author": "Obapelumi - Filmo Product Dev",
"license": "UNLICENSED",
"private": true,
"dependencies": {
"@adonisjs/ace": "^5.0.8",
"@adonisjs/auth": "^3.0.7",
"@adonisjs/bodyparser": "^2.0.5",
"@adonisjs/cors": "^1.0.7",
"@adonisjs/fold": "^4.0.9",
"@adonisjs/framework": "^5.0.9",
"@adonisjs/ignitor": "^2.0.8",
"@adonisjs/lucid": "^6.1.3",
"@adonisjs/mail": "^3.0.9",
"@adonisjs/validator": "^5.0.6",
"@adonisjs/websocket": "^1.0.12",
"@google-cloud/storage": "^2.5.0",
"@radmen/adonis-lucid-soft-deletes": "^0.1.2",
"adonis-google-cloud-storage": "^1.0.0",
"adonis-scheduler": "^3.0.2",
"africastalking": "^0.4.4",
"axios": "^0.19.0",
"mime": "^2.4.4",
"mkdirp": "^0.5.1",
"mqtt": "^3.0.0",
"mssql": "4.1.0",
"mysql": "^2.17.1"
},
"devDependencies": {
"standard": "^13.1.0"
},
"autoload": {
"App": "./app"
},
"prettier": {
"trailingComma": "none"
}
}
error from cloud build
ERROR: build step 0 "node" failed: step exited with non-zero status: 1
ERROR
Finished Step #0
Step #0: npm ERR! /builder/home/.npm/_logs/2021-01-23T19_33_14_163Z-debug.log
Step #0: npm ERR! A complete log of this run can be found in:
Step #0:
Step #0: npm ERR! gyp ERR! not ok
Step #0: npm ERR! gyp ERR! node-gyp -v v7.1.2
Step #0: npm ERR! gyp ERR! node -v v15.6.0
Step #0: npm ERR! gyp ERR! cwd /workspace/node_modules/grpc
Step #0: npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
Step #0: npm ERR! gyp ERR! System Linux 5.4.0-1029-gcp
Step #0: npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:285:12)
Step #0: npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:379:20)
Step #0: npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
Step #0: npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
Step #0: npm ERR! gyp ERR! configure error
Step #0: npm ERR! gyp: Undefined variable module_path in binding.gyp while trying to load binding.gyp
Step #0: npm ERR! gyp info spawn args ]
Step #0: npm ERR! gyp info spawn args '-Goutput_dir=.'
Step #0: npm ERR! gyp info spawn args 'build',
Step #0: npm ERR! gyp info spawn args '--generator-output',
Step #0: npm ERR! gyp info spawn args '--no-parallel',
Step #0: npm ERR! gyp info spawn args '--depth=.',
Step #0: npm ERR! gyp info spawn args '-Dnode_engine=v8',
Step #0: npm ERR! gyp info spawn args '-Dmodule_root_dir=/workspace/node_modules/grpc',
Step #0: npm ERR! gyp info spawn args '-Dnode_lib_file=/builder/home/.cache/node-gyp/15.6.0/<(target_arch)/node.lib',
Step #0: npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
Step #0: npm ERR! gyp info spawn args '-Dnode_root_dir=/builder/home/.cache/node-gyp/15.6.0',
Step #0: npm ERR! gyp info spawn args '-Dvisibility=default',
Step #0: npm ERR! gyp info spawn args '-Dlibrary=shared_library',
Step #0: npm ERR! gyp info spawn args '/builder/home/.cache/node-gyp/15.6.0/include/node/common.gypi',
Step #0: npm ERR! gyp info spawn args '-I',
Step #0: npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
Step #0: npm ERR! gyp info spawn args '-I',
Step #0: npm ERR! gyp info spawn args '/workspace/node_modules/grpc/build/config.gypi',
Step #0: npm ERR! gyp info spawn args '-I',
Step #0: npm ERR! gyp info spawn args 'make',
Step #0: npm ERR! gyp info spawn args '-f',
Step #0: npm ERR! gyp info spawn args 'binding.gyp',
Step #0: npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
Step #0: npm ERR! gyp info spawn args [
Step #0: npm ERR! gyp info spawn /usr/bin/python3
Step #0: npm ERR! gyp http 200 https://nodejs.org/download/release/v15.6.0/SHASUMS256.txt
Step #0: npm ERR! gyp http GET https://nodejs.org/download/release/v15.6.0/SHASUMS256.txt
Step #0: npm ERR! gyp http 200 https://nodejs.org/download/release/v15.6.0/node-v15.6.0-headers.tar.gz
Step #0: npm ERR! gyp http GET https://nodejs.org/download/release/v15.6.0/node-v15.6.0-headers.tar.gz
Step #0: npm ERR! gyp info find Python using Python version 3.5.3 found at "/usr/bin/python3"
Step #0: npm ERR! gyp info using [email protected] | linux | x64
Step #0: npm ERR! gyp info using [email protected]
Step #0: npm ERR! gyp info it worked if it ends with ok
Step #0: npm ERR! command sh -c node-gyp rebuild
Step #0: npm ERR! command failed
Step #0: npm ERR! path /workspace/node_modules/grpc
Step #0: npm ERR! code 1
Step #0: docker.io/library/node:latest
Step #0: Status: Downloaded newer image for node:latest
Step #0: Digest: sha256:ebf5158e91b303bd93e77537065742c42657aa7ca1714ada7cedee3e2033191f
Step #0: c57d0532f0ca: Pull complete
Step #0: 2ab9800d7323: Pull complete
Step #0: 856f8ebc161d: Pull complete
Step #0: dd25ee3ea38e: Pull complete
Step #0: 00e912dd434d: Pull complete
Step #0: ed36dafe30e3: Pull complete
Step #0: d4d3f270c7de: Pull complete
Step #0: 953fe5c215cb: Pull complete
Step #0: 2587235a7635: Pull complete
Step #0: 00e912dd434d: Download complete
Step #0: 00e912dd434d: Verifying Checksum
Step #0: 856f8ebc161d: Download complete
Step #0: 856f8ebc161d: Verifying Checksum
Step #0: c57d0532f0ca: Download complete
Step #0: c57d0532f0ca: Verifying Checksum
Step #0: 2ab9800d7323: Download complete
Step #0: 2ab9800d7323: Verifying Checksum
Step #0: dd25ee3ea38e: Download complete
Step #0: dd25ee3ea38e: Verifying Checksum
Step #0: ed36dafe30e3: Download complete
Step #0: ed36dafe30e3: Verifying Checksum
Step #0: 2587235a7635: Download complete
Step #0: 2587235a7635: Verifying Checksum
Step #0: 953fe5c215cb: Download complete
Step #0: 953fe5c215cb: Verifying Checksum
Step #0: d4d3f270c7de: Download complete
Step #0: d4d3f270c7de: Verifying Checksum
Step #0: c57d0532f0ca: Waiting
Step #0: 2ab9800d7323: Waiting
Step #0: 856f8ebc161d: Waiting
Step #0: dd25ee3ea38e: Waiting
Step #0: 00e912dd434d: Waiting
Step #0: ed36dafe30e3: Waiting
Step #0: c57d0532f0ca: Pulling fs layer
Step #0: 2ab9800d7323: Pulling fs layer
Step #0: 856f8ebc161d: Pulling fs layer
Step #0: dd25ee3ea38e: Pulling fs layer
Step #0: 00e912dd434d: Pulling fs layer
Step #0: ed36dafe30e3: Pulling fs layer
Step #0: d4d3f270c7de: Pulling fs layer
Step #0: 953fe5c215cb: Pulling fs layer
Step #0: 2587235a7635: Pulling fs layer
Step #0: latest: Pulling from library/node
Step #0: Using default tag: latest
Step #0: Pulling image: node
Starting Step #0
BUILD
HEAD is now at be1b1b0 updated package.json
* branch be1b1b0c720285fae283e87ca7dfc1e9c81dd2cc -> FETCH_HEAD
From https://source.developers.google.com/p/vampfi-c5b1c/r/api.vampfi
Initialized empty Git repository in /workspace/.git/
FETCHSOURCE
starting build "9d616543-3e89-448e-95d8-77f111b241ec"
Please help.
question from:
https://stackoverflow.com/questions/65863656/google-cloud-build-fails