Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 500 in /videoplayback with DASH on local instance - DNS issue #5123

Closed
alindt opened this issue Dec 23, 2024 · 9 comments
Closed

HTTP 500 in /videoplayback with DASH on local instance - DNS issue #5123

alindt opened this issue Dec 23, 2024 · 9 comments
Labels
question Further information is requested

Comments

@alindt
Copy link

alindt commented Dec 23, 2024

Describe the bug

  • HTTP 500 in /videoplayback with quality=dash on both dev/release with docker (local instance)
  • The media could not be loaded, either because the server or network failed or because the format is not supported.
  • 1 in 50-ish videos will play with DASH but the audio language is usually not English if multiple tracks are available

Steps to Reproduce
Use quality=dash for any video

Logs
devtools-console.txt
devtools-network.json
invidious-container-logs.txt

Additional context

  • Browser: Firefox 133.0.3 (64-bit)
  • OS: Linux Mint 22 (64-bit)
  • Docker: 26.1.3 (linux/amd64)

docker-compose.yaml

# Warning: This docker-compose file is made for development purposes.
# Using it will build an image from the locally cloned repository.
#
# If you want to use Invidious in production, see the docker-compose.yml file provided
# in the installation documentation: https://docs.invidious.io/installation/

services:

  app:
    build:
      context: .
      dockerfile: docker/Dockerfile
    restart: unless-stopped
    depends_on:
      - inv_sig_helper
      - db
    ports:
      - "3777:3000"
    environment:
      # Please read the following file for a comprehensive list of all available
      # configuration options and their associated syntax:
      # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: kemal
          host: db
          port: 5432
        check_tables: true
        signature_server: inv_sig_helper:12999
        # external_port:
        # domain:
        # https_only: false
        # statistics_enabled: false
        hmac_key: "AThibeeQuah7hees9oit"
        visitor_data: CgtXUUtEV3...........
        po_token: MpQBc3sRAoQIJM...........
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2

  inv_sig_helper:
    image: quay.io/invidious/inv-sig-helper:latest
    init: true
    command: ["--tcp", "0.0.0.0:12999"]
    environment:
      - RUST_LOG=info
    restart: unless-stopped
    cap_drop:
      - ALL
    read_only: true
    security_opt:
      - no-new-privileges:true

  db:
    image: docker.io/library/postgres:14
    restart: unless-stopped
    volumes:
      - ./postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: kemal
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
@alindt alindt added the bug Something isn't working label Dec 23, 2024
@unixfox
Copy link
Member

unixfox commented Dec 23, 2024

Please check the devtools in the network tab what's the status code of the requests. Also check the logs of the invidious container.

@alindt
Copy link
Author

alindt commented Dec 23, 2024

The devtools logs are attached in the bug report as devtools-console.txt.
Edited the bug report to include the container logs, but they show pretty much the same thing.
Added devtools-network.json log from devtools → network → HAR

@unixfox
Copy link
Member

unixfox commented Dec 23, 2024

Thanks but I do not see the "devtools-network.json" file.

@alindt
Copy link
Author

alindt commented Dec 23, 2024

Reuploaded.

@unixfox
Copy link
Member

unixfox commented Dec 26, 2024

The videoplayback URLs are very strange. There are a lot of parameters missing.

@alindt Could you check if what this user said could apply to you: iv-org/youtube-trusted-session-generator#21? And try their solution?

@alindt
Copy link
Author

alindt commented Dec 26, 2024

@unixfox No change, still getting HTTP 500:

  1. applied the patch
  2. regenerated visitor_data and po_token
  3. deleted all data+caches form docker/browser
  4. opened http://10.10.0.9:3999/watch?v=pom259EUmi8 → video plays in medium quality
  5. opened http://10.10.0.9:3999/watch?v=pom259EUmi8&quality=dash → HTTP 500

Logs (replaced my public IP with 127.127.127.127:

@cgmastertecnology

This comment was marked as off-topic.

@unixfox
Copy link
Member

unixfox commented Dec 26, 2024

Did you try on another browser? Because based on the logs you are missing the "host" query string in the videoplayback which is very odd, that's probably why invidious returns a 500. I have never seen such issue before.

I'm going to close this issue since I just tried a new docker install of invidious and dash is working perfectly fine on all videos.

@unixfox unixfox closed this as completed Dec 26, 2024
@unixfox unixfox closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
@alindt
Copy link
Author

alindt commented Dec 27, 2024

I've finally tracked down the issue to DNS, more specifically to a Pi-Hole instance that blocked any requests to *.googlevideo.com by resolving them to 0.0.0.0.

2024-12-26 23:38:49 UTC [info] 200 GET /api/manifest/dash/id/ZB5Tn6pLogc?local=true&unique_res=1 5.37ms

2024-12-26 23:38:49 UTC [info] #<HTTP::Client:0x7196a58e2790
 @before_request=nil,
 @compress=true,
 @connect_timeout=00:00:10,
 @dns_timeout=nil,
 @family=Socket::Family::INET,
 @host="r4---sn-5hne6nzs.googlevideo.com",
 @io=nil,
 @port=443,
 @proxy=nil,
 @read_timeout=00:00:10,
 @reconnect=true,
 @tls=
  #<OpenSSL::SSL::Context::Client:0x7196a512f5a0
   @alpn_protocol=Pointer(Void).null,
   @handle=Pointer(Void)@0x71969f994010,
   @hostname=nil>,
 @write_timeout=nil>

2024-12-26 23:38:49 UTC [info] r4---sn-5hne6nzs.googlevideo.com resolved to 0.0.0.0:443 → INVALID!

2024-12-26 23:38:49 UTC [info] 500 GET /videoplayback?expire=1735277918&ei=_uhtZ5vvJP_Gi9oP8K-88AI&ip=...

@unixfox unixfox changed the title HTTP 500 in /videoplayback with DASH on local instance HTTP 500 in /videoplayback with DASH on local instance - DNS issue Dec 27, 2024
@unixfox unixfox added question Further information is requested and removed bug Something isn't working labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants