Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binary_access +plate config throws UnloadedCollectionException for wellSamples #179

Open
Rdornier opened this issue Jun 11, 2024 · 2 comments

Comments

@Rdornier
Copy link

Hello,

Jumping from this issue, it seems that the omero.policy.binary_access configuration, if set to +read +write +image +plate, prevents the loading of wellSamples from the API (UnloadedCollectionException) at the ImageData level.

If this config is set to default, the wellSamples are loaded correctly. A minimal script is available in the above mentioned issue to test.

It seems to be a side effect of this config which, according to what I understand from the doc, should give the access to the binary files and allow the download of the plates from the webclient

Rémy
cc @gaelrayot-epfl

@dominikl
Copy link
Member

This is an odd error, binary_access should only affect download of images, plates, etc. But indeed, I can replicate the problem:

Plain, clean OMERO.server installation, no config changes, only one plate imported. Running:

...
BrowseFacility bf = gw.getFacility(BrowseFacility.class);
List<WellSample> samples = bf.getImage(ctx, 1).asImage().copyWellSamples();
System.out.println(samples.size());

gives:

1

Then changing server setting:

omero config set omero.policy.binary_access "+read,+write,+image,+plate"

Run above code again, now gives:

Exception in thread "main" omero.UnloadedCollectionException: Error updating collection:wellSamplesSeq
Collection is currently null. This can be seen
by testing "wellSamplesSeqLoaded". This implies
that this collection was unloaded. Please refresh this object
in order to update this collection.
	at omero.model.ImageI.throwNullCollectionException(ImageI.java:40)
	at omero.model.ImageI.copyWellSamples(ImageI.java:698)

@dominikl
Copy link
Member

dominikl commented Jun 14, 2024

Same with Python API.

Default binary_access:

> python test.py
1

With +plate:

> python test.py
Traceback (most recent call last):
...
  File "/Users/dom/micromamba/envs/idr/lib/python3.10/site-packages/omero_model_ImageI.py", line 98, in throwNullCollectionException
    raise _omero.UnloadedEntityException(""+
omero.UnloadedEntityException: Error updating collection:wellSamplesSeq
Collection is currently null. This can be seen
by testing "wellSamplesSeqLoaded". This implies
that this collection was unloaded. Please refresh this object
in order to update this collection.

Script:

with omero.cli.cli_login() as c:
     conn = BlitzGateway(client_obj=c.get_client())
     img = conn.getObject("Image", 1)
     print(len(img._obj.copyWellSamples()))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants