Hi Assaf, I took a look and have found the issue. When outputs have labels, the code in tools/actions/__init__.py:255~ gets executed. The wrap_values method that gets called creates wrapper elements for all the inputs, but then when it tries to get converted to JSON, it fails because the values are wrapper objects instead of basic types (strings, numbers, etc). {'chromInfo': u'/Users/Kanwei/galaxy-central/tool-data/shared/ucsc/chrom/hg18.len', 'dbkey': u' hg18', 'dummyrepeat': [{'__index__': 0, 'dummyselect': <galaxy.tools.SelectToolParameterWrapper object at 0x3942a50>}], 'input': <galaxy.model.HistoryDatasetAssociation object at 0x3963ff0>} I have attached a patch that fixes this issue specifically for Select parameters. It's hackish but the values are encoded properly. I haven't tried it with other types of inputs but the fix would similar if they are broken as well. Kanwei On Wed, Feb 17, 2010 at 2:26 PM, Assaf Gordon <gordon@cshl.edu> wrote:
Hello,
First, thanks for fixing the boolean testing bug.
We're having strange exception thrown in some of our tools, when a tool has a <repeat> section, a selection-box parameter and an output label. That might sound strange, but I've narrowed it down and it's (almost) definitely caused by the combination of those three.
I know you don't use the "label" option in the public Galaxy, but we use it in many of our tools, and for some it simply doesn't work.
Attached are three simple tools:
tool_without_label: has a <repeat> parameter, a selection-box parameter, no 'label' in the <output>. works ok.
tool_without_select: has a <repeat> parameter, a text parameter (instead of a selection box), and a label in the <output>. works ok.
tool_with_label: has all three items: a <repeat>, a selection-box, and a label. Executing this tool throws an exception: ======================= URL: http://localhost:8080/tool_runner/index File '/home/gordon/temp/galaxy/eggs/py2.5-noplatform/WebError-0.8a-py2.5.egg/weberror/evalexception/middleware.py', line 364 in respond app_iter = self.application(environ, detect_start_response) File '/home/gordon/temp/galaxy/eggs/py2.5-noplatform/Paste-1.6-py2.5.egg/paste/debug/prints.py', line 98 in __call__ environ, self.app) File '/home/gordon/temp/galaxy/eggs/py2.5-noplatform/Paste-1.6-py2.5.egg/paste/wsgilib.py', line 539 in intercept_output app_iter = application(environ, replacement_start_response) File '/home/gordon/temp/galaxy/eggs/py2.5-noplatform/Paste-1.6-py2.5.egg/paste/recursive.py', line 80 in __call__ return self.application(environ, start_response) File '/home/gordon/temp/galaxy/eggs/py2.5-noplatform/Paste-1.6-py2.5.egg/paste/httpexceptions.py', line 632 in __call__ return self.application(environ, start_response) File '/home/gordon/temp/galaxy/lib/galaxy/web/framework/base.py', line 125 in __call__ body = method( trans, **kwargs ) File '/home/gordon/temp/galaxy/lib/galaxy/web/controllers/tool_runner.py', line 53 in index template, vars = tool.handle_input( trans, params.__dict__ ) File '/home/gordon/temp/galaxy/lib/galaxy/tools/__init__.py', line 792 in handle_input out_data = self.execute( trans, incoming=params ) File '/home/gordon/temp/galaxy/lib/galaxy/tools/__init__.py', line 1064 in execute return self.tool_action.execute( self, trans, incoming=incoming, set_output_hid=set_output_hid ) File '/home/gordon/temp/galaxy/lib/galaxy/tools/actions/__init__.py', line 297 in execute for name, value in tool.params_to_strings( incoming, trans.app ).iteritems(): File '/home/gordon/temp/galaxy/lib/galaxy/tools/__init__.py', line 1067 in params_to_strings return params_to_strings( self.inputs, params, app ) File '/home/gordon/temp/galaxy/lib/galaxy/tools/parameters/__init__.py', line 80 in params_to_strings rval[ key ] = str( to_json_string( value ) ) File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/__init__.py', line 182 in dumps File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 312 in encode File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 262 in _iterencode File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 170 in _iterencode_list File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 265 in _iterencode File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 235 in _iterencode_dict File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 273 in _iterencode File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 279 in _iterencode_default File 'build/bdist.solaris-2.11-i86pc/egg/simplejson/encoder.py', line 300 in default TypeError: <galaxy.tools.SelectToolParameterWrapper object at 0x49a8d10> is not JSON serializable =======================
Any help/fix would be greatly appreciated.
thanks! -gordon
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev