2

I am using Google Sheets API v4 to read a spreadsheet content in my project. It has worked just fine for a few months, but recently I started to get a PERMISSION_DENIED error while reading some, but not all of them.

All the sheets worked properly before, but now some of them can't be read (resulting in PERMISSION_DENIED error) while the other ones still work fine. Also when I create a new sheet it does NOT work.

All the sheets are available for viewing for anyone at the web, I did not change the API key I am using, the sheet owner did not change, some sheets have not even been modified for weeks. Long story short: I did not change anything (that I am aware of) that could impact reading the sheets but yet some of sheets suddenly stopped working.

Has anything changed recently in how Google Sheets API works? Or am I missing something else?

EDIT:

A few hours passed by and some sheets that previously did not work now work and some that did work now don't. The sheets have not been modified in meantime.

May this be caused by reaching any usage limit? I don't get RESOURCE_EXHAUSTED message though. It's PERMISSION_DENIED in each case.

turbolek
  • 39
  • 8
  • Maybe you reached your request limits? Check https://developers.google.com/sheets/api/limits – HaR Jul 11 '18 at 08:31
  • I don't think it's the case, because I get PERMISSION_DENIED error. When I tested how it behaves when I reach the limit (with script that did more requests than allowed) I got RESOURCE_EXHAUSTED error. Also if it was caused by reaching the limit, it should work after 100 seconds of not making any requests but it does not – turbolek Jul 11 '18 at 08:48
  • I checked in developer console and the usage was not even close to the limits – turbolek Jul 11 '18 at 08:57
  • Try these steps [from forum](https://productforums.google.com/forum/#!topic/docs/taKm_Ko9_3M) one at a time: - Try clearing your [Cache/History](https://support.google.com/chrome/answer/95607?hl=en) - Try [Incognito/private window](https://www.google.com/url?q=https%3A%2F%2Fsupport.mozilla.org%2Fen-US%2Fkb%2Fprivate-browsing-browse-web-without-saving-info&sa=D&sntz=1&usg=AFQjCNH5YTK-xMxBa1T3e2zbtbk-KMA4Ew) - Disable [extensions/add-ons/plug-ins](https://support.google.com/chrome/answer/142064?hl=en) - Try a different browser to see if it is a browser related issue – MαπμQμαπkγVπ.0 Jul 11 '18 at 11:03
  • Unfortunately none of this works. I tried various browsers, devices, google users and locations (to check if it is not IP-related issue) with no effect – turbolek Jul 11 '18 at 11:43
  • I'm facing the exact same problem... Did you provide an API key or an OAuth token? – bernland Jul 18 '18 at 12:25
  • I provided an API key. However I made an experiment with OAuth using OAuth2.0 Playground: https://developers.google.com/oauthplayground/ and I tried to read a sheet that had not worked with API key at the moment and it worked with OAuth2.0. Now I am trying to implement OAuth method into my project following this tutorial: https://developers.google.com/identity/protocols/OAuth2ServiceAccount but I'm facing some issues with creating JWT token – turbolek Jul 18 '18 at 13:20
  • Related: https://stackoverflow.com/q/51261332 – tehhowch Jul 18 '18 at 20:46

1 Answers1

1

Turns out it was a bug on Google side. Now everything works as intended.

turbolek
  • 39
  • 8