Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script parameter #1822

Merged
merged 8 commits into from
Dec 3, 2013
Merged

Script parameter #1822

merged 8 commits into from
Dec 3, 2013

Conversation

jburel
Copy link
Member

@jburel jburel commented Nov 22, 2013

Add check to make sure scripts cannot be started w/o parameters

To test:

  • Trying to run few scripts from the scripts menu

@pwalczysko
Copy link
Member

Login to gretzky as user-4, group read-only-1, Dataset: dv.

  • open first image, draw a polyline (long one)
  • save polyline
  • the image still selected, start Kymograph
  • ends up with error (see below)

Traceback (most recent call last):
  File "./script", line 530, in <module>
    newImages, message = processImages(conn, scriptParams)
  File "./script", line 415, in processImages
    tInterval = duration/(sizeT-1)
ZeroDivisionError: float division

@pwalczysko
Copy link
Member

Additional info to the error above: the Kymograph images were nevertheless created, so the script ran actually successfully.

@pwalczysko
Copy link
Member

Batch image export script - in the Image field, deleted the default image ID (left empty field = there is no parameter now). Started the script. Got an exception.
OMERO.insight-5.0.0-beta2-RC1-217-50f4372-ice33-b497-mac


java.lang.Exception: Abnormal termination due to an uncaught exception.
java.lang.IllegalArgumentException: No all required fields have been filled.
    at org.openmicroscopy.shoola.env.ui.ScriptActivity.<init>(ScriptActivity.java:105)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyActivity(UserNotifierImpl.java:405)
    at org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerControl.handleScript(TreeViewerControl.java:974)
    at org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerControl.propertyChange(TreeViewerControl.java:1501)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at java.awt.Component.firePropertyChange(Component.java:8287)
    at org.openmicroscopy.shoola.agents.util.ui.ScriptingDialog.runScript(ScriptingDialog.java:325)
    at org.openmicroscopy.shoola.agents.util.ui.ScriptingDialog.actionPerformed(ScriptingDialog.java:814)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
    at java.awt.Component.processMouseEvent(Component.java:6414)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
    at java.awt.Component.processEvent(Component.java:6179)
    at java.awt.Container.processEvent(Container.java:2083)
    at java.awt.Component.dispatchEventImpl(Component.java:4776)
    at java.awt.Container.dispatchEventImpl(Container.java:2141)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
    at java.awt.Container.dispatchEventImpl(Container.java:2127)
    at java.awt.Window.dispatchEventImpl(Window.java:2489)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:690)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Abnormal termination due to an uncaught exception.
java.lang.IllegalArgumentException: No all required fields have been filled.
    at org.openmicroscopy.shoola.env.ui.ScriptActivity.<init>(ScriptActivity.java:105)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyActivity(UserNotifierImpl.java:405)
    at org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerControl.handleScript(TreeViewerControl.java:974)
    at org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerControl.propertyChange(TreeViewerControl.java:1501)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at java.awt.Component.firePropertyChange(Component.java:8287)
    at org.openmicroscopy.shoola.agents.util.ui.ScriptingDialog.runScript(ScriptingDialog.java:325)
    at org.openmicroscopy.shoola.agents.util.ui.ScriptingDialog.actionPerformed(ScriptingDialog.java:814)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
    at java.awt.Component.processMouseEvent(Component.java:6414)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
    at java.awt.Component.processEvent(Component.java:6179)
    at java.awt.Container.processEvent(Container.java:2083)
    at java.awt.Component.dispatchEventImpl(Component.java:4776)
    at java.awt.Container.dispatchEventImpl(Container.java:2141)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
    at java.awt.Container.dispatchEventImpl(Container.java:2127)
    at java.awt.Window.dispatchEventImpl(Window.java:2489)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:690)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0"

    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.showErrorDialog(UserNotifierImpl.java:191)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:291)
    at org.openmicroscopy.shoola.env.AbnormalExitHandler.doTermination(AbnormalExitHandler.java:147)
    at org.openmicroscopy.shoola.env.AbnormalExitHandler.terminate(AbnormalExitHandler.java:85)
    at org.openmicroscopy.shoola.env.AWTExceptionHanlder.handle(AWTExceptionHanlder.java:99)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.awt.EventDispatchThread.handleException(EventDispatchThread.java:412)
    at java.awt.EventDispatchThread.processException(EventDispatchThread.java:318)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:312)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

