play-billing-samples icon indicating copy to clipboard operation
play-billing-samples copied to clipboard

ClassyTaxiServer deploy failed with non-zero exit code 2

Open kexuejin opened this issue 1 year ago • 3 comments

[2023-10-13T08:47:17.496Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"] [2023-10-13T08:47:17.497Z] > authorizing via signed-in user (*****@gmail.com) [2023-10-13T08:47:17.498Z] [iam] checking project classytaxi-fe477 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"] [2023-10-13T08:47:17.500Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/classytaxi-fe477:testIamPermissions [none] [2023-10-13T08:47:17.500Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/classytaxi-fe477:testIamPermissions x-goog-quota-user=projects/classytaxi-fe477 [2023-10-13T08:47:17.501Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/classytaxi-fe477:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]} [2023-10-13T08:47:19.479Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/classytaxi-fe477:testIamPermissions 200 [2023-10-13T08:47:19.479Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/classytaxi-fe477:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]} [2023-10-13T08:47:19.479Z] >>> [apiv2][query] POST https://iam.googleapis.com/v1/projects/classytaxi-fe477/serviceAccounts/[email protected]:testIamPermissions [none] [2023-10-13T08:47:19.480Z] >>> [apiv2][body] POST https://iam.googleapis.com/v1/projects/classytaxi-fe477/serviceAccounts/[email protected]:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]} [2023-10-13T08:47:21.375Z] <<< [apiv2][status] POST https://iam.googleapis.com/v1/projects/classytaxi-fe477/serviceAccounts/[email protected]:testIamPermissions 200 [2023-10-13T08:47:21.376Z] <<< [apiv2][body] POST https://iam.googleapis.com/v1/projects/classytaxi-fe477/serviceAccounts/[email protected]:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]}

=== Deploying to 'classytaxi-fe477'...

i deploying functions Running command: npm --prefix "$RESOURCE_DIR" run lint

lint tslint --project tsconfig.json

/bin/sh: --: invalid option Usage: /bin/sh [GNU long option] [option] ... /bin/sh [GNU long option] [option] script-file ... GNU long options: --debug --debugger --dump-po-strings --dump-strings --help --init-file --login --noediting --noprofile --norc --posix --protected --rcfile --restricted --verbose --version --wordexp Shell options: -irsD or -c command or -O shopt_option (invocation only) -abefhkmnptuvxBCHP or -o option

Error: functions predeploy error: Command terminated with non-zero exit code 2

i try many times, but cannot deploy successfully.

kexuejin avatar Oct 13 '23 08:10 kexuejin

Are you on Windows? The firebase.json file is so old in this code that it doesn't work on windows.

A possible fix is to change firebase.json to this

{
  "functions": {
    "predeploy": [
      "npm --prefix \"functions\" run lint",
      "npm --prefix \"functions\" run build"
    ],
    "source": "."
  },
  "hosting": {
    "public": "webapp",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": []
  }
}

Also see:

https://github.com/firebase/firebase-tools/issues/610 https://stackoverflow.com/questions/50915952/firebase-cloud-function-deploy-tslint-error

matale avatar Oct 14 '23 16:10 matale

Thanks for your reply, but i deploy it on mac.

kexuejin avatar Oct 16 '23 00:10 kexuejin

Try it anyway. Last option create a brand new firebase project using the firebase cli then just copy over the code files and not the config files.

matale avatar Oct 16 '23 01:10 matale