Posts Tagged ‘google cloud’

Google Bucket: BadRequestException: 400 Unknown project id

May 11, 2019

Hope following will be usefull for other beginners out there.

While trying several sample projects and services of Google Cloud, it was the round for Cloud Storage Bucket, so went for creating a bucket.

C:\Program Files (x86)\Google\Cloud SDK>gsutil mb gs://helloworld-123456-bucket
Creating gs://helloworld-123456-bucket/...
BadRequestException: 400 Unknown project id: helloworld-abc123-bucket

The output refers to a very old project id (helloworld-abc123-bucket), furthermore that prject was deleted long time ago.

After a quick investigation this command helped understanding was going on:

C:\Program Files (x86)\Google\Cloud SDK>gcloud config list
[core]
account = some.user@gmail.com
disable_usage_reporting = False
project = helloworld-abc123-bucket

Your active configuration is: [default]

C:\Program Files (x86)\Google\Cloud SDK>

The “project” still had the old one, then switch the project was the next step.

C:\Program Files (x86)\Google\Cloud SDK>gcloud config set project helloworld-123456-bucket
Updated property [core/project].

C:\Program Files (x86)\Google\Cloud SDK>gcloud config list
[core]
account = some.user@gmail.com
disable_usage_reporting = False
project = helloworld-123456-bucket

Your active configuration is: [default]

C:\Program Files (x86)\Google\Cloud SDK>

Time to create the bucket

C:\Program Files (x86)\Google\Cloud SDK>gsutil mb gs://helloworld-123456-bucket
Creating gs://helloworld-123456-bucket/...
AccessDeniedException: 403 The project to be billed is associated with an absent billing account.
C:\Program Files (x86)\Google\Cloud SDK>

Well … bissing is another chapter 🙂

more info BadRequestException: 400 Unknown project id

Advertisements

Google Cloud: first create project, then create application

April 23, 2019

It seems quite obvious, first you create a project and eventually the application.
Well, as I could see it is not 100% clear.
If you just create the project, no app can be deployed and you would get something like

Beginning interaction for module default…
Feb 29, 2019 9:45:35 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=helloworlddummyname-123456&version=1&
404 Not Found
This application does not exist (project_id=u’helloworlddummyname-123456′). To create an App Engine application in this project, run “gcloud app create” in your console.
This is try #0

As by the log, action is clear but some details are missing; here are 2 readymade options :
open Google Cloud Console, select your project and you should see something like this
GoogleCloud_CreateApplication

(clear enough? ;)) press “Create Application” and select the region you prefer
GoogleCloud_CreateApplication2-Region

or run the command from the Google Cloud SDK Shell
gcloud app create --project=[your project id] --region=[a region id]

I went for the cmd line 🙂

read more here “gcloud app creat ” needed permission?

Netbeans, Google Cloud and Java7-8

April 22, 2019

Again, this is just a reminder for myself … and maybe helpful for other Java-beginners 😉

Wanted to try Google Cloud … with Java…and Netbeans.

I have been forwarded this helpfull tutorial: How to Setup Google App Engine Server in NetBeans IDE

Found two issues, relative small if you are in Java world for quite a while … but I start as a total beginner:

First: JAVA_HOME was missing.
I installed the JDK 1.8 (this jdk-8u212-windows-x64.exe here) and JAVA_HOME was missing, so for the 100% beginners out there a good tutorial is How to set JAVA_HOME on Windows 10

Second: could not deploy the hello world app and had this error messagE:

com.google.apphosting.utils.config.AppEngineConfigException: GAE Java7 is not supported anymore.
Unable to update app: GAE Java7 is not supported anymore.

Workaround seems well known: in my WebApplication edited appengine-web.xml and added

<runtime>java8</runtime>

more info on appengine-web.xml Reference

That’s all! 🙂