server-docker icon indicating copy to clipboard operation
server-docker copied to clipboard

Getting CORS error even after passing NO_CORS=1

Open pankaj485 opened this issue 1 year ago • 1 comments

Command executed:

docker run --rm -d -p 11470:11470 -p 12470:12470 -e NO_CORS=1 stremio/server:latest

Issue Description

I followed the above command and the local server was executing on the system and it was accessible at http://localhost:11470. However, I got warning Could not update casting device info: streaming server might be offline when I tried to click on any videos.

Upon checking the network tab, it was showing CORS error on http://localhost:11470/casting although the environment flag -e NO_CORS=1 was still applied.

Am I missing anything here? The same command used to execute well there and there was no problem to access it.

Upon Inspecting the running container, It seems to be having correct configuration for CORS too. Here is the env when inspected the container.

"Env": [
	"NO_CORS=1",
	"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
	"NODE_VERSION=14.21.3",
	"YARN_VERSION=1.22.19",
	"FFMPEG_BIN=",
	"FFPROBE_BIN=",
	"APP_PATH=",
	"CASTING_DISABLED=1"
],

pankaj485 avatar Jul 10 '24 10:07 pankaj485

I'm having an issue where the server errors out and doesn't recover, but the container remains up. Since the server doesn't respond, the browser says: "No 'Access-Control-Allow-Origin' header is present on the requested resource."

I bet if you check the logs, the server has an error.

kennyparsons avatar Aug 13 '24 02:08 kennyparsons

There's another option If you have another container running and create a new server container, since the default port is used by the old docker container, the server (inside the new docker container) will have a different port which won't be exported.

Make sure to stop any other server containers first.

image

Please, re-open the issue if you still can't fix this.

elpiel avatar Oct 15 '24 10:10 elpiel