Updating to 3.1 error Cannot execute migration 0595

here is error log, i am using cloudron…

[bestgore.fun:443] 2021-03-30 04:35:58.503 error: Cannot execute migration 0595. {

Mar 30 12:35:58 « err »: {

Mar 30 12:35:58 « stack »: « SequelizeDatabaseError: column videoFile.fileUrl does not exist\n at Query.formatError (/app/code/server/node_modules/sequelize/lib/dialects/postgres/query.js:386:16)\n at Query.run (/app/code/server/node_modules/sequelize/lib/dialects/postgres/query.js:87:18)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async /app/code/server/node_modules/sequelize/lib/sequelize.js:619:16 »,

Mar 30 12:35:58 « message »: « column videoFile.fileUrl does not exist »,

Mar 30 12:35:58 « name »: « SequelizeDatabaseError »,

Mar 30 12:35:58 « parent »: {

Mar 30 12:35:58 « stack »: « error: column videoFile.fileUrl does not exist\n at Parser.parseErrorMessage (/app/code/server/node_modules/pg-protocol/dist/parser.js:278:15)\n at Parser.handlePacket (/app/code/server/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/app/code/server/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/app/code/server/node_modules/pg-protocol/dist/index.js:10:42)\n at Socket.emit (events.js:315:20)\n at addChunk (internal/streams/readable.js:309:12)\n at readableAddChunk (internal/streams/readable.js:284:9)\n at Socket.Readable.push (internal/streams/readable.js:223:10)\n at TCP.onStreamRead (internal/stream_base_commons.js:188:23) »,

Mar 30 12:35:58 « message »: « column videoFile.fileUrl does not exist »,

Mar 30 12:35:58 « length »: 116,

Mar 30 12:35:58 « name »: « error »,

Mar 30 12:35:58 « severity »: « ERROR »,

Mar 30 12:35:58 « code »: « 42703 »,

Mar 30 12:35:58 « position »: « 592 »,

Mar 30 12:35:58 « file »: « parse_relation.c »,

Mar 30 12:35:58 « line »: « 3349 »,

Mar 30 12:35:58 « routine »: « errorMissingColumn »,

Mar 30 12:35:58 « sql »: « UPDATE « videoFile » SET « torrentUrl » = t.« serverUrl » || ‹ /static/torrents/ › || « videoFile ».« torrentFilename », « fileUrl » = t.« serverUrl » || t.« filePath » || « videoFile ».« filename » FROM (SELECT ‹ https:// › || server.host AS « serverUrl », ‹ /static/webseed/ › AS « filePath », « videoFile ».id FROM video INNER JOIN « videoChannel » ON « videoChannel ».id = video.« channelId » INNER JOIN actor ON actor.id = « videoChannel ».« actorId » INNER JOIN server ON server.id = actor.« serverId » INNER JOIN « videoFile » ON « videoFile ».« videoId » = video.id WHERE video.remote IS TRUE) AS t WHERE t.id = « videoFile ».« id » AND « videoFile ».« fileUrl » IS NULL »

Mar 30 12:35:58 },

Mar 30 12:35:58 « sql »: « UPDATE « videoFile » SET « torrentUrl » = t.« serverUrl » || ‹ /static/torrents/ › || « videoFile ».« torrentFilename », « fileUrl » = t.« serverUrl » || t.« filePath » || « videoFile ».« filename » FROM (SELECT ‹ https:// › || server.host AS « serverUrl », ‹ /static/webseed/ › AS « filePath », « videoFile ».id FROM video INNER JOIN « videoChannel » ON « videoChannel ».id = video.« channelId » INNER JOIN actor ON actor.id = « videoChannel ».« actorId » INNER JOIN server ON server.id = actor.« serverId » INNER JOIN « videoFile » ON « videoFile ».« videoId » = video.id WHERE video.remote IS TRUE) AS t WHERE t.id = « videoFile ».« id » AND « videoFile ».« fileUrl » IS NULL »

Mar 30 12:35:58 }

Mar 30 12:35:58 }

Mar 30 12:35:58 npm ERR! code ELIFECYCLE

Mar 30 12:35:58 npm ERR! errno 255

Mar 30 12:35:58 npm ERR! peertube@3.1.0 start: node dist/server

Mar 30 12:35:58 npm ERR! Exit status 255

Mar 30 12:35:58 npm ERR!

Mar 30 12:35:58 npm ERR! Failed at the peertube@3.1.0 start script.

Mar 30 12:35:58 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Mar 30 12:35:58

Hello,

Did you see a successful migration of 0585? This script should have created the fileUrl column.

Also, what is your postgresql version?

i am already restore my back up, and try to update again.

hi @novelx,

Since you are using a community package maintained by Cloudron, please contact them first and come back if they couldn’t solve your problem themselves first. Their forum dedicated to supporting their PeerTube package is here: https://forum.cloudron.io/category/91/peertube

okay, thank you all, already solved…

Do you know what was the issue?

1 « J'aime »

i have 4 peertube instance, 2 using cloudron,
usually if i have problem during upgrade. i can re run upgrade.sh scripts to fix it,
the problem that I experienced earlier using cloudron, is iam canceling update task during automated update by cloudron. to skip backup by cloudron on update. i can’t rerun update task after that. cloudron indicate peertube already updated to 3.1

so i have restore my backup and re run upgrade.

Here’s what seems to have solved the issue for me - upgrade postgresql. It sounds obvious, but, not always (because reasons).

In short, before upgrading PeerTube, first upgrade PostgreSQL, If you’re using Debian Buster/stable and you’re not doing other things with your PostgreSQL server, the following should work (otherwise, be careful) :

Make sure you have both, 9.6 and 11 running:

pg_lsclusters

This should show something like:

9.6 main 5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log
11  main 5433 online postgres /var/lib/postgresql/11/main  /var/log/postgresql/postgresql-11-main.log

The following will stop PeerTube, drop the new pool « 11 main » (which is the default and is empty, if not, do not do the following), upgrade the 9.6 pool to 11, and switch the ports so the newly upgraded pool uses port 5432, and restart PeerTube, and voilà.

systemctl peertube stop
pg_dropcluster 11 main --stop
pg_upgradecluster 9.6 main
systemctl peertube start

After you can remove the old 9.6 pool

pg_dropcluster 9.6 main

And then, continue with the PeerTube upgrade. It should « just work ».

1 « J'aime »