Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Failed to fetch #10

Closed
devve2kccc opened this issue Jun 11, 2022 · 12 comments
Closed

Failed to fetch #10

devve2kccc opened this issue Jun 11, 2022 · 12 comments

Comments

@devve2kccc
Copy link

Im getting "Failed to fetch" error when i try so start a movie with torrentio plugin, what can be?

@kvn1351
Copy link

kvn1351 commented Jun 29, 2022

Same

@sleeyax
Copy link
Owner

sleeyax commented Jun 30, 2022

More details are needed:

  • Which movie?
  • Which Stremio version (4, 5, web or client)?

@Nicohidalgo
Copy link

I get the same error when i try to watch any movie with any addon

image

@Nicohidalgo
Copy link

I think this is the problem but I don't know how to fix it
image
image

@sleeyax
Copy link
Owner

sleeyax commented Jul 4, 2022

@Nicohidalgo it says streaming server not available. Check if the streaming server url is correct and disable any firewall or AV. A quick smoke test id to ping the host.

@kvn1351
Copy link

kvn1351 commented Jul 4, 2022

I have the same issue, Stremio can't connect to the server. When I enter <serverIP>:11470 in the browser it takes me straight to Stremio with the correct settings. However, the server "is not available".

version: "2.1"
services:
  stremio-server:
    image: sleeyax/stremio-streaming-server
    container_name: stremio-streaming-server
    environment:
      - TZ=Europe/Berlin
    volumes:
      - redacted
    ports:
      - 11470:11470
    restart: unless-stopped

I have about 15 other dockers that work fine from this same server. So it's not a network issue. Not the environment at least.

@kvn1351
Copy link

kvn1351 commented Jul 4, 2022

Edit: Sorry, I was still using a testing container with another IP.

nmap shows that it's open and reachable. But the server still has an X in stremio.

Old comment:

nmap shows that there isn't anything running at the port or that it's closed.

PORT      STATE  SERVICE
11470/tcp closed unknown

@sleeyax
Copy link
Owner

sleeyax commented Jul 5, 2022

Hmm it could be that the browser blocks requests to LAN ips from a HTTPS site like app.stremio.com, see https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content#loading_locally_delivered_mixed-resources. The same likely goes for chrome.

I think you'll need to use localhost/127.0.0.1 or setup a local tunnel to access it to avoid browser issues.

@kvn1351
Copy link

kvn1351 commented Jul 5, 2022

You're right! This was the issue. I got sidetracked with CORS thinking that it might somehow be a problem despite the hotfix in #5.

Since I wanted to use this across networks, localhost isn't a solution.

Localtunnel would probably work fine. Another way, which is what I've done, is to make a simple reverse proxy (one that sends all headers intact). I would recommend traefik (the docker way) or caddy for this. Caddy only needs a few lines to make this work.

One thing I'd hotpatch in the dockerfile in regards to server.js though is the line (or the block containing) var serverUrl = encodeURIComponent( protocol + req.headers.host); where protocol should be hardcoded to 'https'.
I don't know if it's only like this for me, but when I enter httpS://reverseProxyStremio.io into the browser. It redirects me to https://app.strem.io/shell-v4.4/, but sets the streamingServer to HTTP, not HTTPS! So I have to manually change that in the address bar to make it work. I didn't notice this initially...
So this behaviour could be hotpatched and controlled with an ENV variable for when reverse proxies/localtunnel is used.

Now everything is working fine. Finally Stremio on an Apple device, anywhere around the world :)

@sleeyax sleeyax closed this as completed Jul 5, 2022
@Nicohidalgo
Copy link

Nicohidalgo commented Jul 5, 2022

I've tried localtunnel and ngrok but these don't work for me the 'streaming server URL' changes to the url that gives me localtunnel or ngrok so it says that streaming server is not available, only works when I use a localhost ip but I wanted to use my pc as a server to my private LAN and I can't change the 'streaming server URL' manually

image
image
image
image

Edit:

Ok, nevermind, I didn't see in the comment of kvn1351 that I had to change in the address bar HTTP to HTTPS and now works but I have to do it every time I refresh the page

@kvn1351
Copy link

kvn1351 commented Jul 5, 2022

I've tried localtunnel and ngrok but these don't work for me the 'streaming server URL' changes to the url that gives me localtunnel or ngrok so it says that streaming server is not available, only works when I use a localhost ip but I wanted to use my pc as a server to my private LAN and I can't change the 'streaming server URL' manually

image image image image

Edit:

Ok, nevermind, I didn't see in the comment of kvn1351 that I had to change in the address bar HTTP to HTTPS and now works but I have to do it every time I refresh the page

I've patched the script as I proposed above. It can be activated by a docker ENV variable. I'll make a pull request tomorrow.
That way you won't have to change the URL anymore.

@Wolfynator
Copy link

Wolfynator commented Jan 2, 2023

Hmm it could be that the browser blocks requests to LAN ips from a HTTPS site like app.stremio.com, see https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content#loading_locally_delivered_mixed-resources. The same likely goes for chrome.

I think you'll need to use localhost/127.0.0.1 or setup a local tunnel to access it to avoid browser issues.

I am trying to get this to work but the streaming server is still unavailable. Tried the FORCE_HTTPS patch as well but the problem still persists. Even tried using ngrok but nothing. My streaming server is running on a public IP so I really don't know what the issue is here. I also want to add that it is definitely not a firewall issue either as there is none during my testing. Any help would be appreciated.
image
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants