Xrootd file with "RECREATE" results in "Tried to write on read only file"

If I try to open a file via an xrootd URL, with the option “RECREATE”, I get an error:

root [0] TFile* f=TFile::Open("root://fndca1.fnal.gov:1094/pnfs/fnal.gov/usr/minerva/scratch/users/rodriges/myfile3.root", "RECREATE")
170609 08:57:35 24500 Xrd: CheckErrorStatus: Server [fndca4a.fnal.gov:1094] declared: Tried to write on read only file.(error code: 3007)
170609 08:57:35 24500 Xrd: CheckErrorStatus: Server [fndca4a.fnal.gov:1094] declared: Tried to write on read only file.(error code: 3007)

If I replace “RECREATE” with “NEW”, the command works and I can write to the file. Is this the intended behaviour? It’s different to how regular TFiles on the local disk work.

I looked at the source of TNetXNGFile.cxx and I see:

else if (modestr == "RECREATE")               mode = OpenFlags::Delete;

If I add OpenFlags::Update to the open mode, “RECREATE” works fine, and I can write to the file.

Is there a bug, or am I misunderstanding something?

Hello,

Looks like a bug.
Could you please specify the versions you are using {ROOT; local XRootD; remote XRooTD, if known)?

G Ganis

I got the problem with ROOT 5.34.05, 5.34.36 and 6.06.04. ‘query config version’ in xrdfs returns ‘dCache 2.13.35’

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.