DoGet not called with state parameter name, server error received

since for a few days when I try to call all the scripts as a service with the “state” parameter, I get the strange “Google Docs encountered a server error”, the doGet method is never called!

Please confirm that something has changed?

Steps to reproduce the problem:

  • Create simple script applications using getMethod only

      function doGet (e) {
           Logger.log ("doGet");
           MailApp.sendEmail (" xxxxxxxx@gmail.com ", "Log", Logger.getLog ());
    
    
    
    var app = UiApp.createApplication(); return app; } 
  • Publish service

  • Call the script from the "state" parameter passed by the browser

    https://sites.google.com/macros/exec?service=AKfycbwrrSzd5PM07HgmuOSE1UsXxO9MmGTEOEwvXQC1&state=sample_parameter

  • The server returns an error:

      Google Docs has encountered a server error.  If reloading the page doesn't help, please contact us.
    
    
     To discuss this or other issues, visit the Google Docs Help forum. To see the list of known problems, check the Google Docs Known Issues page. Sorry, and thanks for your help! - The Google Docs Team 

I also opened issue

Thanks to everyone, Francesco

EDIT: issue fixed! Thanks to everyone.

+4
source share
2 answers

Reporting the problem was correct. But note that this probably won't be “fixed” the way you want. They probably just include in the documentation that you cannot use a parameter called state.

The solution is only to use a different name, for example. myState or something else. Not very annoying or hard to do IMHO.

+2
source

Looks similar to release 1336 ( http://code.google.com/p/google-apps-script-issues/issues/detail?id=1336 ), although this problem has been fixed. Can you try authorizing your script.

0
source

Source: https://habr.com/ru/post/1414523/


All Articles