Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOLUTION: google cloud sdk issue: 'callers must accept terms of service'

Known issue:

Installing google-cloud-sdk (linux package or from tarball) has a quirk where you cannot create projects from the command line before accepting the terms of service.

Steps to reproduce:

  1. Download sdk, untar, move folder to home directory and add google sdk root directory to PATH using install.sh
  2. Initialize and login with: $ google init
  3. Create a project from the CL: $ gcloud projects create --set-as-default

This will spit out an error like:

ERROR: (gcloud.projects.create) Operation [cp.5641973328385684887] failed: 9: Callers must accept Terms of Service

I hazard a guess that accepting the terms of service have not been built into the command line initialization yet. Omitting such a fundamental step to an installation process should be illegal, with consequences ranging from death by a thousand key-stokes, to 'build an operating system in headfuck'... but that's just me...

like image 210
BitShift Avatar asked Jul 22 '19 11:07

BitShift


2 Answers

We find the solution in the most unholiest of places: the google cloud control interface (cloud console).

  • Go to your cloud console
  • Create a project by selecting 'select a project' (top-left next to "Google Cloud Platform" and then 'create project' (top-right in the popup window).

This will prompt the terms of service agreement and you may carry on after agreeing to the terms of service.

I hope this helps whoever else stumbles upon this most infuriating of errors.

Live long and prosper

Bitshift

like image 80
BitShift Avatar answered Sep 21 '22 21:09

BitShift


Let's not be so dramatic with "death by a thousand key-strokes". This is a security measure that should be implemented. Security is not always convenient but can save your checking/credit account a lot of grief.

Imagine this theoretical scenario. You provide me with a service account that has the roles to create a project. I create a new project. This project is created under your Google Billing Account. I know what I am doing with Google IAM so I remove you from the new project and make myself the Project Owner. Now you have no access to the new project but your credit card is paying the bills for my project. I think you would then be screaming "death by a million key-strokes".

There are two types of projects:

  • Independent projects not part of an organization.
  • Projects that are part of an organization.

If you are part of a Google Cloud Organization, you can easily create projects up to your quota limit (default is 5). No prompting, accepting TOS, etc. Using the CLI to create a new project is effortless.

If you are not part of an Google Cloud Organization then you are basically creating a new account, you need to set up account billing, accept terms of service, etc. This means that you should not use the CLI to create a new project as the CLI does not prompt you for the items that a new project requires. Why, the CLI should be using a service account. The service account is not the IAM member that owns the account. This forces you to log into the Google Cloud Console using your User Credentials to create the new project.

like image 44
John Hanley Avatar answered Sep 22 '22 21:09

John Hanley