Task #4379 (closed)
BUG: testScriptValidation - OmeroPy
Reported by: | wmoore | Owned by: | jamoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-Beta4.3 |
Component: | Scripting | Version: | n.a. |
Keywords: | n.a. | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2011-02-24 (6) |
Description
When testScriptValidation test is run it creates a script file that is invalid.
Subsequent calls to getScripts() fail (for this test and any other test). Possibly due to the fact that this script is still in the original file table but is not a valid script, so when it is found in the file system under dist/lib/scripts OMERO tries to add it to the original file table.
Removing the file from the file system allows getScripts() to work again.
Traceback (most recent call last): File "test/integration/scripts.py", line 248, in testScriptValidation scripts = scriptService.getScripts() File "/Users/will/Desktop/OMERO/components/tools/OmeroPy/build/lib/omero_api_IScript_ice.py", line 90, in getScripts return _M_omero.api.IScript._op_getScripts.invoke(self, ((), _ctx)) ValidationException: exception ::omero::ValidationException { serverStackTrace = ome.conditions.ValidationException: PreparedStatementCallback; SQL [update originalfile set repo = ? where id = ?]; ERROR: duplicate key value violates unique constraint "originalfile_repo_path_index"; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "originalfile_repo_path_index" at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:875) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:249) at ome.util.actions.PostgresSqlAction.setFileRepo(PostgresSqlAction.java:350) at sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) 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.util.SqlAction$LoggingSqlAction.invoke(SqlAction.java:58) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy49.setFileRepo(Unknown Source) at ome.services.scripts.ScriptRepoHelper.update(ScriptRepoHelper.java:405) at ome.services.scripts.ScriptRepoHelper.addOrReplace(ScriptRepoHelper.java:342) at ome.services.scripts.ScriptRepoHelper$5.doWork(ScriptRepoHelper.java:295) at sun.reflect.GeneratedMethodAccessor201.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) 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.services.util.Executor$Impl$Interceptor.invoke(Executor.java:439) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at ome.security.basic.EventHandler.invoke(EventHandler.java:144) 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 $Proxy61.doWork(Unknown Source) at ome.services.util.Executor$Impl.execute(Executor.java:369) at ome.services.scripts.ScriptRepoHelper.loadAll(ScriptRepoHelper.java:278) at ome.services.blitz.impl.ScriptI$11.call(ScriptI.java:416) at ome.services.throttling.Callback2.run(Callback2.java:49) at ome.services.throttling.InThreadThrottlingStrategy.safeRunnableCall(InThreadThrottlingStrategy.java:80) at ome.services.blitz.impl.AbstractAmdServant.safeRunnableCall(AbstractAmdServant.java:155) at ome.services.blitz.impl.ScriptI.getScripts_async(ScriptI.java:414) at omero.api._IScriptTie.getScripts_async(_IScriptTie.java:113) at omero.api._IScriptDisp.___getScripts(_IScriptDisp.java:171) at omero.api._IScriptDisp.__dispatch(_IScriptDisp.java:510) 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 = PreparedStatementCallback; SQL [update originalfile set repo = ? where id = ?]; ERROR: duplicate key value violates unique constraint "originalfile_repo_path_index"; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "originalfile_repo_path_index" }
Change History (4)
comment:1 Changed 13 years ago by jmoore
- Remaining Time set to 0.25
- Status changed from new to accepted
comment:2 Changed 13 years ago by jmoore <josh@…>
- Remaining Time changed from 0.25 to 0
- Resolution set to fixed
- Status changed from accepted to closed
comment:3 Changed 13 years ago by jmoore <josh@…>
(In [020a779fd872b865aa2b59476b680c4932ed7f56/ome.git] on branch dev_4_2) Fixing ScriptRepoHelper.findInDb method after move to SqlAction (Fix #4379, See #2684)
During work on #2684, logic in findInDb which set the mimetype
was refactored out to SqlAction but what remained was a hard-
coded version with 'text/x-python' (ignoring the boolean).
See: [4ba6923cc95ed9c17d803e757db95fbdb40edbcb/ome.git], i.e. [r8807/omero]
comment:4 Changed 13 years ago by Will Moore <will@…>
(In [09638cc14bb8e23aa893ec5664779ec25e1f4229/ome.git] on branch develop) Turned back on several OmeroPy tests that were failing because of testScriptValidation. See #4379 #4334
(In [7ac6cbd073399ce413d6ca629ceb2cf76f1953df/ome.git] on branch develop) Fixing ScriptRepoHelper.findInDb method after move to SqlAction (Fix #4379, See #2684)
During work on #2684, logic in findInDb which set the mimetype
was refactored out to SqlAction but what remained was a hard-
coded version with 'text/x-python' (ignoring the boolean).
See: [4ba6923cc95ed9c17d803e757db95fbdb40edbcb/ome.git], i.e. [r8807/omero]