gwtupload icon indicating copy to clipboard operation
gwtupload copied to clipboard

Infinite loop onSubmitComplete

Open payammeyer opened this issue 10 years ago • 18 comments

The uploader gets stuck on an infinite loop in some browsers and in Chrome just fails to upload with the following error locally and also in production (local example below):

2015-05-07 10:59:15,508 [qtp540507577-244] <ERROR> server.UploadServlet: checkCORS error Origin: http://127.0.0.1:8888 does not match:^$ 2015-05-07 10:59:15,508 [qtp540507577-244] <INFO> server.UploadListener: UploadListener 18xqh1adxmbqu573spu3zou4 remove: total=79162 done=79162 cancelled=false finished=true saved=Thu May 07 10:53:27 EDT 2015 2015-05-07 10:59:15,508 [qtp540507577-244] <INFO> server.UploadListener: UploadListener created new instance. (slow=20, requestSize=181014) 2015-05-07 10:59:15,508 [qtp540507577-244] <ERROR> server.UploadServlet: UPLOAD-SERVLET (18xqh1adxmbqu573spu3zou4) parsing HTTP POST request 2015-05-07 10:59:16,701 [qtp540507577-244] <ERROR> server.UploadServlet: UPLOAD-SERVLET (18xqh1adxmbqu573spu3zou4) parsed request, 4 items received.

This issue is also referenced here:

https://code.google.com/p/gwtupload/issues/detail?id=209

payammeyer avatar May 07 '15 15:05 payammeyer

I confirmed that this issue started happening when we upgraded to the 1.0.3 release, moving back to the 1.0.2-SNAPSHOT at least makes it work.

payammeyer avatar May 07 '15 15:05 payammeyer

Confirmed that 1.0.1 works fine as well

frandevel avatar Jun 03 '15 11:06 frandevel

I have the same issue ... any workaround ?

zouabimourad avatar Nov 02 '15 11:11 zouabimourad

@zouabimourad In our case, we moved back to v1.0.1

frandevel avatar Nov 02 '15 11:11 frandevel

@frandevel i'm using gwt 2.7.0 ... v1.0.1 doesn't work well with gwt 2.7.0

zouabimourad avatar Nov 02 '15 11:11 zouabimourad

@zouabimourad we did not move forward to 2.7.0 because of having very serious compilation time issues. It was taking more than 50% more to compile. We stick to GWT 2.6.1 and gwtupload 1.0.1

frandevel avatar Nov 02 '15 11:11 frandevel

@zouabimourad try 1.0.2-SNAPSHOT as I mentioned, works ok with 2.7.0, but really the GWT community desperately needs another uploader. I started wrapping jquery uploader but never got around to finishing it, feel free to find it in my repos and contribute.

@frandevel I'm very surprised to hear you had slow compile issues, one of the biggest advantages of 2.7 was a much better and faster compiler. Curious what the real slow down is.

payammeyer avatar Nov 02 '15 11:11 payammeyer

Reason for this issue seems to be a combination of two things:

  • Re-attaching the iFrame after upload fires another onSubmitComplete event with an empty response (as already stated in https://code.google.com/p/gwtupload/issues/detail?id=209)
  • Error handling in Uploader#onSubmitComplete() triggers updateStatusTimer again and again in case of XML parsing error ("" cannot be parsed). This causes the endless loop.

Fix could be to just ignore empty content in onSubmitComplete or disabling re-attach of iFrame if not needed.

stefanroeck avatar Dec 02 '15 12:12 stefanroeck

Any news on that? I also have the same loops with 1.03 and GWT 2.7. The combination GWT 2.6.1 and 1.01 works really well!!!

@stefanroeck what do you mean with reataching the iFrame?

Thanks Andy

ghost avatar Mar 10 '16 14:03 ghost

Currently 1.0.3 on GWT 2.8 beta is working for me, at least on Chrome.

payammeyer avatar Mar 10 '16 14:03 payammeyer

On Chrome... 2.7 and 1.0.3 is working as well... But not on Firefox. Chrome and all related Browsers have no issues

ghost avatar Mar 10 '16 15:03 ghost

Does it solved? I have the same problem on firefox. gwtupload 1.0.3 gwt 2.7

colingan avatar Apr 12 '16 13:04 colingan

Having the same issue on Firefox and IE, unfortunately this project doesn't seem to be maintained anymore.

payammeyer avatar Apr 12 '16 13:04 payammeyer

This patch worked for me gwtUpload.patch.txt

stefanroeck avatar Apr 12 '16 17:04 stefanroeck

Thanks so much for sharing that patch, I submitted a PR (https://github.com/manolo/gwtupload/pull/20) though I doubt it would get pulled, solves my problem though.

payammeyer avatar Apr 12 '16 19:04 payammeyer

I'm afraid stefanroeck's patch brings back another issue reatachIframe() was supposed to fix: http://stackoverflow.com/questions/27711821 . So, my understanding is the iframe still needs to be reattached but the way reatachIframe() does it via JS doesn't work well with GWT's FormPanel. Once the iframe is reattached in FireFox and most likely IE, FormPanel fires deferred SubmitCompleteEvent that causes the issue. I attempted to reattach the iframe by removing and adding back the form panel via GWT API and it seemed have fixed the issue in one particular place I tested but it needs more testing. Here's the diff: ST-patch-diff.txt

stezadov avatar Apr 14 '16 11:04 stezadov

Hi! Is there a solution for this problem?

smdb21 avatar Sep 12 '18 21:09 smdb21

The Pull request #20 (it solves the problem) has been merged but there is no released version including the fix commmit. You can checkout the master and release it locally and deploy the artifact in your network maven repository.

zouabimourad avatar Sep 12 '18 21:09 zouabimourad