Error 500: Server Error Request Too Large

252 views
Skip to first unread message

rjo...@gmail.com

unread,
Sep 14, 2015, 5:31:10 PM9/14/15
to Orthanc Users
Hi Everybody,

I'm testing Orthanc with the dwv viewer plugin. I uploaded a DICOM series with 362 instances and when I tried to launch the viewer I get the following error:

Error 500: Server Error Request Too Large

My sense is that the URI request is larger than the max expected value for the MongooseServer.

Someone else reported the same issue on the dwv github
https://github.com/ivmartel/dwv-orthanc-plugin/issues/9

Have anybody found a similar problem? I don't have much experience with MongooseSever but I was wondering if there is a setting to increase the max request length.

Thanks

Raul

Sébastien Jodogne

unread,
Sep 15, 2015, 3:23:49 AM9/15/15
to Orthanc Users, rjo...@gmail.com
Hello,

This problem is related to the DWV plugin, as this viewer receives all the instances to display as HTTP GET arguments:

But, such URL-encoded strings are limited to 8000 characters for maximal compatibility: 

As any Orthanc identifier has a length of 44 characters, this limits the size of the series DWV can display to about 180 instances (= 8000/44). According to this rough computation, any series that is made of more than 180 instances will result in an error.

At this point, you have two possibilities:
  • Ask Yves (DWV's author) to support POST requests instead of GET requests. This will remove any limitation on the number of instances in the series.
  • Resort to the official Web viewer plugin for Orthanc that supports series of arbitrary length: http://www.orthanc-server.com/static.php?page=web-viewer
HTH,
Sébastien-

ivma...@gmail.com

unread,
Nov 12, 2015, 6:20:30 AM11/12/15
to Orthanc Users, rjo...@gmail.com
Hi, I'm looking into this one and am not sure what to do...

As far as I get it, POST requests cannot be parsed using javascript on the client side ((weak ref)[http://stackoverflow.com/questions/1409013/how-to-read-the-post-request-parameters-using-javascript]).

The other solution could be to use HTML5 local storage. Storage can be shared between pages of the same origin so that means that the viewer is on the same server as Orthanc which is the case here. Would that be ok and solve this problem?

On Tuesday, September 15, 2015 at 9:23:49 AM UTC+2, Sébastien Jodogne wrote:
> Hello,
>
>
> This problem is related to the DWV plugin, as this viewer receives all the instances to display as HTTP GET arguments:
> https://en.wikipedia.org/wiki/Query_string
>
>
>
> But, such URL-encoded strings are limited to 8000 characters for maximal compatibility: 
> https://en.wikipedia.org/wiki/Query_string#Compatibility_issues
>
>
>
> As any Orthanc identifier has a length of 44 characters, this limits the size of the series DWV can display to about 180 instances (= 8000/44). According to this rough computation, any series that is made of more than 180 instances will result in an error.
>
>
> At this point, you have two possibilities:
> Ask Yves (DWV's author) to support POST requests instead of GET requests. This will remove any limitation on the number of instances in the series.Resort to the official Web viewer plugin for Orthanc that supports series of arbitrary length: http://www.orthanc-server.com/static.php?page=web-viewer

Sébastien Jodogne

unread,
Nov 12, 2015, 6:25:17 AM11/12/15
to Orthanc Users, rjo...@gmail.com, ivma...@gmail.com
Hi,

AFAIC, I would rather favor a handling of the POST body by the C/C++ plugin.

The callback could render a HTML page that would contain a dynamically generated JavaScript array that is filled with the instances identifiers that were found in the POST body.

HTH,
Sébastien-

ivma...@gmail.com

unread,
Nov 12, 2015, 9:14:05 AM11/12/15
to Orthanc Users, rjo...@gmail.com, ivma...@gmail.com
OK, I'm looking into the dynamical JavaScript generation in the C/C++ plugin. Would you have any pointers to help/examples on the topic? I can put the array definition in a std::string but then, how do you 'append' it to the AnswerBuffer.

Thanks,
Yves

Sébastien Jodogne

unread,
Nov 12, 2015, 9:27:16 AM11/12/15
to Orthanc Users, rjo...@gmail.com, ivma...@gmail.com
You will have to do all the string manipulations inside the C/C++ code, then call AnswerBuffer.

You could for instance use a regular expression to make the templating.

ivma...@gmail.com

unread,
Nov 17, 2015, 4:23:50 AM11/17/15
to Orthanc Users, rjo...@gmail.com
Ok, I have a working version on a branch: https://github.com/ivmartel/dwv-orthanc-plugin/tree/11-http-post.
Sébastien, I followed your advice, if you have a second to check it that would be nice.
If no one has problems with it, I will merge it into master.

Sébastien Jodogne

unread,
Nov 17, 2015, 6:15:59 AM11/17/15
to Orthanc Users, rjo...@gmail.com, ivma...@gmail.com
Hi,

Thanks for your work on this!

You will find attached a patch to make your plugin work against the forthcoming Orthanc 0.9.5 release.

Unfortunately, I still get the same error when opening a CT series with about 500 images (by clicking on the "Series viewer" button):


By clicking on this button, a GET request is trigger (to an URL that still contains the full list of instances), instead of the POST request. I use the code in branch "11-http-post".

Sébastien-
Orthanc-0.9.5.patch

Sébastien Jodogne

unread,
Nov 17, 2015, 7:25:23 AM11/17/15
to Orthanc Users, rjo...@gmail.com, ivma...@gmail.com
Dear Yves,

Sorry, my mistake: I was not in the proper branch. Everything works fine!

You will find attached the patch against the right branch.

The only problem I see now is that when opening a large series, the spinner indicating the progress of the load process does not go from 1% to 100%, but is constantly reset to 1%.

Sébastien-
Orthanc-0.9.5-2.patch

ivma...@gmail.com

unread,
Nov 17, 2015, 8:58:57 AM11/17/15
to Orthanc Users, rjo...@gmail.com
Ok, all good then! I will first merge this branch, apply your patch and update dwv to the latest version. I will have a look at the progress and fix it in the next dwv release.

On Tuesday, November 17, 2015 at 1:25:23 PM UTC+1, Sébastien Jodogne wrote:
> Dear Yves,
>
>
> Sorry, my mistake: I was not in the proper branch. Everything works fine!
>
>
> You will find attached the patch against the right branch.
>
>
> The only problem I see now is that when opening a large series, the spinner indicating the progress of the load process does not go from 1% to 100%, but is constantly reset to 1%.
>
>
> Sébastien-
>
>
>
>
> On Tuesday, November 17, 2015 at 12:15:59 PM UTC+1, Sébastien Jodogne wrote:
> Hi,
>
>
> Thanks for your work on this!
>
>
> You will find attached a patch to make your plugin work against the forthcoming Orthanc 0.9.5 release.
>
>
> Unfortunately, I still get the same error when opening a CT series with about 500 images (by clicking on the "Series viewer" button):
>
>
>
>
>

ivma...@gmail.com

unread,
Nov 18, 2015, 5:47:31 AM11/18/15
to Orthanc Users, rjo...@gmail.com
Hi, I've merged this branch in the master of the plugin and integrated the patch from Sébastien.
Until now, I was testing using Google Chrome and everything works if you allow pop-ups for the Orthanc server host. I realised that the view buttons do not work in Firefox. Does anyone know if it is an error in the code or some Firefox setting I am missing?

ivma...@gmail.com

unread,
Nov 23, 2015, 3:12:08 PM11/23/15
to Orthanc Users, rjo...@gmail.com
Ok, got it, you need to append the form to the document before sending to make it work for Firefox. I just published a new release.
Reply all
Reply to author
Forward
0 new messages