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

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

Closed
NicolaSpreafico opened this issue Jul 13, 2017 · 1 comment
Closed
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

@NicolaSpreafico
Copy link

NicolaSpreafico commented Jul 13, 2017

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

@tswast tswast added api: bigquery Issues related to the BigQuery API. running on app engine type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 13, 2017
@garrettjonesgoogle garrettjonesgoogle added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jul 17, 2017
@garrettjonesgoogle
Copy link
Member

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
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

3 participants