Skip to content

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

Closed

Description

@ifigotin

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)

Activity

  1. ifigotin commented on Aug 3, 2017

    @ifigotin
    Author

    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)

  2. self-assigned this
    on Aug 3, 2017
  3. added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Aug 3, 2017
  4. added
    api: bigqueryIssues related to the BigQuery API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Aug 7, 2017
  5. lesv commented on Sep 20, 2017

    @lesv
    Contributor

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

  6. ifigotin commented on Sep 20, 2017

    @ifigotin
    Author

    I think this works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.running on app enginetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions