Google Java api - error “com.google.gdata.util.Ser

2019-03-03 14:40发布

I am having two worksheets in a spreadsheet. I will copy and change the value from one sheet to other if some conditions are met. It is working for 2 weeks and getting this issue from yesterday. No changes were made. Below mentioned error message is coming when executing this statement.

Please note that this error is coming not all the times and also error is coming after iterating some for loops, sometimes when x=10 sometimes when x=100 or x=500

CODE CAUSING THE ERROR:

 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++;
    }
  }

ERROR MESSAGE :

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)

1条回答
手持菜刀,她持情操
2楼-- · 2019-03-03 15:09

HTTP error 502 (Bad Gateway) is a server error. There looks to be a problem with one of the Google servers involved in running the spreadsheets API. The problem isn't with your code.

Your computer contacted a Google server, which acted as a proxy for the server that would actually do the work. This second server then encountered a problem of some kind which meant that it could not return a valid response to the proxy server which the proxy could then pass back to you. As a result, the proxy server sent you back an HTTP 502 response.

I would hope that Google's systems would be smart enough to detect these problems and notify Google engineers automatically. Perhaps someone from Google is working on the problem right now. However, I don't work for Google so I can't say that this is true for sure.

If nothing else, you could try posting on the Google Spreadsheets API forum.

查看更多
登录 后发表回答