question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suddenly Getting 403 Errors ... on a Public Spreadsheet

See original GitHub issue

I have a publicly shared spreadsheet (I can open it up in Incognito Mode just fine). I have a script, written with google-spreadsheet, which updates that spreadsheet. It used to work great.

Now however when I try to use the library I get 403 errors:

Error: Google API error - [403] The caller does not have permission
    at createError (/home/me/project/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/me/project/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/me/project/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

… which makes no sense, because again the spreadsheet is public: no one should get a 403 when accessing it. Plus, I am giving access to the script when I access the sheet:

const doc = new GoogleSpreadsheet(spreadsheetUrl);
const credentials = JSON.parse(await readFile(CREDENTIALS_PATH, 'utf8'));
await doc.useServiceAccountAuth(credentials);
await doc.loadInfo(); // loads document properties and worksheets

(where CREDENTIALS_PATH is a working path to a credentials JSON file from Google).

Is there any possibility this library could be reporting false 403 errors, because again it shouldn’t even possible to get legitimate ones on a public spreadsheet.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Productivixcommented, Jun 3, 2022

Hi Theo, nice concrete proposal, thanks. I beg your pardon ,your program works well : I made a mistake in my sheet sharing “full shared” I had selected : reading only . I made a test with “editor” and it works well as you documented (https://theoephraim.github.io/node-google-spreadsheet/#/?id=the-basics) - that is solved for me May be @machineghosh , you made the same mistake ?

1reaction
Productivixcommented, Jun 2, 2022

Hi, I made tests today with this very clear lib, thanks to Theo, and I have only access in reading (no adding, update) on a full shared GGsheet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

403 PERMISSION_DENIED [111262653] - Visible to Public
We suddenly started getting 403 responses from our API. ... Please file a new bug with sample spreadsheets and the full error messages...
Read more >
403 Forbidden Error: What It Is and How to Fix It - Airbrake Blog
The most common cause of a 403 Forbidden Error is simply inputting an incorrect URL. As discussed before, many tightly secured web servers ......
Read more >
Getting 403 from Google Sheets API using apikey [closed]
This seems to be an error on google's side. ... See related question: Cannot access public sheet with Sheets API.
Read more >
Issues with Google Drive - AppSheet Help
Users of Google Drive can sometimes see Error 403 (permission denied) or Error 404 (not found). There are a few common reasons for...
Read more >
403 Forbidden error: What it is and how to fix it - Allconnect.com
The reason might be within your control – but it's more likely caused by something on the content owner or server side. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found