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
query causes R to crash #247
Comments
|
It's likely to be a bug with the C++ code that turns bq json into data frames. Can you please try and narrow down the cause? It's likely to be one cell that's causing the problem, so I'd suggest first doing a search on the rows (e.g. try Alternatively, if you know how to use a C debugger, I can help you figure out the source that way. |
|
I can confirm the query works if I use |
|
The crash actually happens during the "Retrieving data" step, not the parse step. Do you think it would still be related to the C++ code in that case? |
|
Oh hmmmm, that is quite surprising, so a C debugger might be the way to go. What platform are you on? |
|
I'm on a CentOS linux platform via ssh, so I'm working primarily via the command line (aside from R Studio Server). I've used gdb in a very limited way with compiled C/C++ programs, but since the C code here is wrapped within R libs, I'm not sure how I would use something like gdb. If there's something within R Studio that I'm unaware of, I'd be happy to learn. |
|
Ok, it shouldn't be too hard. Start R with: Then run code as usual. When you hit the error get a backtrace with |
|
Thanks for the guidance. When I run with the debugger, I am able to see this response from the API: However, when I run in R Studio, it crashes and I receive a pop-up that says something along the lines of "the previous R Session terminated unexpectedly". |
|
Hmmmm, typically that indicates there's some mismatch of installed C++ libraries so you're getting an crash instead of an error. Next step (unfortunately) is to try reinstalling all your packages. |
|
Thanks for your advice. I am using packrat to manage installed libs on a per-project basis. After updating bindr and bindrcpp I'm unable to reproduce a crash. |
|
of course the next time I ran it, it crashed- again during the download step. Something strange that I noticed is that when I run the same query that previously crashed without packrat managing the libraries for the project, it seems to work. Your comments regarding the libraries make me suspect that there is something strange happening with library management in packrat. |
|
I have exactly the same issue. I assume, after reading documentation, that it is because |
|
It looks like this issue is related to bigquery quotas. It manifests itself in a variety of ways, with the following ad-hoc solutions: Too much data returned (large tables with many fields)
Too many requests (large tables with few fields)
|
|
I've had some luck diagnosing by adding a very rudimentary callback: and adding: here: Lines 126 to 129 in a3ef603
While this doesn't resolve this issue (I believe there would have to be some kind of smart bigrquery rate-limiting implementation), it does at least provide output to the user that there was an error. Otherwise, R crashes without any output. It may be helpful to abort the download if one of the requests fails as this might prevent the program from crashing. |
|
Reprex: library(bigrquery)
tbl <-as_bq_table("fh-bigquery.dbpedia.place")
bq_table_download(tbl, page_size = 200) |
|
The above query works fine for me. Does anyone else have an example that crashes for them? |
|
This has been a difficult one to produce a consistent reprex for. Going off the hypothesis that this is related to quotas, possibly attempt to increase the page_size? Failing that, perhaps some variation of page_size and max_connections? |
|
I definitely see various errors, but I can't get R to crash. |
|
I think this was originally posted running R 3.4.x and with packrat managing the libraries. Have you created a packrat project? I would be happy to test it out again as I'm running 3.5.x now and can set up a packrat project pretty easily. |
|
If you only see it with packrat, I think it's highly likely its a package incompatibility problem, not a bug in bigrquery (especially since I can't recreate it locally) |
|
I am getting the same issue with R 3.6.2 GUI 1.70 El Capitan build (7735). The crashes are intermittent. But with a tendency to happen if I either have not queried for a while ( an hour or so) or the query is big ( 100k plus rows) but they happen at other times as well. |
I run into an issue where R crashes if I download a large table. I'm not sure if everything is being stored in memory, but I'm using a GCE instance with 15GB of RAM.
Here's a quick reprex:
I'm not sure if this is related to #169.
In my case, I'm query a table with thousands of features and would like to pull it into a dataframe in R. Please let me know if I can provide any additional information. Since I'm on R Studio Server on a GCE instance with oob auth, I'm unable to create reprexs with the reprex library.
The text was updated successfully, but these errors were encountered: