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
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?
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)
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
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.
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.
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