Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.86k stars 1.48k forks source link

Remote Runner doesn't transcode when one of registered server diseapears, after several days #6465

Closed GanGuoLang closed 1 month ago

GanGuoLang commented 1 month ago

Describe the current behavior

Hi! I have several Peertube server, but only one Remote Runner. I destroyed one Peertube Server, but doesn't unregistered it on the Remote Runner. Every things worked fine. One day, I created a new Peertube Server, and registered it. Transcode by Remote Runner worked. But, at a time, some videos (last) don't be transcoded. I checked the Remote Runner, and in the logs I saw an error about missing server. I unregistered the missing server, and transcoding for the new Peertube Server working again.

I'm not sure if it's easily reproducible, because the bug not immediately appeared. And, I often restarted servers.

Also, the New Peertube Server isn't public, but transcoding working fine. In the logs, this made error (302 to yunohost login page, that is normal) and fail, until I unregistered the missing server.

Steps to reproduce

  1. Registering Peerube servers
  2. Destroying a one of the Peertube Server
  3. Later, transcoding after restarted the Remote Runner server doewn't works
  4. Unregistered the missing Peertube Server made Remote Runner working again.

Describe the expected behavior

Ignore not reachable Peertube Server or with wrong answers.

Additional information

Extract from log about the unreachable Peertube server, on the Remote Runner.

[10:34:58.323] WARN (110): Cannot connect to https://vdo.unreachable.example.com/runners socket  [160/1656]
    err: {
      "type": "TransportError",
      "message": "websocket error",
      "stack":
          Error: websocket error
              at WS.onError (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:72713:33)
              at ws.onerror (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:73349:35)
              at callListener (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:30352:18)
              at _WebSocket.onError (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:30306:13)
              at _WebSocket.emit (node:events:517:28)
              at emitErrorAndClose (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:31260:17)
              at ClientRequest.<anonymous> (file:///usr/local/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:31161:9)
              at ClientRequest.emit (node:events:517:28)
              at TLSSocket.socketErrorListener (node:_http_client:501:9)
              at TLSSocket.emit (node:events:517:28)
      "description": {
        "type": "ErrorEvent",
        "message": "Client network socket disconnected before secure TLS connection was established",
"stack":
        "error": {
          "type": "Error",
          "message": "Client network socket disconnected before secure TLS connection was established",
"stack":
              Error: Client network socket disconnected before secure TLS connection was established
                  at connResetException (node:internal/errors:720:14)
                  at TLSSocket.onConnectEnd (node:_tls_wrap:1714:19)
                  at TLSSocket.emit (node:events:529:35)
                  at endReadableNT (node:internal/streams/readable:1400:12)
                  at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
          "code": "ECONNRESET",
          "path": null,
          "host": "vdo.unreachable.example.com",
          "port": 443
        },
        "target": {
          "_events": {},
          "_eventsCount": 4,
          "_binaryType": "nodebuffer",
          "_closeCode": 1006,
          "_closeFrameReceived": false,
          "_closeFrameSent": false,
          "_closeMessage": {
            "type": "Buffer",
            "data": []
          },
          "_closeTimer": null,
          "_extensions": {},
          "_paused": false,
          "_protocol": "",
          "_readyState": 2,
          "_receiver": null,
          "_sender": null,
          "_socket": null,
          "_bufferedAmount": 0,
          "_isServer": false,
          "_redirects": 0,
          "_url": "wss://vdo.unreachable.example.com:443/socket.io/?EIO=4&transport=websocket",                                                                                       
          "_req": null
        }
      }
    }
Chocobozzz commented 1 month ago

Hi,

Is the remote runner able to connect to your instances using websocket?

GanGuoLang commented 1 month ago

How to test this, by command line? From the Remote Runner, and from the server? Do I need open a port on the server?

And, to be precise, after unregistered the missing server, all went fine. i means, transcoding movie (but I still have problems for lives, that is another problem may be)

Chocobozzz commented 1 month ago

Try to restart the runner and see if there are errors in the logs

GanGuoLang commented 1 month ago

I can't test for the moment, and if no one can test too, I suggest to close this ticket. If later after more tests I found this issue again, I will re-open it.