I am currently putting together a simple chat system running on an Express Node.js server, that is connected to a Rasa Server through the Socket.IO channel.
Everything works wonderfully until I package the whole thing into Docker Containers with Docker Compose.
I have enabled CORS on the Rasa Server with the RUN command as follows:
command: run --enable-api --cors * --debug
Error
Access to XMLHttpRequest from origin has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header contains multiple values, but only one is allowed.
Thanks for the reply, but I doubt the suggested command would work because it is basically the same command that I am already using.
models is already the default value for the server configuration option –model (-m) as specified in the Rasa Open Source edition documentation (Command Line Interface: Start a Server). I have not changed the default file structure, so I don’t see how using the same value as the option’s default value will make a difference.
The quotation marks wrapping the wildcard character (*) value for the CORS option is also not necassary because the shell only needs quotes when the value has spaces (i.e. foobar vs “foo bar”) (Stack Overflow: Python argparse argument with quotes). Having quotes would also mean the model value would have to be wrapped: “models”.
I will give the suggested command a try anyway and post the results. You never know.
@JiteshGaikwad the suggested command didn’t work. Still got the same error as before.
I curious why the allowed origin IP address is being duplicated in the Access-Control-Allow-Origin response header and shouldn’t it actually be a wildcard instead of an IP address?
@daypack thanks for reporting this issue. this seems to be a bug related to the combination in python-socketio in combination with sanic. I’ve filed this as a bug on github. We’ll be looking into this!