I've written (poorly) a python script to download files from out OMERO server to a local machine. The main part of the code is:
- Code: Select all
# dowload the files
for orig in img.getImportedImageFiles():
name,ext = os.path.splitext(orig.getName())
file_path = os.path.join( reldir, new_name+ext)
print name, orig.getId(), orig.canDownload()
if( not os.path.exists( file_path) ):
with open(str(file_path), 'w') as f:
for chunk in orig.getFileInChunks():
f.write(chunk)
When I code runs for some files I get an error
- Code: Select all
serverExceptionClass = ome.conditions.SecurityViolation
message = Download is restricted for ome.model.core.OriginalFile:Id_5719
When I check 'canDownload' I don't have permission to do this (even though I uploaded and own file and the rest of the files from the import I can download).
It appears to be occurring only for images that have a fileset. For the original files sometimes I have permission for one of two file but not the other. Sometimes I don't have permission for both. In OMERO.web the option to download the original file doesn't appear.
However, I repeatedly execute the script I will sometimes let me download the file and eventually all the files are downloaded. (I tried to upload the Blitz log parts but I can't seem to attach .log to .txt files.)
I have had a look though the python API bindings and I can't find anything to change the download status of the image. How can change permission of a file?
I tried changing the owner on through the command line tool but got his cryptic error:
- Code: Select all
OMERO.server-5.4.1-ice36-b75/bin/omero chown User:119898 Image:1130 --dry-run
Using session 6f981225-3550-47da-b226-d3a5bea42bec (119898@localhost:4064). Idle timeout: 10 min. Current group: default
omero.cmd.Chown2 Image:1130 failed: 'graph-fail'
failed: may not give Image[1130] while WellSample[81] remains
Cheers,
Chris