-
Notifications
You must be signed in to change notification settings - Fork 35
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Google JS Script error on accessing protected Sheet #2371
Comments
Thanks for your detailed report. Do you know if this is a new problem? Nothing has changed regarding the Query class, so I would suspect the problem involves the docs side, where they have made changes recently regarding security. Perhaps there is a change we need to make on the charts side to accommodate docs changes. |
I have recently updated to new Google APIs, to support loading private sheets. I don't know how long the problem has existed with the new APIs. The issue seems to be what docs.google.com/spreadsheets/... endpoint returns. If it had only included reqId variable when there is an error, I think the rest would work fine. There would be no execution errors, and I can implement on top of the API to process the error and recover from it. I found a work-around by loading the google docs query as a script with a custom callback function. However, this only works when the user is logged into a Google account. In other words, it doesn't work when the user is not logged into Google. Reason? If not logged in, the docs request returns an HTML file instead of JavaScript. So, for now, my workaround only works in special circumstances, by explicitly avoiding letting Google API execute the return string by taking control of the callback. So many hoops I had to jump through to have a partial solution. If you have a way to contact people who works on Google Docs services, they may want to hear about this issue, and inconsistencies in their API. It should include reqId variable on error, and it should not return HTML, if we are to build applications that expect JavaScript. Thanks! Adil |
Thanks. The lack of a reqId in error responses is now acknowledged by the docs team, and they will be working on a fix. I don't know how long it will be until the fix shows up, but I suspect it will be a relatively easy fix. |
Wonderful. Thanks for your help! |
Also waiting for an update on this. Thanks! |
Also waiting on a fix on the reqId for error ! The Google Spreadsheet server are not optimizing their answer if we make a call using the Here is the quoted documentation:
The issue is that when sending a request with a This is an issue for heavy answers: for big spreadsheets and bad networks the answer can take up to 30 secondes to be received. To reproduce the issue:
|
Hi,
Google JS Script throws an internal execution error it received a request into a protected Google Sheet. It should fail gracefully and provide error information on response object, but the official GoogleSheet data endpoint currently returns an invalid function call, and JavaScript execution fails completely.
The issue seems to be missing reqId parameter on the response. reqId is available when the sheet is public, but it is not included when sheet is private. This seems to be a bug on Google's implementation.
To reproduce:
After tracing the problem, I found that the undefined value is "reqId" parameter to
the google.visualization.Query.setResponse function call, which GoogleSheet API returns.
More specifically, a call to https://docs.google.com/spreadsheets/d/XYZ/gviz/tq returns (if XYZ is protected sheet)
Notice that reqId is not set in this response, but it is expected to be set.
And, if I set the sheet to public, the response is proper, AND includes reqId parameter.
I tried to set the reqId parameter explicitly, but the response does not recognize / include this parameter. So, https://docs.google.com/spreadsheets/d/XYZ/gviz/tq?tqx=reqId:1 does not work either
Any help to gracefully detect sheets that are protected, or a solution a fix to Google API implementation, would be appreciated!
Thanks,
The text was updated successfully, but these errors were encountered: