goplaxt icon indicating copy to clipboard operation
goplaxt copied to clipboard

Oh No! on port 8000

Open spicerackk opened this issue 4 years ago • 14 comments

This is my first Docker container, and am struggling to understand what I have done wrong.

I copied the code to get it running, modified all the correct settings, and when I start the container and go to web browser, it loads localhost:8000 and only shows a white page with "Oh No!".

I'm not sure where I am going wrong with it.

Any help would be appreciated!

spicerackk avatar Apr 28 '20 05:04 spicerackk

Please post any relevant logs so that I can diagnose the issue.

XanderStrike avatar Apr 28 '20 16:04 XanderStrike

2020/04/29 10:20:35 Started!

2020/04/29 10:20:35 Using disk storage:

2020/04/29 10:20:35 Allowed Hostnames: [192.168.86.245:8000/authorize]

2020/04/29 10:20:35 Started on 0.0.0.0:8000!

Sorry for the delayed response, had a super busy day! This is all it shows in Docker.

spicerackk avatar Apr 29 '20 10:04 spicerackk

Hello Xander, hijacking this issue as I'm struggling a bit to make my self-hosted instance running. These are the steps I followed:

Trakt Side:

  1. Created a new Trakt app here
  2. Gave check in and scrobble option
  3. set the Redirect URI to the same as the one set in the docker (https://my public ip/authorize) - I've also tried without authorize
  4. Tried to click on the "authorize" button, Trakt shows the authorization splash, but then it just go to the "Oh, no" page.

Docker Side:

  1. set the TRAKT_ID and TRAKT_SECRET env var to ones got from Trakt
  2. ALLOWED_HOSTNAMES is the same as point 3 in previous list (this time with authorize)

Tried to navigate to the address, no success.

Plex Side:

  1. Defined a webhook, but I don't know which ID I should use, I think that if I don't get the authorize part on Trakt and I cannot access the address, then I cannot also get the webhook address to use in Plex.

Thanks in advance for your time and support! Awesome project!

Edit: I’ve also tried exposing the lan ip on the docker “allowed hostname env”, again with the /authorize endpoint specified, still no luck. On trakt I’m using the public exposed address (behind nginx), but I still get the “oh no” page.

meme1337 avatar May 05 '20 15:05 meme1337

Tried setting the container with net=host property, still get the "Oh no" page. I don't know what it's wrong to be honest.

meme1337 avatar May 06 '20 09:05 meme1337

@spicerackk

I managed to get it working by not setting the "allowed_hostnames" option. And on my NGINX I had also to explicitly redirect the /authorize endpoint to the local one from the docker. When I now open the address from my public exposed address I can register on trakt, and get the endpoint to use on plex. For a security measure I put also a basic authentication in front of the site, and use the username and password in the webhook in plex in the form https://username:[email protected]?yadayadayada.

Hope it works for you too.

meme1337 avatar May 07 '20 06:05 meme1337

@meme1337 ok fair enough, I'll have to see how I go, I'm still very new to all of this sort of stuff. I do have NGINX installed and working, just not sure how to redirect an endpoint in it.

spicerackk avatar May 11 '20 00:05 spicerackk

@meme1337 ok fair enough, I'll have to see how I go, I'm still very new to all of this sort of stuff. I do have NGINX installed and working, just not sure how to redirect an endpoint in it.

I hope Xander can chime in as well. I’m no expert as well and mostly doing trial by error :-) I don’t understand why it wasn’t recognizing the address I was connecting from though, and that I had to remove that variable from the docker container. But I’ve been using it for the past days and it kinda works (except when it cannot recognize the movie because the year associated in plex is different)

meme1337 avatar May 11 '20 15:05 meme1337

@meme1337 ....And on my NGINX I had also to explicitly redirect the /authorize endpoint to the local one from the docker.

How did u do that?

sasagr avatar Dec 02 '20 07:12 sasagr

@meme1337 ....And on my NGINX I had also to explicitly redirect the /authorize endpoint to the local one from the docker.

How did u do that?

I'm using NGINX proxy manager because i'm not a NGINX expert, but this is the result conf file:

location /authorize {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_pass       http://<plaxtip>:8000/authorize;

  }

Let me know if this helps you!

edit: you have to change plaxtip with your values or your placeholder

meme1337 avatar Dec 02 '20 10:12 meme1337

I does not seem to help me much. I m using the docker-compose with this yml. I added a proxy redirect version: "3.4" # This will probably also work with version 2 services: plaxt: container_name: plaxt environment: - TRAKT_ID=xxx - TRAKT_SECRET=yyy image: xanderstrike/goplaxt:latest-arm7 ports: - 8000:8000 restart: unless-stopped volumes: - /home/pi/docker:/app/keystore

redirect: image: nginx:latest volumes: - ./nginx.conf:/etc/nginx/nginx.conf

the local nginx.conf is including your lines Now what happens is that I get access to the page where I can input the plex user name but then I get a OAUTH ERROR The requested redirect uri is malformed or doesn't match client redirect URI.

Any idea?

sasagr avatar Dec 02 '20 12:12 sasagr

Ok. I managed to get it working but I would say not in the best proper way. Basically I removed the nginx part from the yml file. I added the /authorize to the URL in the trakt page. When I click authorize at a certain point it will give me an error. I manually remove the authorize and it will continue till the end successfully. Note that if I remove the /authorize from the URL in trakt, I will not get the first error but then I will get later the OAUTH ERROR. I m not sure how I can fix this but at least it is working (even if not properly)

sasagr avatar Dec 02 '20 15:12 sasagr

Unfortunately I'm not really familiar with configuring nginx as a reverse proxy. For all my homelab stuff I use an automated reverse proxy with letsencrypt which means I've never had to actually reach into nginx config. It seems to just redirect all traffic to plaxt.astandke.com straight to the exposed port on the container without any concern for paths.

We can leave this open in case it helps others using nginx reverse proxies.

XanderStrike avatar Dec 26 '20 21:12 XanderStrike

For my self-hosted instance I was also getting the "Oh No!" error page until I commented out the "ALLOWED_HOSTNAMES" variable as follows:

version: "3.4" # This will probably also work with version 2 services: plaxt: container_name: plaxt environment: - TRAKT_ID=****** - TRAKT_SECRET=****** #- ALLOWED_HOSTNAMES=http://192.168.0.111:8000/authorize image: xanderstrike/goplaxt ports: - 8000:8000 restart: unless-stopped volumes: - /srv/dev-disk-by-uuid-af8c404d-5e51-49a3-8f7c-e3753631489b/DATA/AppData/plaxt:/app/keystore

JoeBoJoe avatar Aug 19 '21 01:08 JoeBoJoe

@JoeBoJoe Make sure to only use the hostname without the URL path, i.e. ALLOWED_HOSTNAMES=http://192.168.0.111:8000 or ALLOWED_HOSTNAMES=192.168.0.111:8000/authorize.

For other people that might end up looking here, when using a docker-compose.yml file, be careful to not use " " around your hostnames, they might get passed to the application too.

Does not work:

    - ALLOWED_HOSTNAMES="localhost:8000"

Does work:

    - ALLOWED_HOSTNAMES=localhost:8000

lumaxis avatar Jan 11 '22 02:01 lumaxis