Error Running QIIME2 Studio - Bad Request

HI all,

Experiencing an error when running QIIME 2 Studio. I am a attempting to collapse a Feature Table by sample using the command “Feature Table - Group samples or features by a metadata column”.

An error message appears saying “Bad Request”. I have checked versions 2019.4 and 2019.7. The previous version works ok but not the current version. For reference the command will work in 2091.7 when running command line so I assume the problem is QIIME2 studio specific.

Any help appreciated. Unlike most I rely on the Q2S interface to process data.

1 Like

@ebolyen - HI Evan. Any thoughts on this one? Interested to see if you have been able to replicate the error. Still concerned that it might be an issue at my end as opposed to the Q2S workflow.

1 Like

HI all. Just wondering if there has been any success in replicating this error on anyone elses systems?

1 Like

Hi @bmurph79,

Thank you for the report, and sorry for the delay!

I was able to reproduce, although to get this traceback, I had to do some tricky things to the installation:

API (error): Traceback (most recent call last):
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/gevent/", line 976, in handle_one_response
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/gevent/", line 923, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 39, in reraise
    raise value
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 39, in reraise
    raise value
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/flask/", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/q2studio-2019.7.0/q2studio/", line 18, in func_wrapper
    return func(*args, **kwargs)
  File "/opt/q2studio-2019.7.0/q2studio/api/", line 114, in create_job
    parameters = action.signature.decode_parameters(**parameters)
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/core/type/", line 320, in decode_parameters
    params[key] = spec.qiime_type.decode(kwargs[key])
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/core/type/", line 424, in decode
    if not self.is_element(metadata):
  File "/home/qiime2/miniconda/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/core/type/", line 412, in is_element
    raise NotImplementedError
API (error): 2019-10-03T01:11:48Z {'REMOTE_ADDR': '', 'REMOTE_PORT': '35680', 'HTTP_HOST': 'localhost:41411', (hidden keys: 28)} failed with NotImplementedError

It looks like this is definitely a bug on our end. I’ll poke around some more to figure out how to fix it. In the meanwhile, you may want to stick with 2019.4 for a bit.

HI @ebolyen,

Much appreciated. Glad you were able to reproduce the error, i.e. it was not just me. Looking forward to the fix when possible.

1 Like


Hi Evan. Just as a update on this issue. It seems that the error collapsing feature tables extends to any analysis that requires a table to be collapsed using Q2S. This includes beta diversity comparisons between groups in a metadata field presumably because an initial processing step is needed before analysis. Essentially this means that taxa bar plots, beta diversity, ANCOM etc are all currently non functional when using Q2S.

Hi @bmurph79! Just want to point out, taxa barplots can’t work with a collapsed table, so there is no reason for those plots to not work because of this q2studio problem.

@thermokarst Thanks Matthew. The initial bar plots will be fine but its not that often that I look at tables on a per samples basis. Its usually helpful to collapse the feature table on a metadata field e.g. “bodysite” and then plot the chart again based on this collapsed table. Hope that make sense.

I have previously collapsed a feature table based on a metadata field and then plotted the taxa plot again. Is there any issue with doing this?


Nothing wrong here, just sounds like a difference in terminology.

To the QIIME 2 developers, “collapse” means to group on the feature axis (i.e., after the qiime taxa collapse method, which collapses based on taxonomy).

When you say “collapse” @bmurph79, you refer to what we call “group”, implying collapsing/grouping along the sample axis (i.e., after the qiime feature-table group method, which can group along either axis but typically the sample axis).

1 Like

Thanks @bmurph79!

Issues with other actions makes sense as I believe anything accepting a MetadataColumn[...] is currently broken in q2studio. I believe all of those actions (except taxa barplot) use that type.

I’m working on a patch for this cycle which should address is.


This pull request should correct the issue:

Barring anything extraordinary, we should expect this to be fixed for 2019.10 :slight_smile:

Thanks again for reporting @bmurph79!

1 Like

Excellent. Many thanks all. Guess I have no excuses now for not getting back to analysis!!! :+1:

1 Like