TFile error


I am loading ~159 root files, which have several Ttrees in it, into a big TChain, then I loop over all the events in the TChain from time to time (I guess for every file) I get this error message:

Error in TFile::ReadBuffer: error reading all requested bytes from file /afs/, got 0 of 1032

Does anyone know what it could be related to?


Humm … somehow the underlying file i/o unix library is unable to read the file (is it accessible? is it corrupted?). You should check that the file listed is properly accessible and have the proper length.



when I load the file to a Cint Root session it seems there is no such error message:

~/scratch.0/data/hitfit/5200$ root -l user.BalintRadics.TopView121302_MuidTauRec_balint.trig1_misal1_mc12.005200.T1
root [0]
Attaching file user.BalintRadics.TopView121302_MuidTauRec_balint.trig1_misal1_mc12.005200.T1_McAtNlo_Jimmyv12000601.098.AANT0._0010
6.root as _file0…
Warning in TClass::TClass: no dictionary for class AttributeListLayout is available
Warning in TClass::TClass: no dictionary for class pair<string,string> is available
root [1] .ls
TFile** user.BalintRadics.TopView121302_MuidTauRec_balint.trig1_misal1_mc12.005200.T1_McAtNlo_Jimmyv12000601.098.AANT0._001
TFile* user.BalintRadics.TopView121302_MuidTauRec_balint.trig1_misal1_mc12.005200.T1_McAtNlo_Jimmyv12000601.098.AANT0._001
KEY: AttributeListLayout Schema;1
KEY: TDirectory TruthHistogram;1 TruthHistogram
KEY: TDirectory RecoHistogram;1 RecoHistogram
KEY: TTree CollectionTree;1 CollectionTree
KEY: TTree Trigger0;1 Trigger0
KEY: TTree Truth0;1 Truth0
KEY: TTree FullReco0;1 FullReco0
KEY: TTree FastSim0;1 FastSim0
KEY: TTree TruthAna0;1 TruthAna0
KEY: TTree FullRecoAna0;1 FullRecoAna0
KEY: TTree FastSimAna0;1 FastSimAna0
root [2] for(int i = 0; i < FullRecoAna0->GetEntries(); i++)FullRecoAna0->GetEntry(i);
root [3]

What do you think?



it seems that it only happens when I load 159 such files (~80 MBytes each) into a huge TChain and then I loop on all the events, then I get this message time to time for every file.



Maybe (?) you have some (unreliable) network problems …



…which can be any combination of network, AFS, disk of the AFS server, memory of the local machine. I’d ask your admins to check their logs, with a specific file name and time stamp, and check your kernel’s log + ifconfig for network problems.