JSRoot Error Pulling ROOT File From Server

Hello,

I am creating a website that uses JSROOT to draw graphs from ROOT files I have saved on the web server. When I use this syntax:

var filename = "root_files/filename.root";
     JSROOT.OpenFile(filename, function(file) {
        do stuff
        };  

to pull a root file from online (specifically from https://root.cern.ch/js/files/) it works just fine. When I use the HTML syntax to describe the file, it also works just fine.

However, when I try to pull the file from within my apache web server, I get the error message in the console:

JSRootCore.js:894 Server response size 98196148 larger than expected 1224. Abort I/O operation

My root file in question is 98196148 bytes.

I can see that this behavior is determined within JSRootCore.js, but after looking through the script, the reason for this is still confusing to me.

Any help understanding what is going wrong or what to do to fix this would be greatly appreciated

Thank you!
-Steve

Hi Steve,

Error message indicates, that JSROOT tries to read small portion of the file, but much bigger amount of data returned by the server. In most cases it means, that web server ignores “Range” parameter in the HTTP request.

Does error happens when you open file?
Or when you read some objects?

Can you try with curl utility if small part of the file can be read?

Regards,
Sergey

Hi Sergey,

The error occurs when I open the file.

I ran the curl utility to ensure that everything involved had Accept-Ranges: bytes in the http header.

I then used curl to load a small part of my root file and it worked just fine.

Cheers,
Steve

Hi Steve,

Can you send me the link on your file that I can reproduce the problem?

Regards,
Sergey

read_hsimple.tar.gz (430 Bytes)

Hi Sergey,

This is the smallest reproduction of my problem I can make. It is essentially this example (https://root.cern.ch/js/latest/api.htm#custom_html_read_root_file_src), just pulling a copy of hsimple.root from my server rather than from root.cern.ch/js

The following error messages are returned:

JSRootCore.js:894 Server response size 414239 larger than expected 1224. Abort I/O operation

read_hsimple.html:10 Uncaught TypeError: Cannot read property ‘ReadObject’ of null
at read_hsimple.html:10
at Object.JSROOT.CallBack (JSRootCore.js:818)
at JSRootIOEvolution.js:1403
at XMLHttpRequest.read_callback (JSRootIOEvolution.js:1015)
at XMLHttpRequest.xhr.onreadystatechange (JSRootCore.js:895)

Cheers,
Steve

That kind of server you are using?

It’s an apache web server

Did you change MaxRanges configuration of your server?
By default it is 200 - means one could request up to 200 sub-ranges in one request.
JSROOT tries to read 4-5 ranges at once when opening file.
If you set this value to minimum, Apache just returns full file instead.
See info here: https://httpd.apache.org/docs/2.4/mod/core.html#maxranges

Hi,

You could try to install JSROOT on your server and configure fMaxRanges field of JSROOT.TFile class to some minimum. Probably it can help. Just try to change line 872 in JSRootIoEvolution.js file. Default value is 200.

Regards,
Sergey

Hi Sergey,

I confirmed that MaxRanges on the server is 200

On the JSROOT code, I followed your advice and set fMaxRanges to 1; the same error popped up.

Additionally, I put in a few print statements to ensure that the accept_ranges variable (defined at line 912 of JSRootIOEvolution) was returning “bytes”. That is working just fine it would appear.

Cheers,
Steve

Hi,

The only chance I see to resolve the problem - if I get access to your server.
Something wrong with the server - as you confirm normal JSROOT test file does not work with it.
You can send address via private message

Regards,
Sergey

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.