Task #5756 (closed)
BUG: IShare.getContents throws exception when images deleted
Reported by: | atarkowska | Owned by: | wmoore |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-Beta4.3 |
Component: | Services | Version: | n.a. |
Keywords: | n.a. | Cc: | atarkowska |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2011-06-16 (14) |
Description (last modified by jmoore)
I think originally content was stored in share. When image was deleted that was handled by obj.loaded()
exception ::omero::ValidationException { serverStackTrace = ome.conditions.ValidationException: No row with the given identifier exists: [ome.model.core.Image#17286]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [ome.model.core.Image#17286] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:663) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) at ome.logic.QueryImpl.get(QueryImpl.java:157) at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at ome.security.basic.EventHandler.invoke(EventHandler.java:150) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:231) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:111) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy72.get(Unknown Source) at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:83) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy72.get(Unknown Source) at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:179) at ome.services.throttling.Callback.run(Callback.java:56) at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56) at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:136) at ome.services.blitz.impl.QueryI.get_async(QueryI.java:110) at omero.api._IQueryTie.get_async(_IQueryTie.java:127) at omero.api._IQueryDisp.___get(_IQueryDisp.java:170) at omero.api._IQueryDisp.__dispatch(_IQueryDisp.java:516) at IceInternal.Incoming.invoke(Incoming.java:159) at Ice.ConnectionI.invokeAll(ConnectionI.java:2037) at Ice.ConnectionI.message(ConnectionI.java:972) at IceInternal.ThreadPool.run(ThreadPool.java:577) at IceInternal.ThreadPool.access$100(ThreadPool.java:12) at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971) serverExceptionClass = ome.conditions.ValidationException message = No row with the given identifier exists: [ome.model.core.Image#17286]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [ome.model.core.Image#17286] }
Change History (11)
comment:1 Changed 13 years ago by jburel
- Sprint changed from 2011-06-02 (13) to 2011-06-16 (14)
comment:2 Changed 13 years ago by atarkowska
- Component changed from General to Services
- Description modified (diff)
- Priority changed from minor to blocker
comment:3 Changed 13 years ago by jmoore <josh@…>
(In [adda109d49906c54d66b67526ad3a7b94e6c18f3/ome.git] on branch develop) Passing IShare tests (See #5756)
comment:4 Changed 13 years ago by jmoore
- Description modified (diff)
- Owner changed from jmoore to atarkowska
Ola, I added a couple of tests but see exactly this behavior (ValidationException). It is also the behavior that I would expect.
I'm not sure how the "object.loaded" check from the share_subtree.html could have protected you from this issue, since, in talking to Carlos, that should just call omero.model.Image.isLoaded which has nothing to do with the deleted state of the object. Could you explain what you think was previously happening?
comment:5 Changed 13 years ago by atarkowska
In order to load share content I was using IShare.getContent, which was giving me objects stored in share regardless if they were physically or not on the server. Each of object was having flag Image.loaded true or false which was telling if image is loaded or no. Please check it with 4.2.2 server.
comment:6 Changed 13 years ago by atarkowska
- Owner changed from atarkowska to jmoore
getContent can't throw exception if one of the objects was deleted
comment:7 Changed 13 years ago by jmoore
- Cc atarkowska added
- Owner changed from jmoore to wmoore
Sorry, Ola, but the 5756Raw test also passes in a latest build from dev_4_2 (i.e. a ValidationError was also previously thrown). I copied the 4.3 test/integration/ishare.py into the 4.2 test/integration directory and ran it:
/tmp/42/components/tools/OmeroPy $ python test/integration/ishare.py TestIShare.test5756Raw . ---------------------------------------------------------------------- Ran 1 test in 2.777s OK
Perhaps something changed with error handling. Assigning to Will to see if he can tell if anything has changed.
comment:8 Changed 13 years ago by atarkowska
Right, sorry I was not reading it enough carefully.
controller.loadShareContent() ... ▶ Local vars /Users/ola/Dev/omero/components/tools/OmeroWeb/omeroweb/../omeroweb/webclient/controller/share.py in loadShareContent for ex in content: ... ▶ Local vars /Users/ola/Dev/omero/components/tools/OmeroWeb/omeroweb/webclient/webclient_gateway.py in getContents yield ShareContentWrapper(self, e) ... ▶ Local vars /Users/ola/Dev/omero/dist/lib/python/omero/gateway/__init__.py in __init__ self._obj = self._conn.getQueryService().get(self._obj.__class__.__name__, self._oid) ... ▶ Local vars /Users/ola/Dev/omero/dist/lib/python/omero/gateway/__init__.py in wrapped return inner(*args, **kwargs) ... ▶ Local vars /Users/ola/Dev/omero/dist/lib/python/omero/gateway/__init__.py in inner return f(*args, **kwargs) ... ▶ Local vars /Users/ola/Dev/omero/dist/lib/python/omero_api_IQuery_ice.py in get return _M_omero.api.IQuery._op_get.invoke(self, ((klass, id), _ctx)) ...
Definitely wrapper is causing that problem. Basically BlitzObjectWrapper? is trying to load unloaded object:
if hasattr(obj, 'id') and obj.id is not None: self._oid = obj.id.val if not self._obj.loaded: self._obj = self._conn.getQueryService().get(self._obj.__class__.__name__, self._oid)
Will, could we put try block there like this:
if not self._obj.loaded: try: self._obj = self._conn.getQueryService().get(self._obj.__class__.__name__, self._oid) except: pass
comment:9 Changed 13 years ago by jmoore
- Priority changed from blocker to critical
Lowering to critical since we perhaps wouldn't block release for this, but Will, please do still try to implement, test, and close.
comment:10 Changed 13 years ago by Aleksandra Tarkowska <aleksandrat@…>
- Remaining Time set to 0
- Resolution set to fixed
- Status changed from new to closed
(In [586cabb292abea3f3f798b34b1c77d6108007c41/ome.git] on branch develop) this fixes the ValidationException? on the client side, close #5756
comment:11 Changed 13 years ago by Aleksandra Tarkowska <aleksandrat@…>
(In [3a80fd0550ca0db414774a47f5c2f98862fd29b6/ome.git] on branch develop) syntax changes, see #5756
Moved from sprint 2011-06-02 (13)