Skip to content

Execution fails if quota is exceeded in GCP region #37

@lovelaced

Description

@lovelaced

Thanks for this great tool!

I'm using the cli in docker built from the latest https://github.com/flex-dapps/gantree-cli-docker.

I believe the following issue is occurring due to:

TASK [infra-gcp-node : gcp compute instance] ***********************************
fatal: [gantree-infra-project-1 -> localhost]: FAILED! => {"changed": false, "msg": [{"code": "QUOTA_EXCEEDED", "message": "Quota 'N2_CPUS' exceeded.  Limit: 24.0 in region europe-west1."}]}

but the play continues on and then js throws an error:

PLAY RECAP *********************************************************************
gantree-infra-project-0 : ok=7    changed=3    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   
gantree-infra-project-1 : ok=5    changed=2    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

2020-06-06T14:46:47.280Z [Gantree] (cmd) error: Execution failed with code 2: ansible-playbook -i /gantree/inventory/project/gantree -i /gantree/inventory/project/active /usr/local/lib/node_modules/gantree-cli/node_modules/gantree-lib/ansible/infra.yml
(node:12) UnhandledPromiseRejectionWarning: Error: 2
    at childCloseCallback (/usr/local/lib/node_modules/gantree-cli/node_modules/gantree-lib/src/lib/cmd.js:117:18)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/gantree-cli/node_modules/gantree-lib/src/lib/cmd.js:55:5)
    at ChildProcess.emit (events.js:327:22)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
(node:12) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior would be printing a normal error message about the quota being exceeded and maybe a link to where to raise the quota (https://console.cloud.google.com/iam-admin/quotas), then exiting. This is reproducible and either fixed by raising the quota or downsizing the machines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions