【问题标题】:Google Java api - error "com.google.gdata.util.ServiceException: Bad Gateway" during feed.insert(entry)Google Java api - 在 feed.insert(entry) 期间出现错误“com.google.gdata.util.ServiceException: Bad Gateway”
【发布时间】:2014-11-03 23:36:03
【问题描述】:

我在电子表格中有两个工作表。如果满足某些条件,我会将值从一张纸复制并更改为另一张纸。它工作了 2 周,从昨天开始出现这个问题。没有进行任何更改。执行此语句时出现下面提到的错误消息。

请注意,此错误并非总是出现,并且在迭代一些 for 循环后也会出现错误,有时当 x=10 有时当 x=100 或 x=500 时

导致错误的代码:

 for (int x=1; x <= row_TODAY_WS;x++){
    for(int y=1; y <= col_TODAY_WS;y++){
       CellEntry newEntry = new CellEntry (x, y, feed_cell_0.getEntries().get(i).getPlainTextContent());
       feed_1.insert(newEntry);
      i++;
    }
  }

错误信息:

com.google.gdata.util.ServiceException: Bad Gateway
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 502 (Server Error)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-heipx 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{cation:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.gors/logo_sm_2.png) no-repeat}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/errors/logo_sm_2_hr.png) no-repeat 0%order-image:url(//www.google.com/images/errors/logo_sm_2_hr.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.goog/logo_sm_2_hr.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:55px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>502.</b> <ins>That?s an error.</ins>
  <p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.  <ins>That?s all we know.</ins>

        at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:632)
        at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
        at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
        at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
        at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
        at com.google.gdata.client.Service.insert(Service.java:1409)
        at com.google.gdata.client.GoogleService.insert(GoogleService.java:613)
        at com.google.gdata.data.BaseFeed.insert(BaseFeed.java:535)

【问题讨论】:

    标签: java google-api google-sheets google-spreadsheet-api google-api-java-client


    【解决方案1】:

    HTTP error 502 (Bad Gateway) 是服务器错误。运行电子表格 API 所涉及的其中一台 Google 服务器似乎存在问题。问题不在于您的代码。

    您的计算机联系了 Google 服务器,该服务器充当实际执行工作的服务器的代理。然后,第二台服务器遇到了某种问题,这意味着它无法向代理服务器返回有效响应,然后代理可以将其传回给您。结果,代理服务器向您发送了一个 HTTP 502 响应。

    我希望 Google 的系统足够智能,能够检测到这些问题并自动通知 Google 工程师。也许谷歌的某个人现在正在解决这个问题。但是,我不为 Google 工作,所以我不能肯定地说这是真的。

    如果不出意外,您可以尝试在Google Spreadsheets API 论坛上发帖。

    【讨论】:

      猜你喜欢
      • 2021-03-31
      • 2014-02-22
      • 1970-01-01
      • 2021-08-03
      • 2016-11-13
      • 2010-09-15
      • 1970-01-01
      • 2017-08-08
      • 1970-01-01
      相关资源
      最近更新 更多