Flex: HTTP request error #2032

2019-02-25 08:53发布

In Flex 3 application I use HTTPService class to make requests to the server:

var http:HTTPService = new HTTPService();
http.method = 'POST';
http.url = hostUrl;
http.resultFormat = 'e4x';
http.addEventListener(ResultEvent.RESULT, ...);
http.addEventListener(FaultEvent.FAULT, ...);
http.send(params);

The application has Comet-architecture. So it makes long running requests. While waiting a response for this request, other requests can be made concurrently.

The application works in most cases. But sometimes some clients get HTTP request error executing long running request:

faultCode:Server.Error.Request
faultString:'HTTP request error'
faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: http://example.com/ws'

I think it depends on user's browser.

Any ideas?

7条回答
闹够了就滚
2楼-- · 2019-02-25 09:17

Try listening for the HTTP-status of the request, using flash.events.HTTPStatusEvent.HTTP_STATUS
That might give you some more info about what's going wrong.

查看更多
做自己的国王
3楼-- · 2019-02-25 09:26

This error appears very generic and I would suggest trying to collect more information and sharing it regarding the issue.

  • This post appears similar to your situation.
  • This post might help you find more debugging information which would be helpful.
  • Which clients are affected?
  • Can you capture the http status code or the traffic being sent using Charles, Wireshark, or similar?
查看更多
我命由我不由天
4楼-- · 2019-02-25 09:27

I was going to open another question on essentially the same topic, but I figure two unanswered questions is worse than 1.

I get a similar intermittent issue from some users of a Flex application we have, but with some slightly different symptoms. The full range of information I can provide is:

  1. It occurs on short (10ms) requests as well.
  2. It appears to occur randomly.
  3. The connection is over SSL.
  4. It only occurs for users of IE, not for users using FireFox.
  5. Once it occurs, users inform me they need to shut down IE and restart it (some users say they need to reboot, but I think that's less likely than just an IE restart). It appears to require a few minutes to reset itself.
  6. It does not appear to affect the rest of the user's internet connection -they can continue to use other IE windows.
  7. Once it occurs, it appears that no HTTPService request from the flex application will work.
  8. It occurs (apparently) only for a small subset of users. Initially it seemed to be due to their physical distance from the main server, but this no longer appears to be necessarily the case (though it could be connection quality).
  9. I'm not clear on what version of Adobe Flash the users are running. Code was built with Adobe Flex 3.4 (linux)
  10. The application does a wide range of requests, many in parallel though I've not been able to reproduce the problem.
  11. Users do suggest this error occurs after they have come back to the application after a few minutes.
  12. There appears to be no related server side request entry in the server logs, suggesting the request never reaches the server (possibly never leaving the client).
  13. The server responds to all requests with the relevant cache headers to turn of IE caching.

The current workaround we have is to request users run the application in FireFox.

Full dump of the error is:

HTTP Status Code: null
Fault Code: Server.Error.Request
Fault Error ID: null
Fault Detail: Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: https://my.server/url
Fault String: HTTP request error
Fault Name: Error
Fault Message: faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: https://my.server/url'
Root Cause: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]

Many people have mentioned error 2032, a few even mentioning intermittent errors under IE only, but there are no mentions of the solution. If I ever find one, I'll update my post here.

Update

After talking to a user as this occurred, we found the following:

  1. The user could open a new tab in IE, and load the same flex application up fine - so no internet connectivity problems.
  2. The user could, in the tab with the flex app where the error occurs, load up google.com - so there appears to be no connectivity issue related to that specific tab.
  3. The user could copy the address from the tab with the broken app into another tab, and the flex application would load.
  4. The user could, after loading google.com in the tab where the flex app broke, copy in the flex app URL again, and immediately get the problem.

It appears that in my particular application, my flex app manages to break the flash plugin/VM to such an extent that after the break, no further requests to the URL are allowed.

I am so completely stumped by this I'm at the point of suggesting users use FireFox, or wrapping the application in an Air package.

查看更多
Bombasti
5楼-- · 2019-02-25 09:32

Sounds like you might have more connections going out then the browser supports. Do you know exactly how many open connections exist at the time of the error?

Different browser allow different numbers of simultaneous open connections. IE 6,7,8 all allow different amounts: http://support.microsoft.com/kb/282402

Firefox: http://www.speedguide.net/faq_in_q.php?qid=231

查看更多
淡お忘
6楼-- · 2019-02-25 09:33

I've had this exact issue happening in my Air app. I eventually realized that I had accidentally set the urlrequest.idleTimeout to 10. This timeout is actually in milliseconds and my webserver is local, so if I sent no parameters (no get or post) to my local server it would work. Whenever I sent any parameters along with the request of course it would fail because my script took longer than 10ms to run and return the data.

You may want to pay attention to slow loading scripts. You can debug by just forcing some static output and then stop that page from executing further. In my php page I put:

<?php
echo "hello=hi";
die();
?>

Also, make sure to debug it within the sandbox limitations. I am using a self-signed ssl cert and there are a lot of warnings when trying to connect to my local test webserver.

Hope that helps!

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-02-25 09:36

I had somewhat the same problem here but with a Flash (Web - Flex 4.1 SDK) application. after trying out a huge assortment of solutions we narrowed we finally came up with one that works pretty reliably for all systems, including newly installed machines.

A. add global event listeners at the root (or stage) of the application, on flex preinitialize stage.

IOErrorEvent.IO_ERROR
IOErrorEvent.NETWORK_ERROR
HTTPStatusEvent.HTTP_STATUS
ErrorEvent.ERROR
SecurityErrorEvent.SECURITY_ERROR

if an error is cought - event.preventDefault();

B. add event listeners on every loader used in the App for the following errors:

IOErrorEvent.IO_ERROR
SecurityErrorEvent.SECURITY_ERROR
HTTPStatusEvent.HTTP_STATUS

*to attempt recovery, like falling back to an external interface call...

C. place all the SWZ files from the bin-release folder together with the SWF file in the same path on the server you use to deliver your App. in my case these are the files needed:

sparkskins_4.5.1.21328.swz
spark_4.5.1.21328.swz
textLayout_2.0.0.232.swz
rpc_4.5.1.21328.swz
osmf_1.0.0.16316.swz
framework_4.5.1.21328.swz

* to discover this i used Chrome developer console to see which errors occur on the page and discovered a chain of 404s when the app tries to download these files.

D. have a properly configured crossdomain.xml policy file which includes the allow http request xml tag.

<allow-http-request-headers-from domain="*" headers="*"/>

replace the * as needed in your particular case.

Cheers

查看更多
登录 后发表回答