Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12146 (closed)

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

Bug: export/download don't search all groups

Reported by: jamoore Owned by: bpindelski
Priority: critical Milestone: 5.0.2
Component: Services Version: 5.0.0
Keywords: n.a. Cc: python-team@…
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: n.a.

Description

See: https://www.openmicroscopy.org/community/viewtopic.php?f=4&t=7479

Like bin/omero hql (without the --admin option), only the current group is checked for files to download. This could be widened to search all groups.

$ bin/omero login root@localhost
Previous session expired for root on localhost:4064
Password:
Password check failed for 'root': [id=0]
Password:
Created session 437da64b-ea57-488f-a820-8be0b06ae276 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
$ bin/omero group add ExportA
Using session 437da64b-ea57-488f-a820-8be0b06ae276 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
Added group ExportA (id=853) with permissions rw----
$ bin/omero group add ExportB
Using session 437da64b-ea57-488f-a820-8be0b06ae276 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
Added group ExportB (id=854) with permissions rw----
$ bin/omero user add export_tester Export Tester ExportA ExportB
Using session 437da64b-ea57-488f-a820-8be0b06ae276 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
Please enter password for your new user (export_tester): 
Please re-enter password for your new user (export_tester): 
Added user export_tester (id=852) with password
$ bin/omero login export_tester@localhost
Password:
Created session e0d41413-59bc-4d82-89ad-52480295e41a (export_tester@localhost:4064). Idle timeout: 10.0 min. Current group: ExportA
$ echo "test" >> test.txt
$ bin/omero upload test.txt
Using session e0d41413-59bc-4d82-89ad-52480295e41a (export_tester@localhost:4064). Idle timeout: 10.0 min. Current group: ExportA
Uploaded test.txt as 26751
$ bin/omero download 26751 -
Using session e0d41413-59bc-4d82-89ad-52480295e41a (export_tester@localhost:4064). Idle timeout: 10.0 min. Current group: ExportA
test
$ bin/omero sessions group ExportB
Using session e0d41413-59bc-4d82-89ad-52480295e41a (export_tester@localhost:4064). Idle timeout: 10.0 min. Current group: ExportA
Group 'ExportA' (id=853) switched to 'ExportB' (id=854)
$ bin/omero download 26751 -
Using session e0d41413-59bc-4d82-89ad-52480295e41a (export_tester@localhost:4064). Idle timeout: 10.0 min. Current group: ExportB
Traceback (most recent call last):
  File "bin/omero", line 125, in <module>
    rv = omero.cli.argv()
  File "/opt/ome3/dist/lib/python/omero/cli.py", line 1197, in argv
    cli.invoke(args[1:])
  File "/opt/ome3/dist/lib/python/omero/cli.py", line 745, in invoke
    stop = self.onecmd(line, previous_args)
  File "/opt/ome3/dist/lib/python/omero/cli.py", line 814, in onecmd
    self.execute(line, previous_args)
  File "/opt/ome3/dist/lib/python/omero/cli.py", line 894, in execute
    args.func(args)
  File "/opt/ome3/dist/lib/python/omero/plugins/download.py", line 36, in __call__
    client.download(orig_file, filehandle=sys.stdout)
  File "/opt/ome3/dist/lib/python/omero/clients.py", line 756, in download
    ofile = self.__sf.getQueryService().get("OriginalFile", ofile.id.val)
  File "/opt/ome3/dist/lib/python/omero_api_IQuery_ice.py", line 117, in get
    return _M_omero.api.IQuery._op_get.invoke(self, ((klass, id), _ctx))
omero.SecurityViolation: exception ::omero::SecurityViolation
{
    serverStackTrace = ome.conditions.SecurityViolation: Cannot read ome.model.core.OriginalFile:Id_26751
        at ome.security.basic.BasicACLVoter.throwLoadViolation(BasicACLVoter.java:163)
        at ome.security.CompositeACLVoter.throwLoadViolation(CompositeACLVoter.java:92)
...

Change History (9)

comment:1 Changed 10 years ago by jamoore

Also fix the exception when the original file ID doesn't exist at all (which is the actual problem that the user on the forum was seeing). Thanks, Colin.

comment:2 Changed 10 years ago by bpindelski

An initial attempt at fixing the issue is at https://github.com/bpindelski/openmicroscopy/commits/12146_all_groups. Josh (and Colin, Sebastien): if the code looks sane and the test is in the correct class, I can move forward and fix the exception handling and open a PR. Thanks for having a look.

comment:3 Changed 10 years ago by jamoore

Perhaps assign to yourself if you're going to dig much deeper so no one else gives it a whirl?

comment:4 Changed 10 years ago by bpindelski

  • Owner set to bpindelski

comment:5 Changed 10 years ago by bpindelski

Research shows that setting omero.group to -1 in https://github.com/openmicroscopy/openmicroscopy/blob/dev_5_0/components/tools/OmeroPy/src/omero/clients.py#L761 has a nasty side-effect of setting omero.client.uuid to an empty string. To solve the general issue this has to be fixed, as with an empty omero.client.uuid the server can't find the servant for the RawFileStore? service.

comment:6 Changed 10 years ago by bpindelski

  • Status changed from new to accepted

comment:7 Changed 10 years ago by bpindelski

  • Resolution set to fixed
  • Status changed from accepted to closed

Closing. PR 2383 merged.

comment:8 Changed 10 years ago by Josh Moore <josh@…>

  • Remaining Time set to 0

(In [f1efece98d914f56022aee0e7258a09f5929425e/ome.git] on branch develop) Merge pull request #2398 from bpindelski/rebased/develop/12146_all_groups

CLI download looks for resources in all user groups (fix #12146). (rebased onto develop)

comment:9 Changed 10 years ago by Josh Moore <josh@…>

(In [e9e432eca0f62dfca994745c36d568d547a4e957/ome.git] on branch develop) Merge pull request #2451 from bpindelski/rebased/develop/12146-exception

Update help and handle missing resources in download.py (see #12146). (rebased onto develop)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.86648 sec.)

We're Hiring!