ROOT Version:6.30/04
Platform: linuxx8664gcc
Compiler: 11.3.0
I want to cache a remote root file (from eos as well) but it seems that the cache path is not properly parsed if the cache directory is within my eos user directory.
Reproducer
import os
import ROOT
user = os.environ['USER']
outdir = f"/eos/user/{user[0]}/{user}"
filename = os.path.join(outdir, "test.root")
ROOT.RDataFrame(100).Define("x", "1").Snapshot("test", filename)
#cachedir = "/tmp" # works
cachedir = os.path.join(outdir, "tmp")
ROOT.TFile.SetCacheFileDir(cachedir, True, True)
chain = ROOT.TChain("test")
chain.AddFile(f"root://eosuser.cern.ch/{filename}")
chain.GetEntries()
This gives the error:
Info in <TFile::OpenFromCache>: using local cache copy of root://eosuser.cern.ch//eos/user/c/chlcheng/test.root [/eos/user/c/chlcheng/tmp//eos/user/c/chlcheng/test.root]
Info in <TFile::OpenFromCache>: using local cache copy of root://eoshome-i04.cern.ch//eos/user/c/chlcheng/tmp/eos/user/c/chlcheng/test.root [/eos/user/c/chlcheng/tmp//eos/user/c/chlcheng/tmp/eos/user/c/chlcheng/test.root]
Error in <TNetXNGFile::Open>: [ERROR] Server responded with an error: [3011] Unable to open file /test.root819.tmp; No such file or directory
Error in <TFile::Cp>: cannot open source file root://eoshome-i04.cern.ch//test.root819.tmp
Warning in <TFile::OpenFromCache>: you want to read through a cache, but I cannot make a cache copy of /eos/user/c/chlcheng/tmp - CACHEREAD disabled
Error in <TNetXNGFile::Open>: [ERROR] Server responded with an error: [3011] Unable to open file /test.root819.tmp; No such file or directory
However, if I set the cache directory to anywhere else, e.g. “/tmp”, “/afs/user/…”, the correct cache path will be used.