@jburel
Copy link
Member Author

jburel commented Nov 25, 2013

@pwalczysko
I can see 2 problems.

  • One in the script itself division by 0 (Ticket to be created, not for this PR)
  • Insight error (to be fixed in this PR)

@pwalczysko
Copy link
Member

Login to Gretzky, user-4, group read-only-1, dataset dv, first image. Tried to run Kymograph script on the image on which I have created a polyline region yesterday.
Build OMERO.insight-5.0.0-beta2-RC1-233-bf07066-ice33-b498-mac

  • open Kymograph
  • the ID of the image (2903) is pre-populated as expected
  • the button "Run script" is greyed out = not expected
  • try to delete the ID - "Run script" still greyed out
  • try to paste the ID back - "Run script" still greyed out

@pwalczysko
Copy link
Member

Unlike Kymograph (see above) which behaves strangely, the following scripts are fine:

  • Batch image export,
  • Channel Offsets,
  • Images from ROIs,
  • Movie ROI Figure,
  • Dataset to Plate

The only RFE would be:

  • Input nonsensical ID (e.g. "0" for the Batch image export script) into the box
  • the "Run script" button becomes enabled
  • the image will not be created, but there is no info saying "I could not find such ID"

@jburel
Copy link
Member Author

jburel commented Nov 26, 2013

@pwalczysko: you will have to show me the issue with "0" since I cannot reproduce it
The notification will have to be added to the script itself. Out of the scope of this PR.

@pwalczysko
Copy link
Member

User-6 on Gretzky, dataset dv. Tried to run Channel Offset script. Failure.


java.lang.Exception: java.lang.Exception: org.openmicroscopy.shoola.env.data.ProcessException: Cannot run script with ID:17012
    at org.openmicroscopy.shoola.env.data.views.ProcessBatchCall.doStep(ProcessBatchCall.java:101)
    at org.openmicroscopy.shoola.util.concur.tasks.CompositeTask.doStep(CompositeTask.java:226)
    at org.openmicroscopy.shoola.env.data.views.CompositeBatchCall.doStep(CompositeBatchCall.java:126)
    at org.openmicroscopy.shoola.util.concur.tasks.ExecCommand.exec(ExecCommand.java:165)
    at org.openmicroscopy.shoola.util.concur.tasks.ExecCommand.run(ExecCommand.java:276)
    at org.openmicroscopy.shoola.util.concur.tasks.AsyncProcessor$Runner.run(AsyncProcessor.java:91)
    at java.lang.Thread.run(Thread.java:680)
Caused by: org.openmicroscopy.shoola.env.data.ProcessException: Cannot run script with ID:17012
    at org.openmicroscopy.shoola.env.data.OMEROGateway.runScript(OMEROGateway.java:587)
    at org.openmicroscopy.shoola.env.data.OMEROGateway.runScript(OMEROGateway.java:6957)
    at org.openmicroscopy.shoola.env.data.OmeroImageServiceImpl.runScript(OmeroImageServiceImpl.java:1594)
    at org.openmicroscopy.shoola.env.data.views.calls.ScriptRunner$1.initialize(ScriptRunner.java:77)
    at org.openmicroscopy.shoola.env.data.views.ProcessBatchCall.doStep(ProcessBatchCall.java:99)
    ... 6 more
Caused by: omero.InternalException
    serverStackTrace = "Traceback (most recent call last):
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/util/decorators.py", line 61, in exc_handler
                            rv = func(*args, **kwargs)
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/processor.py", line 866, in processJob
                            prx, process = self.process(client, session, job, current, params, iskill = True)
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/util/decorators.py", line 28, in handler
                            return func(*args, **kwargs)
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/processor.py", line 923, in process
                            process.activate()
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/util/decorators.py", line 81, in with_lock
                            return func(*args, **kwargs)
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/omero/processor.py", line 209, in activate
                            stdout=self.stdout, stderr=self.stderr)
                          File "/home/omero/slave/workspace/OMERO-merge-develop/src/dist/lib/python/killableprocess.py", line 102, in __init__
                            subprocess.Popen.__init__(self, *args, **kwargs)
                          File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
                            errread, errwrite)
                          File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
                            raise child_exception
                        OSError: [Errno 13] Permission denied
                        "
    serverExceptionClass = ""
    message = "Internal exception"
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:357)
    at java.lang.Class.newInstance(Class.java:310)
    at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)
    at IceInternal.BasicStream.throwException(BasicStream.java:1632)
    at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
    at omero.api._IScriptDelM.runScript(_IScriptDelM.java:508)
    at omero.api.IScriptPrxHelper.runScript(IScriptPrxHelper.java:662)
    at omero.api.IScriptPrxHelper.runScript(IScriptPrxHelper.java:634)
    at org.openmicroscopy.shoola.env.data.OMEROGateway.runScript(OMEROGateway.java:583)
    ... 10 more

    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.showErrorDialog(UserNotifierImpl.java:191)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:291)
    at org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:259)
    at org.openmicroscopy.shoola.env.ui.ActivityComponent.showException(ActivityComponent.java:413)
    at org.openmicroscopy.shoola.env.ui.ActivityComponent.actionPerformed(ActivityComponent.java:926)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
    at java.awt.Component.processMouseEvent(Component.java:6414)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
    at java.awt.Component.processEvent(Component.java:6179)
    at java.awt.Container.processEvent(Container.java:2083)
    at java.awt.Component.dispatchEventImpl(Component.java:4776)
    at java.awt.Container.dispatchEventImpl(Container.java:2141)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
    at java.awt.Container.dispatchEventImpl(Container.java:2127)
    at java.awt.Window.dispatchEventImpl(Window.java:2489)
    at java.awt.Component.dispatchEvent(Component.java:4604)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:690)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

@pwalczysko
Copy link
Member

All the scripts fail the same, except Kymograph. Kymograph which fails as well, does not fail in Activities, but with a separate popup:
screen shot 2013-11-27 at 13 34 57

@pwalczysko
Copy link
Member

The scripts fail also when started in web or CLI.

@jburel
Copy link
Member Author

jburel commented Nov 27, 2013

@pwalczysko: the problem is not related to that PR.

@pwalczysko
Copy link
Member

@joshmoore fixed the problem (thank you). Now the workflow is as expected, both for Kymograph as well as other scripts.
The "0" problem I was mentioning is not a bug, just an RFE and not connected to this PR I guess. It is about input of non-existent ID into the scripts parameters. If you do this, the script will "succeed" but you obviously have no results and no info why that is so.
The division by zero problem of Kymograph is still there, possibly because ome/omero-scripts#55 is not in the merge as i understand it (why ? what is the supposed workflow here ?).
I think that these problems are not related and this PR works fine.

@jburel
Copy link
Member Author

jburel commented Nov 27, 2013

Passing id like 0, will need to be handled by the scripts. No information currently returned.
The Kymograph issue is not covered by this PR.

@joshmoore
Copy link
Member

Primary changes around:

(script.isParametersLoaded() && !script.allRequiredValuesPopulated())

look good. Merging.

joshmoore added a commit that referenced this pull request Dec 3, 2013
@joshmoore joshmoore merged commit 834cda6 into ome:develop Dec 3, 2013
@jburel jburel mentioned this pull request Dec 4, 2013
@jburel
Copy link
Member Author

jburel commented Dec 4, 2013

--rebased-to #1862

@jburel jburel deleted the script-parameter branch February 3, 2014 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants