403 status on deleting modules through gcloud preview app - gcloud

I currently use
gcloud preview app modules delete <module_name> --version <version_to_delete> with a service account to clean up old module versions for managed vms. This has been working great up until last week. I am now getting the error below.
ERROR: (gcloud.preview.app.modules.delete) Error Response: [403] Project has not enabled the API. Please use Google Developers Console to activate the API for your project.
Details: [[{"#type": "type.googleapis.com/google.rpc.Help", "links": [{"description": "Google developer console API activation", "url": "https://console.developers.google.com/project/<project_id>/apiui/api"}]}]]
More specifics:
Using my personal account from google allows me to delete module versions
I currently set the service account with gcloud auth activate-service-account <some_id>#developer.gserviceaccount.com --key-file gcloud.json

You must enable the "App Engine Admin API" in the Developers Console in order to delete modules using a service account:
Go to https://console.developers.google.com/
Navigate to APIs and auth > APIs
Find and enable "App Engine Admin API"

Related

GSuite marketplace Listing with Admin SDK + SERVICE ACCOUNT

I brought up a GSuite Marketplace Listing with Service account created and Domain Wide Delegation enabled. I want to retrieve the users and orgunits of the customer.
Created a new Google Cloud Project
Enabled 'Admin SDK' in the project
Enabled 'GSuite Marketplace SDK', filled the scopes 'https://www.googleapis.com/auth/admin.directory.orgunit.readonly',
'https://www.googleapis.com/auth/admin.directory.user.readonly' and published the listing.
Enabled the 'Enable API Access' in the Admin Console of the customer.
The customer installed the app but I saw that the client_id of the SA was not added under the "Authorized API clients" section. When I try to retrieve the list of users in GSuite, I get the below error.
"unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested"
Am I missing something in the marketplace listing ?
Why do you expect the SA's Oauth client to automatically appear under 'Authorized API Clients'? The instructions for setting up whitelisted Oauth clients for the domain mention you have to do it manually.

How can I use gcloud auth?

I am trying to follow the tutorial of python with google cloud sql.
When I run: ./cloud_sql_proxy -instances="My-connection-name"=tcp:3306, I get google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information..
Also, when I run: gcloud auth application-default login, I get www.googleapis.com%2Fauth%2Fcloud-platform&access_type=offline" doesn’t understand the “open location” message. (-1708)
I followed downloaded the json file for the credintials and set the enviromnet virable GOOGLE_APPLICATION_CREDENTIALS to link to the json file, but I still get the same error.
TL;DR - You can ignore the doesn’t understand the “open location” message. (-1708) error. You should see a browser window/tab opening with the URL, if not you can follow the steps I've added below where you can manually copy-paste the URL in the browser and you should not be seeing any warnings/errors.
You will need to authorize gcloud (one-time step) to use your account credentials for Google Cloud API calls.
Run gcloud auth application-default login --no-launch-browser
You will be provided a URL. Open the URL in the browser, authorize the application using your Google account and you will be provided a verification code in the page.
Copy the verification code and paste it back in the terminal where you ran the gcloud command in Step 1.
Now gcloud as well as any Google Cloud Client libraries you use can make use of the Application Default Credentials from that machine.

gcloud beta ml init-project -- Error: Project does not exist, or you do not have permission

I'm trying to get started with Google Machine Learning using these instructions: Getting Setup
When I run gcloud beta ml init-project I get
ERROR: (gcloud.beta.ml.init-project) Project [mnist1-151907] does not exist,
or you do not have permission to access it.
I'm running this command on Google Cloud's Ubuntu 16.04 virtual machine created under my projectID mnist1-151907 and I've given this machine access to all of Google Cloud's APIs.
The log ~/.config/gcloud/logs/2016.12.23/13.14.03.742050.log says
... "error": { "code": 403,
"message": Google Cloud Resource Manager API has not been used in project mnist1-151907 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=mnist1-151907 ...
I followed the log's instructions and the API is enabled, but I'm still getting the same error. Has anyone experienced this error or can offer a suggestion? Thank you.
I was receiving the same error after enabling the API. I had to play a little re-authenticating with the project the gcloud tool. i.e. gcloud init, gcloud auth revoke and gcloud auth login

Google for Work not connected to Google Developers Console

We have been using Google for Work for years now and have a domain setup thru godaddy. We got it so we would have a descent email server without having to worry about it. I then signed up for the Google Developers Console to expand the options we have available and move our local apache/php business software to the cloud. I correctly setup a project with a lamp instance which also works great.
Problem is I cant add projects thru the
https://console.developers.google.com/project?authuser=0
it returns
Error Developers Console has not been activated for your account.
Your account may be suspended or disabled. If you are a Google Apps
user, ask your domain administrator to enable Apphosting Admin on your
account.
But from here I can add new projects
https://code.google.com/apis/console
If I goto the Google for Work console App Engine apps it says
No services have been installed.
Add services to your domain
I click the link to add the service
and goto the Other Services
Google App Engine Provide existing Google App Engine services to your
users.
Enter App ID:*
What is the App ID? I have already authorized the domain we are using for the services.
If I goto Google for Work Domain admin and try to add the other domain we have it says
We are sorry, but you do not have access to Webmaster tool. Please log
in to your Admin Console to enable Webmaster tool. Learn more
Its also adding the domain name to the Project ID: which causes this error in the SDK console
:\Program Files\Google\Cloud SDK>gcloud compute ssh
example.com:api-project-??????? --zone us-central1-a ERROR:
(gcloud.compute.ssh) Could not fetch instance:
- Invalid value 'example.com:api-project-???????'. Values must match the following regular expression: '[a-z](? z0-9]{0,61}[a-z0-9])?'
Im really confused
Go to admin.google.com, login with our organisation account, go to Apps -> Additional Google Services -> Enable the services you need.

gsutil credentials error when trying to download app reviews

I followed Google's instructions to install Python and gsutil on Windows. When I attempt to download reviews with this command line:
c:\gsutil>c:\python27\python gsutil cp -r gs://pubsite_prod_rev_########/reviews/reviews_package.name_2015* c:/temp/xxx
I get this error message:
You are attempting to access protected data with no configured
credentials. Please visit https://cloud.google.com/console#/project
and sign up for an account, and then run the "gsutil config" command
to configure gsutil to use these credentials.
I don't have a Google Cloud Platform subscription. Do I need to pay for one to access the ratings?
You can use the account that is responsible for that app. You will have to install the Cloud SDK and authenticate using :
gcloud auth login
Once you do that and paste the link on a browser tab using the account that hosts the app you will receive the credentials that you can pass to gcloud and they will get saved.
Then you can use the command and won't get the error.