Error: Service Spreadsheets timed out while accessing document with id

71 views
Skip to first unread message

Tech Training

unread,
Nov 4, 2024, 2:56:37 AMNov 4
to Google Apps Script Community
This started happening in september, but just a couple, now it almost all the time. Happens every day.  The program has been running for years.

Has there been any changes in the google servcies?

I also find the system takes more than twice as long to do anything?

The google app script presents the user with a webpage to fill out a custom form.
After the user completes the form, they click submit, and the client send all data to the server. (code.gs)

Then the server takes the information
  1. creates a pdf
  2. saves the pdf to google drive
  3. sends an email
  4. updates a google sheet #1 (adds 1 row to the bottom, 1st tab)
  5. updates a google sheet #2 (adds 1 row to the bottom, 1st tab)
  6. updates a google sheet #3 if needed 
    1. Tab 1: Adds 1 row to the bottom
    2. Tab 2: Adds n rows to the bottom (typical 2-6)
    3. tab 3:  Adds n rows to the bottom (typical 2-6)
    4. Tab 4: updates an existing cell
This use to take about 60 seconds, but now it is showing that it is taking 5 minutes most of the time, with a couple taking 14 minutes.

Any thought anyone?

Edward Wu

unread,
Nov 4, 2024, 12:32:18 PMNov 4
to google-apps-sc...@googlegroups.com
We've had similar issues with time-outs for scripts that've worked for years.

I believe these are all related to this ticket: https://issuetracker.google.com/issues/373461929

In our case, we have a "dispatcher" script that just copies info from multiple spreadsheets to other spreadsheets. Copies that used to take 10-20 seconds now can take 2-3+ mins.
Just this weekend, I discovered that doing a setValue() to *one* cell took upwards of 20-40 seconds!

Unfortunately, we seem to be stuck until Google gets their act together.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/4e0824a4-8829-4568-bfa6-8710492a12ban%40googlegroups.com.

George Ghanem

unread,
Nov 4, 2024, 3:00:37 PMNov 4
to google-apps-sc...@googlegroups.com
I have also seen some of my triggers fail recently with reached max execution time even though when you runs them manually the complete within 10 secs.

I suspect traffic on the Google servers causing slowdowns. But do not really know. I hope Google personnel are monitoring this as part of their performance monitoribg and will get to the bottom of these issues soon.

But you can also open up an issue on this if you like.


--

Tech Training

unread,
Nov 5, 2024, 11:46:17 AMNov 5
to Google Apps Script Community
I just created an issue:
https://issuetracker.google.com/issues/377475531
If anyone else is having this issue please add at this url

George Ghanem

unread,
Nov 5, 2024, 12:26:02 PMNov 5
to google-apps-sc...@googlegroups.com

Tech Training

unread,
Nov 6, 2024, 3:53:00 PMNov 6
to Google Apps Script Community
I applied the solutions others have provided in the past.
Making a new spreadsheet of the data didn't make a difference.
But I did add Flush and Sleep as shown below, as well as reducing the strain on the spreadsheet by removing autoResize, has now gotten the function down to 15-40 seconds  instead of the 5-14 mintues.

Hope this helps someone else.

---------------------------------------------------------------------------------------------
          currentRange.setNumberFormats([formatArray])
                .setValues([dataArray])
                .setFontWeight('normal')
                .setHorizontalAlignment('center');

          SpreadsheetApp.flush();
          Utilities.sleep(1000);

    //theSheet.autoResizeColumns(1, numOfColumns);
---------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages