No Playback .... circle keeps turning

Hi there,

first of all « Hi » (my first post here :slight_smile: )

I installed peertube (docker-compose version) within a company network and uploaded a video for testing .
It was published, but when i click on it the circle keeps turning and playback won´t start probably due to this:


error[15.9.2022, 13:52:04] uncaughtException: Socket closed unexpectedly Error: Socket closed unexpectedly at Socket.<anonymous> (/app/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118) at Object.onceWrapper (node:events:628:26) at Socket.emit (node:events:513:28) at Socket.emit (node:domain:489:12) at TCP.<anonymous> (node:net:757:14)
{
  "error": {
    "stack": "Error: Socket closed unexpectedly\n    at Socket.<anonymous> (/app/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)\n    at Object.onceWrapper (node:events:628:26)\n    at Socket.emit (node:events:513:28)\n    at Socket.emit (node:domain:489:12)\n    at TCP.<anonymous> (node:net:757:14)",
    "message": "Socket closed unexpectedly"
  },
  "stack": "Error: Socket closed unexpectedly\n    at Socket.<anonymous> (/app/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)\n    at Object.onceWrapper (node:events:628:26)\n    at Socket.emit (node:events:513:28)\n    at Socket.emit (node:domain:489:12)\n    at TCP.<anonymous> (node:net:757:14)",
  "exception": true,
  "date": "Thu Sep 15 2022 11:52:04 GMT+0000 (Coordinated Universal Time)",
  "process": {
    "pid": 1,
    "uid": 999,
    "gid": 999,
    "cwd": "/app",
    "execPath": "/usr/local/bin/node",
    "version": "v16.17.0",
    "argv": [
      "/usr/local/bin/node",
      "/app/dist/server"
    ],
    "memoryUsage": {
      "rss": 158523392,
      "heapTotal": 99033088,
      "heapUsed": 93313272,
      "external": 2349111,
      "arrayBuffers": 631631
    }
  },
  "os": {
    "loadavg": [
      0,
      0.2,
      0.15
    ],
    "uptime": 427.06
  },
  "trace": [
    {
      "column": 118,
      "file": "/app/node_modules/@node-redis/client/dist/lib/client/socket.js",
      "function": null,
      "line": 182,
      "method": null,
      "native": false
    },
    {
      "column": 26,
      "file": "node:events",
      "function": "Object.onceWrapper",
      "line": 628,
      "method": "onceWrapper",
      "native": false
    },
    {
      "column": 28,
      "file": "node:events",
      "function": "Socket.emit",
      "line": 513,
      "method": "emit",
      "native": false
    },
    {
      "column": 12,
      "file": "node:domain",
      "function": "Socket.emit",
      "line": 489,
      "method": "emit",
      "native": false
    },
    {
      "column": 14,
      "file": "node:net",
      "function": null,
      "line": 757,
      "method": null,
      "native": false
    }
  ]
}

Additionally I´m seeing that (but not always :frowning: )

warn[15.9.2022, 13:54:33] It seems PeerTube was started (and created some data) with another domain name. This means you will not be able to federate! Please use NODE_CONFIG_DIR=/app/config:/app/support/docker/production/config:/config NODE_ENV=production npm run update-host to fix this.

I´m a total beginner with peertube.

Anybody can give me a few good hints ?

Thanks folks and Greetings,

JP

nobody ? :frowning:

Hello,

Can you paste your docker compose file?

Hey there,

thanks for taking care :slight_smile:

My docker-compose looks like this:

version: "3.3"

services:

  # You can comment this webserver section if you want to use another webserver/proxy
  webserver:
    image: chocobozzz/peertube-webserver:latest
    # If you don't want to use the official image and build one from sources:
    # build:
    #   context: .
    #   dockerfile: Dockerfile.nginx
    env_file:
      - .env
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - type: bind
        source: /home/flextube/flextube_app/docker-volume/nginx/site/peertube.template
        target: /etc/nginx/conf.d/peertube.template
      - /home/flextube/flextube_app/docker-volume/nginx/ssl/:/etc/nginx/ssl/
      - assets:/var/www/peertube/peertube-latest/client/dist:ro
      - ./docker-volume/data:/var/www/peertube/storage
    depends_on:
      - peertube
    restart: "always"

  peertube:
    # If you don't want to use the official image and build one from sources:
    # build:
    #   context: .
    #   dockerfile: ./support/docker/production/Dockerfile.bullseye
    image: chocobozzz/peertube:production-bullseye
    # Use a static IP for this container because nginx does not handle proxy host change without reload
    # This container could be restarted on crash or until the postgresql database is ready for connection
    networks:
      default:
        ipv4_address: 172.18.0.42
    env_file:
      - .env

    ports:
     - "1935:1935" # If you don't want to use the live feature, you can comment this line
    #  - "9000:9000" # If you provide your own webserver and reverse-proxy, otherwise not suitable for production
    volumes:
      - assets:/app/client/dist
      - ./docker-volume/data:/data
      - ./docker-volume/config:/config
    depends_on:
      - postgres
      - redis
      - postfix
    restart: "always"

  postgres:
    image: postgres:13-alpine
    env_file:
      - .env
    volumes:
      - ./docker-volume/db:/var/lib/postgresql/data
    restart: "always"

  redis:
    image: redis:6-alpine
    volumes:
      - ./docker-volume/redis:/data
    restart: "always"

  postfix:
    image: mwader/postfix-relay
    env_file:
      - .env
    volumes:
      - ./docker-volume/opendkim/keys:/etc/opendkim/keys
    restart: "always"

networks:
  default:
    ipam:
      driver: default
      config:
      - subnet: 172.18.0.0/16

volumes:
  assets:

It didn´t make any changes to nginx conf file (peertube.template), except that I took out letsencrypt handling (we have our own ca, and generate our own certs)

P.S somehow the editor meesed up the formatting of the compose.yml.
But it works, the containers are starting …so no malformed yaml here.

Cheers,

JP

Do you have some errors in redis container?

Hi,

didn´t set the vm.overcommit_memory=1 first, but now it´s set.
But still not working:

The redis container says this in it´s logs:

flextube_app-redis-1  | 1:C 16 Sep 2022 08:40:25.895 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
flextube_app-redis-1  | 1:C 16 Sep 2022 08:40:25.895 # Redis version=6.2.7, bits=64, commit=00000000, modified=0, pid=1, just started
flextube_app-redis-1  | 1:C 16 Sep 2022 08:40:25.895 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.896 * monotonic clock: POSIX clock_gettime
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 # A key '__redis__compare_helper' was added to Lua globals which is not on the globals allow list nor listed on the deny list.
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 * Running mode=standalone, port=6379.
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 # Server initialized
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 * Loading RDB produced by version 6.2.7
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 * RDB age 27 seconds
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.897 * RDB memory usage when created 0.80 Mb
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.898 # Done loading RDB, keys loaded: 21, keys expired: 8.
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.898 * DB loaded from disk: 0.000 seconds
flextube_app-redis-1  | 1:M 16 Sep 2022 08:40:25.898 * Ready to accept connections

In the administration logs I see this. Maybe I set some variables wrongly ?

warn[16.9.2022, 10:40:29] It seems PeerTube was started (and created some data) with another domain name. This means you will not be able to federate! Please use NODE_CONFIG_DIR=/app/config:/app/support/docker/production/config:/config NODE_ENV=production npm run update-host to fix this.

UPDATE: I did what it says: NODE_CONFIG_DIR=/app/config:/app/support/docker/production/config:/config NODE_ENV=production npm run update-host

But to no avail :frowning:

UPDATE 2:

Another possible culprit ?

I installed a Chrome extension to handle CORS, and when I activate it it actually works …
Not the final thing, but a good step towards the goal …

How can I tune my instance to handle CORS by itself ?

Thanks!

PeerTube documentation should fix your issue

Hi,

thanks for this, but I didn´t find anything that gives me a hint on that CORS issue …
I´m using this plugin « Moesif CORS », and only if I´m activating it, peertube starts the playback …

Hi there, I noticed that I had https: false in my .env …
Nginx responded with 80, but peertube generated http links and my browser complained of mixed content, and the CORS was doing the rest …

Now it´s working … but I struggle with S3 now :smiley: … but I´ll open a new post when I have questions

Cheers and thanks,

JP