Hello All, I have just tried to import a workflow file and when I try to view the workflow, I'm getting an error, "global name 'self' is not defined". Error Traceback: View as: Interactive<http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> (full) <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> | Text <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> (full) <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> | XML <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> (full) <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> ⇝ NameError: global name 'self' is not defined clear this clear this URL: http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e Module weberror.evalexception.middleware:*364* in respond <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> *try**:* __traceback_supplement__ *=* errormiddleware*.*Supplement*,* self*,* environ app_iter *=* self*.*application*(*environ*,* detect_start_response*)* *try**:* return_iter *=* list*(*app_iter*)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>app_iter *=* self*.*application*(*environ*,* detect_start_response*)* Module paste.debug.prints:*98* in __call__ <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> *try**:* status*,* headers*,* body *=* wsgilib*.*intercept_output*(* environ*,* self*.*app*)* *if* status *is* None*:* # Some error occurred>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>environ*, * self*.*app*)* Module paste.wsgilib:*539* in intercept_output <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> data.append(headers) return output.write app_iter = application(environ, replacement_start_response) if data[0] is None: return (None, None, app_iter)>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>app_iter *=* application*(*environ*,* replacement_start_response*)* Module paste.recursive:*80* in __call__ <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> environ*[*'paste.recursive.script_name'*]* *=* my_script_name *try**:* *return* self*.*application*(*environ*,* start_response*)* *except* ForwardRequestException*,* e*:* middleware *=* CheckForRecursionMiddleware*(*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>*return* self*.*application*(*environ*,* start_response*)* Module paste.httpexceptions:*632* in __call__ <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> *[**]**)**.*append*(*HTTPException*)* *try**:* *return* self*.*application*(*environ*,* start_response*)* *except* HTTPException*,* exc*:* *return* exc*(*environ*,* start_response*)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>*return* self*.*application*(*environ*,* start_response*)* Module galaxy.web.framework.base:*160* in __call__ <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> kwargs*.*pop*(* '_'*,* None *)* *try**:* body *=* method*(* trans*,* ****kwargs *)* *except* Exception*,* e*:* body *=* self*.*handle_controller_exception*(* e*,* trans*,* ****kwargs *)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>body *=* method*(* trans*,* ****kwargs *)* Module galaxy.web.controllers.workflow:*207* in display_by_id <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> # Get workflow. stored_workflow = self.get_stored_workflow( trans, id ) return self.display(trans, stored_workflow) def display(self, trans, stored_workflow):>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>*return* self*.*display*(*trans*,* stored_workflow*)* Module galaxy.web.controllers.workflow:*217* in display <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> # Get data for workflow's steps. self*.*get_stored_workflow_steps*(* trans*,* stored_workflow *)* # Get annotations. stored_workflow*.*annotation *=* self*.*get_item_annotation_str* (* trans*.*sa_session*,* stored_workflow*.*user*,* stored_workflow *)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>self*.* get_stored_workflow_steps*(* trans*,* stored_workflow *)* Module galaxy.web.base.controller:*418* in get_stored_workflow_steps <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view<http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> *if* step*.*type *==* 'tool' *or* step*.*type *is* None*:* # Restore the tool state for the step module *=* module_factory*.*from_workflow_step*(* trans* ,* step *)* #Check if tool was upgraded step*.*upgrade_messages *=* module*.* check_and_update_state*(**)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>module *= * module_factory*.*from_workflow_step*(* trans*,* step *)* Module galaxy.workflow.modules:*369* in from_workflow_step <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> """ type = step.type return self.module_types[type].from_workflow_step( trans, step ) module_factory = WorkflowModuleFactory( dict( data_input=InputDataModule, tool=ToolModule ) )>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#>*return* self*.*module_types*[*type*]**.*from_workflow_step*(* trans*,* step *)* Module galaxy.workflow.modules:*202* in from_workflow_step <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> view <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> << <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> # in addition to tool id, enhance the selection process here # to retrieve the correct version of the tool. tool_version *=* self*.*__get_tool_version*(* trans*,* tool_id *)* *if* tool_version*:* tool_version_ids *=* tool_version*.*get_version_ids*(* trans*.*app *)*>> <http://127.0.0.1:8080/workflow/display_by_id?id=f2db41e1fa331b3e#> tool_version *=* self*.*__get_tool_version*(* trans*,* tool_id *)* *NameError: global name 'self' is not defined* Thankyou in advance for any help that you can give. -Rob
Hello All, I'm pretty sure I found a bug in the main galaxy distribution. The following code diff shows the introduction of the line tool_version = self.__get_tool_version( trans, tool_id ) but if you look at the function definition containing that line, you see def from_workflow_step( Class, trans, step ): which does not half a self in it. Then we get an error. https://bitbucket.org/galaxy/galaxy-dist/diff/lib/galaxy/workflow/modules.py?diff2=e6464387ed3f&diff1=c60760713d26 -Rob
Hello Robert, Thanks for reporting this issue - it has been fixed in change set 7038:1fdcce63a06f, which is currently available only in our central repository. It will be available in the dist in the next update. Greg Von Kuster On Apr 13, 2012, at 5:22 PM, Robert Chase wrote:
Hello All,
I'm pretty sure I found a bug in the main galaxy distribution. The following code diff shows the introduction of the line
tool_version = self.__get_tool_version( trans, tool_id )
but if you look at the function definition containing that line, you see
def from_workflow_step( Class, trans, step ): which does not half a self in it. Then we get an error.
-Rob ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
participants (2)
-
Greg Von Kuster
-
Robert Chase