Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAE Java8 Standard, BigQuery API throws "Invalid Project Id" #2300

Closed
ifigotin opened this issue Aug 3, 2017 · 3 comments
Closed

GAE Java8 Standard, BigQuery API throws "Invalid Project Id" #2300

ifigotin opened this issue Aug 3, 2017 · 3 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. running on app engine type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ifigotin
Copy link

ifigotin commented Aug 3, 2017

Environment: App Engine Standard Java 8.
In pom.xml I have the following:

com.google.cloud
google-cloud
0.21.0-alpha


com.google.cloud
google-cloud-bigquery
0.21.1-beta

My app has this example in a servlet:
BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
String datasetId = "my_dataset_id";
bigquery.create(DatasetInfo.newBuilder(datasetId).build());

When the servlet is called, I get the following exception:
com.google.cloud.bigquery.BigQueryException: Invalid project ID 'MyProjIDHere'. Project IDs must contain 6-63 lowercase letters, digits, or dashes. IDs must start with a letter and may not end with a dash.
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:86)
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.create(HttpBigQueryRpc.java:141)
at com.google.cloud.bigquery.BigQueryImpl$1.call(BigQueryImpl.java:172)
at com.google.cloud.bigquery.BigQueryImpl$1.call(BigQueryImpl.java:169)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:94)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:54)
at com.google.cloud.bigquery.BigQueryImpl.create(BigQueryImpl.java:169)
at com.google.test.HelloAppEngine.doGet(HelloAppEngine.java:56)

@ifigotin
Copy link
Author

ifigotin commented Aug 3, 2017

I also tried a Logging API example in my Java8 GAE Standard app:
LoggingOptions options = LoggingOptions.getDefaultInstance();
try(Logging logging = options.getService()) {
MetricInfo metricInfo = MetricInfo.newBuilder("test-metric", "severity >= ERROR")
.setDescription("Log entries with severity higher or equal to ERROR")
.build();
logging.create(metricInfo);
}

The error is similar, so it may be related:
java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.google.cloud.ServiceOptions.(ServiceOptions.java:240)
at com.google.cloud.logging.LoggingOptions.(LoggingOptions.java:102)
at com.google.cloud.logging.LoggingOptions$Builder.build(LoggingOptions.java:96)
at com.google.cloud.logging.LoggingOptions.getDefaultInstance(LoggingOptions.java:55)

@neozwu neozwu self-assigned this Aug 3, 2017
@neozwu neozwu added running on app engine priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Aug 3, 2017
@garrettjonesgoogle garrettjonesgoogle added api: bigquery Issues related to the BigQuery API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 7, 2017
@lesv
Copy link
Contributor

lesv commented Sep 20, 2017

@ifigotin Can you retest w/ 0.24.0-beta
??

@ifigotin
Copy link
Author

I think this works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. running on app engine type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants