# jsRoot: Empty file that is not really empty

**URL:** <https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471>\
**Category:** Newbie\
**Tags:** jsroot\
**Created:** [February 9, 2021, 4:19pm UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471 "2021-02-09T16:19:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![aporeba](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@aporeba](https://root-forum.cern.ch/u/aporeba)\
**Post date:** [February 9, 2021, 4:19pm UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/1 "2021-02-09T16:19:35Z")

</div>

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

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

```

but I’m getting an error:

```auto
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)

* * *

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 9, 2021, 4:27pm UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/2 "2021-02-09T16:27:09Z")

</div>

Hi @aporeba ,  
and welcome to the ROOT forum.

Pinging our jsROOT experts @bellenot and @linev .

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 9, 2021, 4:31pm UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/3 "2021-02-09T16:31:17Z")

</div>

Hi @aporeba,

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

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![aporeba](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@aporeba](https://root-forum.cern.ch/u/aporeba)\
**Post date:** [February 9, 2021, 4:48pm UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/4 "2021-02-09T16:48:54Z")

</div>

Hi @linev  
here’s the file [CERNBox](https://cernbox.cern.ch/index.php/s/o5NumwFTzsLEMyP)  
Aleksandra

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 10, 2021, 7:01am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/5 "2021-02-10T07:01:51Z")

</div>

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](https://its.cern.ch/jira/browse/CERNBOX-1004)

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 10, 2021, 7:31am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/6 "2021-02-10T07:31:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 10, 2021, 7:42am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/7 "2021-02-10T07:42:51Z")

</div>

Hi Aleksandra,

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

```auto
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

---

<div class="post-metadata">

**Author:** ![aporeba](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@aporeba](https://root-forum.cern.ch/u/aporeba)\
**Post date:** [February 10, 2021, 7:48am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/8 "2021-02-10T07:48:07Z")

</div>

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:

```auto
root TrigCostRoot_Results.root

```

It’s containg just ROOT TTree.  
Regards,  
Aleksandra

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 10, 2021, 7:55am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/9 "2021-02-10T07:55:45Z")

</div>

> 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:

 ![screenshot](https://root-forum.cern.ch/uploads/default/original/3X/d/3/d3a344b2725a57a086b2e43605c8c2994283b179.png)

---

<div class="post-metadata">

**Author:** ![aporeba](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@aporeba](https://root-forum.cern.ch/u/aporeba)\
**Post date:** [February 10, 2021, 8:00am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/10 "2021-02-10T08:00:22Z")

</div>

ROOT version is:

```auto
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

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [February 10, 2021, 8:24am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/11 "2021-02-10T08:24:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aporeba](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@aporeba](https://root-forum.cern.ch/u/aporeba)\
**Post date:** [February 10, 2021, 8:52am UTC](https://root-forum.cern.ch/t/jsroot-empty-file-that-is-not-really-empty/43471/12 "2021-02-10T08:52:45Z")

</div>

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