Repository navigation
BigQuery table.import() complains about not having a project ID. #1984
Description
Activity
Can you show the code that reproduces as well? I just tried this and it went through okay:
var bigquery = require('@google-cloud/bigquery')({ projectId: 'my-project-id' }) var dataset = bigquery.dataset('myDataset') var table = dataset.table('myTable') table.getMetadata().then(console.log)
(
getMetadataandimportshould both error if there's not a project ID available)- addedapi: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.
on Feb 10, 2017 Alright, I've been playing around with my code for a bit, and I realize that if I call the code I'm using to send data directly, it seems to work fine, but when calling it the way I do in my application, it doesn't. I'm calling it exactly the same way in both cases, but apparently there's something I'm missing. Either way, it seems like something on my side, since it works in my stripped down tests. Feel free to close this, unless you've got any ideas of things I could be doing that would mess this up.
Not off hand, but walking step by step through what your code does will likely highlight any oddities. If you're still stumped, share any code to reproduce and I will take a look.
Alright, I've done some investigating, and found that the error is being thrown here: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/common/src/util.js#L356-L358
Problem is, it's catching a
RangeError("Maximum call stack size exceeded"), then assuming that there's a missing project ID, leading to an incorrect error message. Additionally, the reason for the stack overflow appears to be that aDestroyableTransformobject is getting passed in asauthenticatedReqOpts.multipart[1].body, which is causing there to be quite a few levels of recursion once execution gets to replaceProjectIdToken (https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/common/src/util.js#L512).I'm not entirely sure what I could be doing differently between my application code and my testing code, so I'll see if I can come up with a way that I can give you the problematic code (without making my employer angry).
Upon further investigation, the same
DestroyableTransformobject is being passed in with my test code, making things a bit more confusing for me.Alright, so after even more investigation, the
DestroyableTransformobject includes some other objects in itsDomainwhen being run in my application. Those objects are then being looped through as well, leading to the call stack overflow.- added a commit that references this issue
on Feb 13, 2017 - added a commit that references this issue
on Feb 14, 2017
Despite having specified the project ID when creating the
BigQueryobject, I'm getting this error about there not being one specified when trying to usetable.import().Environment details
Steps to reproduce
@google-cloud/bigqueryBigQueryobject specifyingprojectIdin optionsdatasetobject fromBigQueryobject, thentableobject fromdatasettable.import(jsonFile).then(...);Error