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 #11537 (closed)

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

Failing share service Python tests

Reported by: cblackburn Owned by: bpindelski
Priority: critical Milestone: 5.0.3
Component: OmeroPy Version: 4.4.8
Keywords: n.a. Cc: atarkowska, jamoore, bpindelski
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Several tests under test_ishare.py routinely fail both locally and on hudson (4.4.9 and develop). These tests have been marked as xfail with this ticket number. In all cases getShare returns None, for example:

>           assert share2.getShare(sid).message.val ==  new_description
E           AttributeError: 'NoneType' object has no attribute 'message'

Change History (16)

comment:1 Changed 10 years ago by Colin Blackburn <colin@…>

(In [f919f2014bca634f6155adc3990aff0c6f5ef3f9/ome.git] on branch develop) Mark failing ishare tests. See #11537

comment:2 Changed 10 years ago by Colin Blackburn <colin@…>

(In [c93c97fbd4dbb28d3e651bd80d7766a2adbe98d8/ome.git] on branch dev_4_4) Mark failing ishare tests. See #11537

comment:3 Changed 10 years ago by wmoore

One of these failing tests is seen in webclient as #11839

comment:4 Changed 10 years ago by atarkowska

  • Cc atarkowska added; jamoore removed
  • Milestone changed from Unscheduled to 5.0.3
  • Owner changed from cblackburn to jamoore

IShare is failing in general when reading data as a member of the share. Basically ShareStore? return nothing.

2014-05-27 13:56:19,798 INFO  [        ome.services.util.ServiceHandler] (l.Server-5)  Meth:	interface ome.api.IShare.getMemberShares
2014-05-27 13:56:19,799 INFO  [        ome.services.util.ServiceHandler] (l.Server-5)  Args:	[false]
2014-05-27 13:56:19,799 INFO  [         ome.security.basic.EventHandler] (l.Server-5)  Auth:	user=52,group=3,event=null(User),sess=40be5b27-96dc-448e-81f1-4e9ba1c94bc8
2014-05-27 13:56:19,802 INFO  [                 org.perf4j.TimingLogger] (l.Server-5) start[1401195379799] time[3] tag[omero.call.success.ome.services.sharing.ShareBean.getMemberShares]
2014-05-27 13:56:19,802 INFO  [        ome.services.util.ServiceHandler] (l.Server-5)  Rslt:	()

comment:5 Changed 10 years ago by atarkowska

was there any changes to the security system or another that ShareBean? returns nothing? There is no SecurityViolation?, requests are just empty. This is only when member wants to access data. For example getMemberShares()

Last edited 10 years ago by atarkowska (previous) (diff)

comment:6 Changed 10 years ago by jamoore

  • Cc jamoore bpindelski added
  • Owner jamoore deleted

comment:7 Changed 10 years ago by atarkowska

  • Priority changed from major to critical

comment:8 Changed 10 years ago by bpindelski

There is something very broken in the share service. A code that creates two users: user-1 and user-2 in the same group and then creates a share as user-1 and tries to retrieve it as user-2, fails. I always end up seeing ome.services.sharing.ShareBean.shareToSession(ShareData) returning null for a given share ID. More investigation is needed into why this happens.

comment:9 Changed 10 years ago by bpindelski

Fixing this ticket will most probably also fix http://trac.openmicroscopy.org.uk/ome/ticket/11839. I'm still trying to understand what is filtering out the results of the share query in ShareBean?. Doing the same HQL query from the CLI as root returns the expected object - so it would seem that user/permission filtering is actively forbidding a share member to see shares.

comment:10 Changed 10 years ago by bpindelski

  • Owner set to bpindelski

comment:11 Changed 10 years ago by bpindelski

Further debugging and help from Josh showed that the SQL generated from the HQL query in ome.services.sharing.ShareBean.shareToSession(ShareData) has a WHERE condition testing for object ownership. In the case where the share owner requests the share, it does return the entry from the table, but in the case of a share member trying to view a share, it returns zero rows, as the security filter from object.vm is applied. https://github.com/openmicroscopy/openmicroscopy/pull/1478 is relevant.

comment:12 Changed 10 years ago by bpindelski

Down to 3 failing tests in test_ishare.py (see https://github.com/bpindelski/openmicroscopy/commits/11537_shares). A more general solution is being worked on, as the filtering also applies in BlobShareStore and we don't have access to the BasicSecuritySystem in the store, to disable filtering before the HQL query.

comment:13 Changed 10 years ago by bpindelski

  • Status changed from new to accepted

comment:14 Changed 10 years ago by bpindelski

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

Closing. This is now fixed by the PR.

comment:15 Changed 10 years ago by Blazej Pindelski <bpindelski@…>

(In [f242c3a5f79f49dc7a390ee1fc3a1166cd037b39/ome.git] on branch develop) Enable tests that were failing (see #11537).

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

(In [e20f8578a5c63915e7ea1490062f2b3ffbed4989/ome.git] on branch develop) Merge pull request #2664 from bpindelski/rebased/develop/11537_shares

Fix Share service (see #11537). (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.68450 sec.)

We're Hiring!