Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 为什么500内部服务器会突然出错_Google Apps Script_Internal Server Error - Fatal编程技术网

Google apps script 为什么500内部服务器会突然出错

Google apps script 为什么500内部服务器会突然出错,google-apps-script,internal-server-error,Google Apps Script,Internal Server Error,我在谷歌表单上有应用程序脚本,我的客户端都有。他们的GS上有它的副本和单独的应用程序脚本 直到最近几天,一切都很顺利 我在一次对脚本的POST调用中无缘无故地得到了这个“500内部服务器错误”——这是在以前工作正常的情况下得到的。为了解决这个问题,我再次发布了脚本,它创建了一个新的URL(这很麻烦),然后我必须获取新的URL并将其插入到该客户端的应用程序中。真是一团糟 首先,为什么这些脚本URL现在会出现内部服务器错误?这以前从未发生过。我现在至少安装了30台,而且还在增长。这个错误只是随机的

我在谷歌表单上有应用程序脚本,我的客户端都有。他们的GS上有它的副本和单独的应用程序脚本

直到最近几天,一切都很顺利

我在一次对脚本的POST调用中无缘无故地得到了这个“500内部服务器错误”——这是在以前工作正常的情况下得到的。为了解决这个问题,我再次发布了脚本,它创建了一个新的URL(这很麻烦),然后我必须获取新的URL并将其插入到该客户端的应用程序中。真是一团糟

首先,为什么这些脚本URL现在会出现内部服务器错误?这以前从未发生过。我现在至少安装了30台,而且还在增长。这个错误只是随机的

我怎样才能解决这个问题

错误:

Level
Type    Description Date
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbyJC-oXU9k5ijJc7vlvmT3xWNOZLBfl6RjjNqSU/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
14 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
17 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
21 hours ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbyJC-oXU9k5ijJc7vlvmT3xWNOZLBfl6RjjNqSU/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
Error
Dynamic Block   
Server error: `POST https://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec` resulted in a `500 Internal Server Error` response: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Fehl (truncated...)
2 days ago
级别
类型说明日期
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbyJC-oXU9k5ijJc7vlvmT3xWNOZLBfl6RjjNqSU/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
14小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
17小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
21小时前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbyJC-oXU9k5ijJc7vlvmT3xWNOZLBfl6RjjNqSU/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
错误
动态块
服务器错误:`POSThttps://script.google.com/macros/s/AKfycbwmwyNADRdyBT6PUEBcuwv17EsQBTpTjfVwRbFpUw/exec`导致“500内部服务器错误”响应:Fehl(已截断…)
两天前
代码:

函数doPost(e){
var电子表格=SpreadsheetApp.getActiveSpreadsheet();
var sheet=SpreadsheetApp.setActiveSheet(spreadsheet.getSheets()[2]);
function doPost(e) {

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = SpreadsheetApp.setActiveSheet(spreadsheet.getSheets()[2]);

  var data = sheet.getDataRange().getValues();

  var sub_json = JSON.parse(e.postData.contents);

  var zip = sub_json.custom_fields.CS_Intent.toLowerCase() 

  var area = []

  area = check_area(data,zip);

  if (area[0] != '') {
    return buildUpdateCUF(area);
  }
  else
  {
    return notFound() 
  }
}

//=====================================================================================================
//  Pull the City Name and State Name from Google Sheets if we find a match to the zip code entered 
//=====================================================================================================

function check_area(data,zip) {

  var areaName = '';
  var areaState = '';

  for (var i = 1; i < data.length; i++) {

    var zipCode = data[i][0].toString()

    if (zip.indexOf(zipCode)>-1) {
      areaName =  data[i][1]
      areaState =  data[i][2]
    }

    var cityName = data[i][1].toString().toLowerCase() 

    if (zip.indexOf(cityName)>-1) {
      areaName =  data[i][1]
      areaState =  data[i][2]
    }

  }
  return [areaName,areaState] 
}


//=====================================================================================================
//  Build the ManyChat Actions JSON to Add the Tag and update CUFs
//=====================================================================================================


function buildUpdateCUF(area) {
  var output = JSON.stringify({
  version: "v2",
  content: {
    "actions": [  
         { 
          "action": "add_tag",
          "tag_name": "CS_Service_Area_Yes"
         },
         {
          "action": "set_field_value",
          "field_name": "CS_City",
          "value": area[0]
         },
         {
          "action": "set_field_value",
          "field_name": "CS_State",
          "value": area[1]
         }
     ] 
  }
});

  return ContentService.createTextOutput(output).setMimeType(ContentService.MimeType.JSON);
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  Could not find zip code in service area
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


function notFound() {
  var output = JSON.stringify({
    version: "v2",
    content: {
    "actions": [  
         { 
          "action": "remove_tag",
          "tag_name": "CS_Service_Area_Yes"
         }
     ] 
  }
});
  return ContentService.createTextOutput(output).setMimeType(ContentService.MimeType.JSON);
}