RaunoT / plex-rewind

Present Plex user statistics and habits in a beautiful and organized manner.
GNU General Public License v3.0
187 stars 8 forks source link

We were unable to complete this request. You will be redirected automatically. #143

Closed jl94x4 closed 3 months ago

jl94x4 commented 4 months ago

Plex Rewind Version

latest

Description

When clicking "log in via Plex" I get the following on the Plex popup

"We were unable to complete this request. You will be redirected automatically."

Steps to reproduce

Load up > Log in to Plex

Screenshots

image

image

Logs

Settings file not found. Creating a new one.
  ▲ Next.js 14.2.5
  - Local:        http://localhost:8383
  - Network:      http://0.0.0.0:8383

 ✓ Starting...
 ✓ Ready in 106ms
  ▲ Next.js 14.2.5
  - Local:        http://localhost:8383
  - Network:      http://0.0.0.0:8383

 ✓ Starting...
 ✓ Ready in 93ms

Platform

desktop

Device

PC

Operating System

Windows 11

Browser and version

Version 126.0.2592.102 (Official build) (64-bit)

Additional context

No response

jl94x4 commented 4 months ago

Now getting this error

Settings file not found. Creating a new one.
Tautulli API request failed: 404 Not Found
Error getting Plex user! SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:4306:19)
    at successSteps (node:internal/deps/undici/undici:4288:27)
    at fullyReadBody (node:internal/deps/undici/undici:2724:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async consumeBody (node:internal/deps/undici/undici:4297:7)
    at async Object.authorize (/app/.next/server/app/settings/connection/page.js:1:13113)
    at async Object.c (/app/.next/server/chunks/997.js:30:4477)
    at async m (/app/.next/server/chunks/997.js:6:107528)
    at async s (/app/.next/server/chunks/997.js:30:19587)
  ▲ Next.js 14.2.5
  - Local:        http://localhost:8383
  - Network:      http://0.0.0.0:8383

 ✓ Starting...
 ✓ Ready in 125ms
  ▲ Next.js 14.2.5
  - Local:        http://localhost:8383
  - Network:      http://0.0.0.0:8383
GoryDuo-og commented 4 months ago

i was getting your original redirect error but i changed both Authentication URL: and Site URL: to a linked https:// site and i was then able to login with plex

RaunoT commented 4 months ago

Please have a look at #108, which was similar, and go through the steps listed there first.

RaunoT commented 4 months ago

@jl94x4 any updates regarding this on latest version?

jl94x4 commented 3 months ago

@jl94x4 any updates regarding this on latest version?

Still getting this issue.

Sorry for late reply, been down with COVID.

jl94x4 commented 3 months ago

  plex-rewind:
    image: ghcr.io/raunot/plex-rewind:develop
    container_name: plex-rewind
    environment:
      - NEXTAUTH_SECRET=<key>
      - NEXTAUTH_URL=https://rewind.plexified.co.uk
      - NEXT_PUBLIC_SITE_URL=https://rewind.plexified.co.uk
      - NEXT_PUBLIC_STATISTICS_START_DATE=2018-01-01
    volumes:
      - /mnt/nvme/plexified/services/rewind:/app/config
    ports:
      - 8383:8383
    restart: unless-stopped```
RaunoT commented 3 months ago

Hi @jl94x4, hope you're feeling better! Sad to hear that you're still having this issue. I will reopen the issue.

Your config looks fine, however I noticed when trying to log into your site, that the URL looks like this: https://app.plex.tv/auth/<irrelevant-stuff>&forwardUrl=http%3A%2F%2Flocalhost%3A8383%3F<irrelevant-stuff>

It's trying to redirect you back to localhost:8383, which is not correct, it should use the value from NEXTAUTH_URL. I recommend you delete your current Docker container and run docker compose pull and docker compose up -d again with the same docker-compose file that you shared.