Skip to content

BigQuery: Invalid projectID while loading data with POST request #2235

Closed

Description

@NicolaSpreafico

I'm working with App Engine standard project (Maven based) and I implemented this code https://cloud.google.com/bigquery/loading-data-post-request#bigquery-import-file-java in order to load data to a BigQuery table directly from in-memory data w/o providing a file from Cloud Storage

I'm attaching you a sample project which shows the error
bq.zip

I'm running on localhost dev-server launched with Cloud Tools 4 Eclipse

Even if I configured the destination project

TableId tableId = TableId.of(PROJECT_ID, DATASET_ID, TABLE_ID);

This value seems to be ignored and a no_app_id error is thrown

Caused by: com.google.api.client.http.HttpResponseException: 400
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid project ID 'no_app_id'. Project IDs must contain 6-63 lowercase letters, digits, or dashes. IDs must start with a letter and may not end with a dash."
   }
  ],
  "code": 400,
  "message": "Invalid project ID 'no_app_id'. 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.api.client.http.HttpRequest.execute(HttpRequest.java:1061)
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.open(HttpBigQueryRpc.java:420)
	... 45 more

The only way I found to make it working is defining the <application> node in the appengine-web.xml file, which it is no longer used since gcloud based deploy (also, it suggest to remove it if found).

[INFO] GCLOUD: Configuration Warning : <application> XML element and --application should not be specified when staging
[INFO] GCLOUD: 
[INFO] GCLOUD: The following parameters will be scrubbed from app.yaml
[INFO] GCLOUD: application : xxxxxxx
[INFO] GCLOUD: 

I'm running on Eclipse Mars with Java8 and GCloud 158, but I found the same problem using Java7

Activity

  1. added
    api: bigquery
    type: bug
    on Jul 13, 2017
  2. added
    priority: p1
    on Jul 17, 2017
  3. garrettjonesgoogle commented on Jul 17, 2017

    @garrettjonesgoogle
    Contributor

    It appears that you are seeing the same issue as described in #2209 . I am going to close out this issue - please follow the resolution in 2209. Thanks!

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

Metadata

Metadata

Labels

api: bigquerypriority: p1running on app enginetype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions