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

omero script replace "loses" official script if invalid #172

Open
joshmoore opened this issue Jan 11, 2024 · 1 comment
Open

omero script replace "loses" official script if invalid #172

joshmoore opened this issue Jan 11, 2024 · 1 comment

Comments

@joshmoore
Copy link
Member

The workflow:

omero script upload --official my-script.py
# Begin loop
omero script replace /my-script.py my-script.py
# End loop

is a fast method of developing a script in OMERO. However, if the script is invalid, a subsequent call to replace will fail since the original script is no longer in place. The Script service should likely catch the exception and attempt to roll back the change:

$ omero script replace /my-script.py my-script.py
Using session for root@localhost:4064. Idle timeout: 10 min. Current group: system
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/bin/omero", line 10, in <module>
    sys.exit(main())
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/main.py", line 126, in main
    rv = omero.cli.argv()
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/cli.py", line 1787, in argv
    cli.invoke(args[1:])
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/cli.py", line 1225, in invoke
    stop = self.onecmd(line, previous_args)
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/cli.py", line 1302, in onecmd
    self.execute(line, previous_args)
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/cli.py", line 1384, in execute
    args.func(args)
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero/plugins/script.py", line 681, in replace
    scriptSvc.editScript(ofile, scriptText)
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/omero-transfer/lib/python3.10/site-packages/omero_api_IScript_ice.py", line 767, in editScript
    return _M_omero.api.IScript._op_editScript.invoke(self, ((fileObject, scriptText), _ctx))
omero.ValidationException: exception ::omero::ValidationException
{
    serverStackTrace =
    serverExceptionClass =
    message = Can't find params for 86!
No stdout.
stderr is in file 109:
---------------------------------
  File "/opt/omero/server/omero/tmp/omero_omero-server/1023/processw_905ozx.dir/./script", line 55
    pre_arguments = [
    ^
SyntaxError: invalid syntax

---------------------------------

}
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/omero-scripts-storage-state-question/92108/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants