Transcoding does not start (new install)

Hello. I’ve installed PeerTube today, following the installation steps carefully. The problem I have is that transcoding never seems to start (or finish).

For example, here is a test video Final frontier - Bogus Agency PeerTube on which you can see the message « The video is being transcoded ». But no progress is made. There are no transcoding processes ever run on the server.

In the admin jobs view I see « transcoding job builder » output like this:

Job: da72f7b3-af91-4db3-98ba-6115ce026f2f
Type: transcoding-job-builder
Processed on -
Finished on -

{
  "videoUUID": "eb05cfce-0ca6-4fa2-913a-61e7b1503980",
  "optimizeJob": {
    "isNewVideo": true
  }
}

But this does not seem to create any actual transcoding jobs, and watching the process table on the server shows no activity from ffmpeg or anything else.

My instance is PeerTube v6.3.3 running in an LXD container on Ubuntu 24.04. I started with a completely fresh Ubuntu container. I followed the installation steps very literally. The only difference is that I am using a separate nginx reverse proxy, and so have removed the « optimizations » from the nginx config that rely on local access to files and placed the config on the proxy.

The peertube log file at /var/www/peertube/storage/logs/peertube.log does not mention transcoding at all, or contain any errors.

So I am stuck because I have no information about why transcoding is not happening. No errors, no logs, no feedback.

Any advice would be welcome.

Everything else has gone very smoothly.

Thanks!

Hi,

Can you paste PeerTube server logs? Logs | PeerTube documentation

Complete logs since installation

You have many errors in your logs. In particular:

Unable to connect to PostgreSQL database. {
  "err": {
    "stack": "SequelizeConnectionError: password authentication failed for user \"peertube\"\n    at Client._connectionCallback (/var/www/peertube/versions/peertube-v6.3.3/node_modules/sequelize/lib/dialects/pos
tgres/connection-manager.js:145:24)\n    at Client._handleErrorWhileConnecting (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg/lib/client.js:327:19)\n    at Client._handleErrorMessage (/var/www/peert
ube/versions/peertube-v6.3.3/node_modules/pg/lib/client.js:347:19)\n    at Connection.emit (node:events:507:28)\n    at /var/www/peertube/versions/peertube-v6.3.3/node_modules/pg/lib/connection.js:117:12\n    at
 Parser.parse (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/parser.js:36:17)\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/index
.js:11:42)\n    at Socket.emit (node:events:507:28)\n    at addChunk (node:internal/streams/readable:559:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n    at Readable.push (nod
e:internal/streams/readable:390:5)\n    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)",
    "name": "SequelizeConnectionError",
    "parent": {
      "stack": "error: password authentication failed for user \"peertube\"\n    at Parser.parseErrorMessage (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/parser.js:283:98)\n    at Pa
rser.handlePacket (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/parser.js:122:29)\n    at Parser.parse (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/parser
.js:35:38)\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v6.3.3/node_modules/pg-protocol/dist/index.js:11:42)\n    at Socket.emit (node:events:507:28)\n    at addChunk (node:internal/streams/re
adable:559:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n    at Readable.push (node:internal/streams/readable:390:5)\n    at TCP.onStreamRead (node:internal/stream_base_commons
:189:23)",
      "length": 104,
      "name": "error",
      "severity": "FATAL",
      "code": "28P01",
      "file": "auth.c",
      "line": "323",
      "routine": "auth_failed"
    }
  }
}

What does that error indicate? [Never mind – it’s fixed and not relevant, I think.]

I followed the installation guide step by step, pasting almost exactly. I kept a detailed record that you can see here

Perhaps I made a mistake somewhere, but perhaps there is something that can be improved in the instructions. It would be good to know!

Note:

root@peertube:/var/www/peertube# sudo -u peertube psql -U peertube -W peertube_prod
Password: [copied and pasted from production.yaml]
psql (16.4 (Ubuntu 16.4-0ubuntu0.24.04.2))
Type "help" for help.

peertube_prod=> 

You have many errors in your logs. In particular:

That error was from two days ago and was fixed. In my notes I wrote:

After a bit it started complaining::

Nov 10 04:47:41 peertube peertube[5412]: [tube.bogus.agency:443] 2024-11-10 04:47:41.271 error: Unable to connect to PostgreSQL database.

Postgres is running. Aha! I failed to copy the Postgres password
into production.yaml::

database:
password: [password redacted]

Now when I started it again the log says::

Nov 10 04:54:12 peertube peertube[5633]: [tube.bogus.agency:443] 2024-11-10 04:54:12.529 info: Database peertube_prod is ready.

You can see my fix was a few minutes after that error.

So I do not think it explains the transcoding problem.

Can you enable debug logs, reupload a video and paste the logs output?

Uploaded this cat. Enjoy!

I have updated the logs

The restart is at about timestamp 2024-11-12T10:50:28 .

Local jobs shows:

Job: fb18cc8f-2335-4b54-826d-2f4bfa35b618
Type: transcoding-job-builder
Processed on -
Finished on -

{
  "videoUUID": "8de366b5-f27a-4c57-a883-69cfb4ccd7ee",
  "optimizeJob": {
    "isNewVideo": true
  }
}

There is some successful output from ffmpeg, from the web-videos directory to previews.

By the way, thank you very much for helping. I’m hoping we can come up with some improvements. :slight_smile:

So there are many uncaught exceptions with buffer overflows mentioning jobs:

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: \"length\" is outside of buffer bounds
    at Buffer.utf8Write (node:internal/buffer:1066:13)
    at Packr.encodeUtf8 (/var/www/peertube/versions/peertube-v6.3.3/node_modules/msgpackr/dist/node.cjs:1211:18)
    at pack (/var/www/peertube/versions/peertube-v6.3.3/node_modules/msgpackr/dist/node.cjs:1504:15)
    at packArray (/var/www/peertube/versions/peertube-v6.3.3/node_modules/msgpackr/dist/node.cjs:1418:5)
    at pack (/var/www/peertube/versions/peertube-v6.3.3/node_modules/msgpackr/dist/node.cjs:1604:7)
    at Packr.pack.encode (/var/www/peertube/versions/peertube-v6.3.3/node_modules/msgpackr/dist/node.cjs:1309:6)
    at Scripts.addStandardJob (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/scripts.js:99:19)
    at Scripts.addJob (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/scripts.js:143:33)
    at Job.addJob (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/job.js:782:29)
    at FlowProducer.addNode (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/flow-producer.js:183:17)
    at /var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/flow-producer.js:243:39
    at Array.map (<anonymous>)
    at FlowProducer.addChildren (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/flow-producer.js:243:22)
    at FlowProducer.addNode (/var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/flow-producer.js:168:35)
    at /var/www/peertube/versions/peertube-v6.3.3/node_modules/bullmq/dist/cjs/classes/flow-producer.js:243:39
    at Array.map (<anonymous>)

Suspicious!

I’m just trying to think what I might have done to create some long data that could cause a problem. The only things I can think of are:

  1. My passwords are all 36-character uuids from uuidgen
  2. It’s an IPv6 installation so there are long IP address strings everywhere.
  3. It’s behind a reverse proxy so there will be extra proxy headers in messages.

But that’s all I can think of.

What are your nodejs and redis versions?

root@peertube:/var/www/peertube# node -v
v23.1.0
root@peertube:/var/www/peertube# redis-server --version
Redis server v=7.0.15 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=d81b8ff71cfb150e
root@peertube:/var/www/peertube# ffmpeg -version
ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
libavutil      58. 29.100 / 58. 29.100
libavcodec     60. 31.102 / 60. 31.102
libavformat    60. 16.100 / 60. 16.100
libavdevice    60.  3.100 / 60.  3.100
libavfilter     9. 12.100 /  9. 12.100
libswscale      7.  5.100 /  7.  5.100
libswresample   4. 12.100 /  4. 12.100
libpostproc    57.  3.100 / 57.  3.100
root@peertube:/var/www/peertube# npm --version
10.9.0
root@peertube:/var/www/peertube# yarn --version
1.22.22
root@peertube:/var/www/peertube# uname -a
Linux peertube 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@peertube:/var/www/peertube# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble

APT is suggesting an update to node.js 23.2.0 (changelog) but no other upgrades. I’ll try that if you think it will help.

Possibly related ERR_BUFFER_OUT_OF_BOUNDS error with Google Vision package on Node 22.7.0 · Issue #54518 · nodejs/node · GitHub

I tried upgrading node to 23.2.0 but it did not seem to fix the problem.

I also tried downgrading node to 22.8 but it did not seem to fix the problem.

Perhaps I need to do more than just restart the server after a node version change? Is there another step to take?

Thanks.

Try node 20