franky1978 / igoogle-legacy

Automatically exported from code.google.com/p/igoogle-legacy
1 stars 0 forks source link

gadget.io.makeRequest inconsistently returning 502 Bad Gateway requests. #699

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Description of the bug/feature.
==================================
My users and I have been receiving a 502 Bad Gateway request since the 
beginning of Dec 2011.  My code has not changed since a year ago when I was 
getting 502 errors about a year ago.  I have verified the code to be current 
and valid in my gadget.  I have also verified the source feed, which always 
returns data with a HTTP status of 200 OK.  This appears to be related to the 
makeRequest proxy and gadgets proxy.  

Also the issue is very inconsistent, in that on one request the data will come 
back fine from the Google makeRequest proxy and then on the very next request I 
get a 502 Bad Gateway error.

About a year ago I was able to work around the proxy errors by making multiple 
requests until a valid request was received.  It would make 5 attempts to 
receive a valid request.

Currently, even with 5 requests, most of the time, all 5 requests are returned 
with HTTP 502.

What steps will reproduce the problem?
======================================
1. Make a request through gadget.io.makeRequest
2. The obj.rc is the HTTP status code (which has been returning 502 
intermittently).

Example
======================================
If you were using the response as JSON data, it would look like this to check 
for the bad response:

getFeedResponse = function(obj) {

 // get the feed object
 var feed = obj.data;

 // check for error receiving data
 if (obj == undefined || obj.rc != 200) {
  // ERROR
 } else {
  // PROCEED NORMALLY
 }
}

What is the expected output?
============================
  obj.rc = 200

What is the actual output?
==========================
  obj.rc = 502

Additional information below.
=====================================================
As I have mentioned above, this was a problem in the past, but I was able to go 
around the issue by making multiple requests in the hope one would return 
without a HTTP 502 error.  Previous Issues 579 & 592 have shown this happening 
for multiple developers.  My current workaround by making multiple requests 
until a good one has been received, has been having less success recently.  
Many users have been emailing me, and some have even posted in the comments 
section of the gadget about the 502 errors.  Users have posted a fix on the 
comments page, that 'fix' simply makes the gadget not have to make a 
gadget.io.makeRequest.

XML:
http://www.floen.com/ATOM/weather/weather.xml

Directory:
http://www.google.com/ig/directory?hl=en&url=www.floen.com%2FATOM%2Fweather%
2Fweather.xml

Over 400,000 users of this 5 years long running gadget!  Please help us in 
figuring out a real solution.

Original issue reported on code.google.com by floenter...@gmail.com on 14 Dec 2011 at 12:27

GoogleCodeExporter commented 9 years ago
I have also run into the same issue ... What was your solution/workaround?

Original comment by j...@infiflex.com on 17 Nov 2012 at 4:39