You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GAE Java8 Standard, BigQuery API throws "Invalid Project Id" #2300
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)
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)
Activity
ifigotin commentedon 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)
lesv commentedon Sep 20, 2017
@ifigotin Can you retest w/ 0.24.0-beta
??
ifigotin commentedon Sep 20, 2017
I think this works now.
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
feat: Adding CDC sample (#2263)
deps: update dependency org.springframework.boot:spring-boot to v4 (g…
chore(main): release 2.34.1 (googleapis#2305)
deps: update dependency com.google.cloud:google-cloud-core to v2.49.1 (…
deps: update dependency com.google.cloud:google-cloud-core to v2.49.1 (…
deps: update shared config to 3.56.0 (#2300)
feat: add fields and the BackupType proto for Hot Backups (googleapis…
chore(main): release 2.43.0 (googleapis#2323)