Rasa Core version: 0.9.4
Python version: 3.6
Operating system (windows, osx, ...): macOS, Docker
Issue:
Hey,
I am trying to run the rasa-core as http server. Unfortunately I get the following error, if I try to get an response from the dialogue engine:
rasa-core_1 | 2018-06-08 14:51:12 ERROR flask.app - Exception on /conversations/default/respond [GET]
rasa-core_1 | Traceback (most recent call last):
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
rasa-core_1 | response = self.full_dispatch_request()
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rasa-core_1 | rv = self.handle_user_exception(e)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
rasa-core_1 | return cors_after_request(app.make_response(f(*args, **kwargs)))
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
rasa-core_1 | reraise(exc_type, exc_value, tb)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
rasa-core_1 | raise value
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rasa-core_1 | rv = self.dispatch_request()
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
rasa-core_1 | return self.view_functions[rule.endpoint](**req.view_args)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
rasa-core_1 | resp = make_response(f(*args, **kwargs))
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/rasa_core/server.py", line 122, in decorated
rasa-core_1 | return f(*args, **kwargs)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/rasa_core/server.py", line 83, in decorated
rasa-core_1 | return f(*args, **kwargs)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/rasa_core/server.py", line 341, in respond
rasa-core_1 | message = request_params.pop('q')
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/werkzeug/datastructures.py", line 179, in pop
rasa-core_1 | is_immutable(self)
rasa-core_1 | File "/usr/local/lib/python3.6/site-packages/werkzeug/datastructures.py", line 29, in is_immutable
rasa-core_1 | raise TypeError('%r objects are immutable' % self.__class__.__name__)
rasa-core_1 | TypeError: 'ImmutableMultiDict' objects are immutable
Hi,
You need to insert the to_dict() function before pop in the server file. To make it work, I copied the server.py content into a new file that launches the server after having corrected as below for parse and respond endpoints :
elif 'q' in request_params:
message = request_params.to_dict().pop('q')
Maybe the Rasa team (@tmbo) can fix it directly in the next update ?
How were you able to do this
"I copied the server.py content into a new file that launches the server after having corrected as below for parse and respond endpoints :"
I have been having this problem for long and it is still not fixed.
Should be fixed on the master branch and will be part of the next bug fix release of 0.10.x
Copying the server file and then making the following changes
elif 'q' in request_params:
message = request_params.to_dict().pop('q')
then delete the original server file and pasting the edited one will solve the problem.
Indeed, or start server from your new modified file directly.