Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #2845 (closed)

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

Bug: script edit can lead to missing script

Reported by: jamoore Owned by: jamoore
Priority: minor Milestone: OMERO-4.4
Component: Scripting Version: n.a.
Keywords: n.a. Cc: jburel, wmoore
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2012-01-17 (6)

Description

~/code/omero.git/dist $ bin/omero  script edit file=18152 
Using session ef6f9088-4545-4ffe-9169-791bef4bc947 (root@localhost). Idle timeout: 10.0 min. Current group: system
Failed to find script: 18152 (exception ::omero::ValidationException
{
    serverStackTrace = 
    serverExceptionClass = 
    message = Can't find params for 18152. No stderr
})
~/code/omero.git/dist $ vicp ../components/tools/OmeroPy/scripts/omero/analysis_scripts/Run_Cecog_4.1.py lib/scripts/omero/analysis_scripts/
Copied.
~/code/omero.git/dist $ bin/omero script list
Using session ef6f9088-4545-4ffe-9169-791bef4bc947 (root@localhost). Idle timeout: 10.0 min. Current group: system
 id    | Official scripts                           
-------+--------------------------------------------
 4814  | /omero/analysis_scripts/FLIM.py            
 4815  | /omero/export_scripts/Make_Movie.py        
 4816  | /omero/figure_scripts/Movie_Figure.py      
 16151 | /omero/figure_scripts/Movie_ROI_Figure.py  
 4818  | /omero/figure_scripts/ROI_Split_Figure.py  
 4819  | /omero/figure_scripts/Split_View_Figure.py 
 4820  | /omero/figure_scripts/Thumbnail_Figure.py  
 4821  | /omero/import_scripts/Populate_ROI.py      
 4822  | /omero/setup_scripts/FLIM_initialise.py    
 4823  | /omero/util_scripts/Combine_Images.py      
 4824  | /omero/util_scripts/Images_From_ROIs.py    
(11 rows)

Change History (7)

comment:1 Changed 12 years ago by jmoore

  • Milestone changed from Unscheduled to OMERO-Beta4.4
  • Owner set to jmoore
  • Sprint set to 2012-01-17 (6)

comment:2 Changed 12 years ago by jmoore

  • Cc jburel wmoore added
  • Status changed from new to accepted

This is certainly happening, but the question is, how far should we go to prevent it. The file is still available, but has been marked as "not a script" in order to prevent something not-runnable from being listed by bin/omero script list. Suggestions on how best to handle it? Should we roll back the edit which could fail itself? Should we print a larger warning?

Here's a sample session with this issue:

@sprint6-server-backlog ~/git/dist $ bin/omero script upload --official t.py 
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
Uploaded official script as original file #1554

@sprint6-server-backlog ~/git/dist $ bin/omero script list
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
 id   | Official scripts                            
------+---------------------------------------------
 251  | /omero/export_scripts/Batch_Image_Export.py 
 952  | /omero/export_scripts/Make_Movie.py         
 3    | /omero/figure_scripts/Movie_Figure.py       
 953  | /omero/figure_scripts/Movie_ROI_Figure.py   
 954  | /omero/figure_scripts/ROI_Split_Figure.py   
 253  | /omero/figure_scripts/Split_View_Figure.py  
 7    | /omero/figure_scripts/Thumbnail_Figure.py   
 8    | /omero/import_scripts/Populate_ROI.py       
 955  | /omero/setup_scripts/FLIM_initialise.py     
 956  | /omero/util_scripts/Channel_Offsets.py      
 11   | /omero/util_scripts/Combine_Images.py       
 255  | /omero/util_scripts/Dataset_To_Plate.py     
 957  | /omero/util_scripts/Images_From_ROIs.py     
 1554 | /t.py                                       
(14 rows)

@sprint6-server-backlog ~/git/dist $ bin/omero script launch t.py
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
Job 203 ready
Waiting....
Callback received: FINISHED

	*** start stderr ***
	* Traceback (most recent call last):
	*   File "./script", line 5, in <module>
	*     true
	* NameError: name 'true' is not defined
	* 
	*** end stderr ***


	*** out parameters ***
	***  done ***

@sprint6-server-backlog ~/git/dist $ bin/omero script edit 1554
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system

import omero
import omero.scripts as OS

false ### ADDED AN ERROR BEFORE PARAMS WERE GENERATED
OS.client("2845")
true

"~/omero/tmp/omero_moore/34764/omero8J0G6_.tmp" 6L, 70C written

Failed to find script: 1554 (exception ::omero::ValidationException
{
    serverStackTrace = 
    serverExceptionClass = 
    message = Can't find params for 1554. Stderr is in file 1557

---stderr---
Traceback (most recent call last):
  File "./script", line 4, in <module>
    false
NameError: name 'false' is not defined

})

@sprint6-server-backlog ~/git/dist $ bin/omero script list
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
 id  | Official scripts                            
-----+---------------------------------------------
 251 | /omero/export_scripts/Batch_Image_Export.py 
 952 | /omero/export_scripts/Make_Movie.py         
 3   | /omero/figure_scripts/Movie_Figure.py       
 953 | /omero/figure_scripts/Movie_ROI_Figure.py   
 954 | /omero/figure_scripts/ROI_Split_Figure.py   
 253 | /omero/figure_scripts/Split_View_Figure.py  
 7   | /omero/figure_scripts/Thumbnail_Figure.py   
 8   | /omero/import_scripts/Populate_ROI.py       
 955 | /omero/setup_scripts/FLIM_initialise.py     
 956 | /omero/util_scripts/Channel_Offsets.py      
 11  | /omero/util_scripts/Combine_Images.py       
 255 | /omero/util_scripts/Dataset_To_Plate.py     
 957 | /omero/util_scripts/Images_From_ROIs.py     
(13 rows)

@sprint6-server-backlog ~/git/dist $ bin/omero download 1554 -
Using session a23ae3b7-71a5-4b06-8583-6e859ef49a55 (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
import omero
import omero.scripts as OS

false
OS.client("2845")
true

comment:3 Changed 12 years ago by jmoore

  • Owner jmoore deleted
  • Status changed from accepted to new

comment:4 Changed 12 years ago by wmoore

I think the current handling is fine. Same as when you try to upload an invalid script, right? The error and message are perfectly clear I think.

Can you recover by using 'edit' or 'replace' to get the script running again? I seem to remember that working fine using 'replace'. If it also works with 'edit' then that's fine I think?

comment:5 Changed 12 years ago by jmoore

  • Owner set to jmoore
  • Remaining Time set to 0.1
  • Status changed from new to accepted

comment:6 Changed 12 years ago by jmoore

  • Remaining Time changed from 0.1 to 0
  • Resolution set to fixed
  • Status changed from accepted to closed

replace does work as expected, Will. edit does not, because there is currently no way to get the text from the bad script. An option like --overwrite would need to be added. I'll mention that under #2890. For the moment, I'm committing to my sprint6-server-backlog branch a minor fix to print:

~/git/dist $ bin/omero script edit 1565
Using session 09c00720-9fe6-4faa-982f-1e762470ee4a (root@localhost:4064). Idle timeout: 10.0 min. Current group: system
No text for script: 1565
Does this file appear in the script list?
If not, try 'replace'

If you have any suggestions, let me know.

comment:7 Changed 12 years ago by jmoore <josh@…>

(In [5cd136469e7860291011f97947c04b8213087c56/ome.git] on branch develop) Add help message on bad edit (Fix #2845, See #2890)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.74271 sec.)

We're Hiring!