jsRoot: Empty file that is not really empty

Hi,
I am trying to open and read ROOT file via jsROOT:

    JSROOT.openFile("file.root")
      .then( file => console.log("ROOT File open!"));

but I’m getting an error:

Error: Empty file file.root

The file is not empty when I’m opening with my local installed root (6.22/00) or pyroot or c++ library.
I am running with vscode live server - the file is present in JSROOT source dir.

Can it be the version difference?

jsROOT Version: 6.0.0
Platform: Ubuntu 20.04.2 LTS + Firefox 85.0 (64 bit)


Hi @aporeba ,
and welcome to the ROOT forum.

Pinging our jsROOT experts @bellenot and @linev .

Hi @aporeba,

Can you provide your ROOT file?
Only then one could try to understand that happens.

Regards,
Sergey

Hi @linev
here’s the file CERNBox
Aleksandra

Hi Aleksandra,

Can you provide only ROOT file?
Unfortunately, CERNBox uses extremely old JSROOT version (from 2015).
If you like, you also can vote for this problem on CERNBOX Jira

Regards,
Sergey

Now I found download button on CERNBox - will check the problem

Hi Aleksandra,

Did you try to open this file with ROOT? I got message:

Warning in <TFile::Init>: no StreamerInfo found in /home/linev/Downloads/TrigCostRoot_Results.root therefore preventing schema evolution when reading this file. The file was produced with version 6.22/00 of ROOT.

It is very special file - without streamer infos inside.
Why you create it this way? And how?

JSROOT does not support such files, while it does not provide streamers for “normal” classes
like TH1 or TAxis. You need to create “normal” file.

I will change message in JSROOT to clarify the problem.

Regards,
Sergey

Hi Sergey,
I was trying to upload the file here but it took a long time (stuck at ~70%) and then gave an error (file is 16,2 MB).

It’s created by athena framework, and I don’t have this warning. I’m opening with:

root TrigCostRoot_Results.root

It’s containg just ROOT TTree.
Regards,
Aleksandra

I was trying to upload the file here but it took a long time (stuck at ~70%) and then gave an error (file is 16,2 MB).

Most probably, on forum file size limit ~10MB. But I already download your file from CERNbox.

It’s created by athena framework, and I don’t have this warning. I’m opening with

Which ROOT version you are using?

When open file, I see a lot of subdirs with TH1 histograms inside. I didnot find any ROOT TTree.
Here screenshot of TBrowser:

ROOT version is:

Welcome to ROOT 6.22/00 

Sorry, it got mixed up with other root file that I’m working on!
Yes, this one contains histograms sorted in directories - I can see the same view.

I will try creating it once again and check for streamers errors

I did not found any legal way to create ROOT file without streamer info.
Seems to be, file does not properly closed at the end - in such case it could miss streamer infos information. In any case - without streamer infos JSROOT will not work.

1 Like

I will look for an issue on creating file side then.
Thanks a lot for your help!
Aleksandra