We're Hiring!

Removing/disabling scripts

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Removing/disabling scripts

Postby pdebeule » Wed Mar 18, 2015 3:51 pm

Trying to delete an example Python script, uploaded using Omero.Insight to the Omero server, with the command line interface using the command
Code: Select all
omero script delete 1316


I received following failure message:

Code: Select all
Failed to delete script: 1316 (exception ::omero::ApiUsageException
{
    serverStackTrace = ome.conditions.ApiUsageException: Cannot delete 1316
Is in use by other objects
        at ome.services.scripts.ScriptRepoHelper.simpleDelete(ScriptRepoHelper.java:716)
        at ome.services.scripts.ScriptRepoHelper.delete(ScriptRepoHelper.java:657)
        at ome.services.blitz.impl.ScriptI.deleteOriginalFile(ScriptI.java:664)
        at ome.services.blitz.impl.ScriptI.access$800(ScriptI.java:89)
        at ome.services.blitz.impl.ScriptI$14.call(ScriptI.java:542)
        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:168)
        at ome.services.blitz.impl.ScriptI.deleteScript_async(ScriptI.java:533)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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 omero.cmd.CallContext.invoke(CallContext.java:78)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at com.sun.proxy.$Proxy110.deleteScript_async(Unknown Source)
        at omero.api._IScriptTie.deleteScript_async(_IScriptTie.java:72)
        at omero.api._IScriptDisp.___deleteScript(_IScriptDisp.java:497)
        at omero.api._IScriptDisp.__dispatch(_IScriptDisp.java:608)
        at IceInternal.Incoming.invoke(Incoming.java:222)
        at Ice.ConnectionI.invokeAll(ConnectionI.java:2482)
        at Ice.ConnectionI.dispatch(ConnectionI.java:1258)
        at Ice.ConnectionI.message(ConnectionI.java:1213)
        at IceInternal.ThreadPool.run(ThreadPool.java:321)
        at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
        at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:693)
        at java.lang.Thread.run(Thread.java:745)

    serverExceptionClass = ome.conditions.ApiUsageException
    message = Cannot delete 1316
Is in use by other objects
})


Can someone explain me how to resolve this?

Also, after disabling a script using
Code: Select all
omero script disable 1316

the script under consideration (ID 1316) disappears from the script listing
Code: Select all
omero script list
id   | Official scripts
------+-----------------------------------------------
4    | /omero/figure_scripts/ROI_Split_Figure.py
5    | /omero/figure_scripts/Movie_Figure.py
6    | /omero/figure_scripts/Split_View_Figure.py
7    | /omero/figure_scripts/Movie_ROI_Figure.py
8    | /omero/figure_scripts/Thumbnail_Figure.py
9    | /omero/setup_scripts/FLIM_initialise.py
1251 | /omero/export_scripts/Make_Movie.py
11   | /omero/export_scripts/Batch_Image_Export.py
12   | /omero/util_scripts/Channel_Offsets.py
13   | /omero/util_scripts/Images_From_ROIs.py
14   | /omero/util_scripts/Dataset_To_Plate.py
15   | /omero/util_scripts/Combine_Images.py
16   | /omero/analysis_scripts/Kymograph_Analysis.py
17   | /omero/analysis_scripts/Kymograph.py
18   | /omero/analysis_scripts/Plot_Profile.py
19   | /omero/import_scripts/Populate_ROI.py


I am a bit puzzled about the function of this, because if one afterwards wants to enable the script again using
Code: Select all
omero script enable 1316

One should know that there is actually a script with ID 1316, but when it is not listed it seems impossible to know this.

Many thanks for your consideration, Pieter
pdebeule
 
Posts: 3
Joined: Wed Mar 18, 2015 2:17 pm

Re: Removing/disabling scripts

Postby jmoore » Wed Mar 18, 2015 5:15 pm

Hi Pieter,

I was hoping to be able to help you by suggesting a use of the script name. E.g.
Code: Select all
$ bin/omero script disable /omero/import_scripts/Populate_ROI.py


which works fine. Enabling, however, fails:

Code: Select all
$ bin/omero script enable /omero/import_scripts/Populate_ROI.py
...
    serverExceptionClass = ome.conditions.ValidationException
    message = No row with the given identifier exists: [ome.model.core.OriginalFile#-1]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [ome.model.core.OriginalFile#-1]
}


One intermediate solution until we fix the above would be to use HQL to find the disabled script's ID. E.g.
Code: Select all
bin/omero hql "select f.id, f.path, f.name from OriginalFile f where f.mimetype = 'text/x-python'"


Hope that helps for the moment.
Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Removing/disabling scripts

Postby pdebeule » Wed Mar 18, 2015 5:38 pm

Hi Josh,
Maybe it would be a nice idea to have an enable/disable column in the output following the command
Code: Select all
omero script list
?
Any idea why our OMERO is refusing to delete the script?
Thanks, Pieter
pdebeule
 
Posts: 3
Joined: Wed Mar 18, 2015 2:17 pm

Re: Removing/disabling scripts

Postby jmoore » Thu Mar 19, 2015 5:16 pm

Hi Pieter,

pdebeule wrote:Maybe it would be a nice idea to have an enable/disable column in the output following the command
Code: Select all
omero script list
?


Noted. Thanks for the idea.

Any idea why our OMERO is refusing to delete the script?


It's really all the same underlying problem, but you should be able to workaround via:
Code: Select all
bin/omero -s root@localhost delete /OriginalFile:1316


Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 0 guests