If an exception is raised in the `try` block before the files are
created, an exception was generated in the `finally` block:
```
File "/home/nicola/software/nsoranzo_galaxy/lib/galaxy/webapps/tool_shed/controllers/repository.py", line 945, in export
repositories_archive, error_message = erm.export_repository()
File "/home/nicola/software/nsoranzo_galaxy/lib/tool_shed/capsule/capsule_manager.py", line 109, in export_repository
if os.path.exists(tmp_export_info):
UnboundLocalError: local variable 'tmp_export_info' referenced before assignment
```
Tools containing a text parameter fail with a traceback like:
```
[pid: 2433|app: 0|req: 15/28] 127.0.0.1 () {42 vars in 905 bytes} [Sun Jun 3 02:24:59 2018] GET /api/tools/addValue/build?version=1.0.0&__identifer=nv6x1qdhzxo&tool_version=1.0.0 => generated 71 bytes in 58 msecs (HTTP/1.1 500) 3 headers in 143 bytes (1 switches on core 1)
galaxy.web.framework.decorators ERROR 2018-06-03 02:25:01,999 [p:2433,w:1,m:0] [uWSGIWorker1Core0] Uncaught exception in exposed API method:
Traceback (most recent call last):
File "lib/galaxy/web/framework/decorators.py", line 281, in decorator
rval = func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/api/tools.py", line 113, in build
return tool.to_json(trans, kwd.get('inputs', kwd))
File "lib/galaxy/tools/__init__.py", line 1913, in to_json
'state_inputs' : params_to_strings(self.inputs, state_inputs, self.app),
File "lib/galaxy/tools/parameters/__init__.py", line 207, in params_to_strings
rval[key] = value if nested else str(dumps(value))
File "/usr/lib/python3.5/json/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.5/json/encoder.py", line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'c1,c2' is not JSON serializable
```
Fix the 2 following tracebacks:
```
added lib/ to pythonpath.
Traceback (most recent call last):
File "lib/galaxy/webapps/galaxy/buildapp.py", line 180, in uwsgi_app
return galaxy.web.framework.webapp.build_native_uwsgi_app(app_factory, "galaxy")
File "lib/galaxy/web/framework/webapp.py", line 968, in build_native_uwsgi_app
app_kwds = get_app_kwds(config_section)
File "lib/galaxy/web/stack/__init__.py", line 434, in get_app_kwds
return application_stack_class().get_app_kwds(config_section, app_name=app_name)
File "lib/galaxy/web/stack/__init__.py", line 260, in get_app_kwds
has_ini_config = has_ini_config or (config_file and has_ext(config_file, "ini", aliases=True, ignore="sample"))
File "lib/galaxy/util/path/__init__.py", line 290, in has_ext
root, _ext = __splitext_ignore(path, ignore=ignore)
File "lib/galaxy/util/path/__init__.py", line 387, in __splitext_ignore
root, ext = __splitext_no_sep(path)
File "lib/galaxy/util/path/__init__.py", line 381, in __splitext_no_sep
return (path.rsplit(extsep, 1) + [''])[0:2]
TypeError: a bytes-like object is required, not 'str'
unable to load app 0 (mountpoint='') (callable not found or import error)
```
```
galaxy.queue_worker INFO 2018-06-03 02:12:51,186 [p:2150,w:1,m:0] [MainThread] Binding and starting galaxy control worker for main.web.1
Traceback (most recent call last):
File "lib/galaxy/web/stack/__init__.py", line 456, in _do_uwsgi_postfork
f(*args, **kwargs)
File "lib/galaxy/webapps/galaxy/buildapp.py", line 190, in postfork_setup
app.application_stack.log_startup()
File "lib/galaxy/web/stack/__init__.py", line 351, in log_startup
for s in UWSGIApplicationStack._serving_on():
File "lib/galaxy/web/stack/__init__.py", line 237, in _serving_on
yield UWSGIApplicationStack._socket_opt_to_str(opt, val)
File "lib/galaxy/web/stack/__init__.py", line 208, in _socket_opt_to_str
if val.startswith('='):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
```
It is jarring to users that works for collection inputs but not multiple data inputs, especially because the IUC discourages collection inputs when multiple data inputs would work.
This avoids setting log and pid file in paster_args so that with
GALAXY_RUN_ALL they can be set individually, but ensures they are set
when running paster otherwise.
Otherwise these jobs may hang around forever/until the admin
does a cleanup. This is probably preferable for users as well,
as the pause message gives a hint of why their job didn't start
running. Fixes https://github.com/galaxyproject/galaxy/issues/6022
and would minimize maintenance as outlined in https://github.com/galaxyproject/galaxy/issues/5944.
I'm working on tests, but one easy way to test this is create a collection
through the list builder interface, then delete the source HDAs.
Then run a workflow on the collection and without this commit
the outputs get created but the job just hangs around indefinetely.
With the PR the steps consuming the collection and the subsequent jobs
will be paused.
Set to paused
This is necessary when mapping over a collection over an input
that is referenced in the output section, like so:
```
...
<when value="paired_collection">
<action type="format">
<option type="from_param" name="library.input_1" param_attribute="reverse.ext" />
</action>
</when>
...
```