We're sorry, a server error occurred. Please wait a bit and try again.

45 views
Skip to first unread message

Alan Wells

unread,
Feb 19, 2020, 12:24:22 PM2/19/20
to Google Apps Script Community
I'm getting a lot of server errors from a Web App.  It won't do anything.
First I was getting errors from running code that seemed to be failing because of a bad RexExp pattern, but now it won't run any code at all.
There are no service disruptions listed in the GSuite Status Dashboard

Dimu Designs

unread,
Feb 19, 2020, 1:09:11 PM2/19/20
to Google Apps Script Community
Is your Web App V8 enabled?

Alan Wells

unread,
Feb 19, 2020, 6:16:38 PM2/19/20
to Google Apps Script Community
No, the "run" menu asks to enable V8, and the appsscript.json shows "runtimeVersion": "DEPRECATED_ES5"
It's seems like the trouble started with a RegExp that was wrong.  But I don't want to start any conspiracy theories.

AD:AM

unread,
Feb 19, 2020, 6:57:16 PM2/19/20
to Google Apps Script Community
Not much to add other than I agree, it is very possible that the regex is the culprit. I've seen the same server error message that has been rectified by fixing up regex.

I don't pretend to understand how it all works, but perhaps the regex is being farmed out to another service somewhere, and the Apps Script engine isn't managing the return of certain errors?

Anyway, feel free to post your regex usage in case someone can spot an issue.

Cheers
Adam

Alan Wells

unread,
Feb 19, 2020, 7:23:49 PM2/19/20
to Google Apps Script Community
If I remove the following lines of code:

    if (po.toFind === 'obj') {
      re
= /\= \{|\={/gm;//Create a new reg exp
   
} else {
      re
= /\= function|\=function/gm;//Create a new reg exp
   
}


The error:

We're sorry, a server error occurred. Please wait a bit and try again.

goes away.

If I change:
re = /\= \{|\={/gm;

to:
re = /\= \{|\=}/gm;

The error goes away.

So, the code must be getting parsed different during a save operation and before code execution.

AD:AM

unread,
Feb 19, 2020, 7:52:05 PM2/19/20
to Google Apps Script Community
Should the second curly brace be escaped as well?

Alan Wells

unread,
Feb 19, 2020, 7:59:38 PM2/19/20
to Google Apps Script Community
Yes, thanks for pointing that out.
Reply all
Reply to author
Forward
0 new messages