Postgresql migration error when upgrading from 4.2.2 to 4.3.0

Hi there :

I have this error with postgresql:
Cannot execute migration 0730

See the error here

  • psql (PostgreSQL) 13.8
  • node --version: v14.20.1

I tried to upgrade, either Auto or Manually. This ended up stopping the peertube service and I got a 502 error.

Is NodeJS 18 required?
Any idea to fix this?

Merci :slight_smile:

Hi,

What is the output of \d "videoChannel" using psql command?

peertube_prod=# \d videoChannel
Did not find any relation named "videoChannel".

This one on 4.2.2

It seems you did not put the " around videoChannel

Oups !
Sorry.
Results:
https://paste.sr.ht/blob/4ab15b1378f63ed2d0ffba72884cb7197786190a

For a unknown reason, the primary key is missing in your table. Try to add it: ALTER TABLE "videoChannel" ADD PRIMARY KEY (id);

Looks like it doesn’t work.

I have a duplicate entry, I think I should remove it first and then it should be better.

peertube_prod=# select * from "videoChannel" where id=4598;
  id  |              name               | description | support | actorId | accountId |         createdAt         |         updatedAt         
------+---------------------------------+-------------+---------+---------+-----------+---------------------------+---------------------------
 4598 | Video Games and English Project |             |         |   16846 |     12121 | 2022-01-17 19:57:24.56+00 | 2022-01-17 19:57:24.89+00
 4598 | Video Games and English Project |             |         |   16846 |     12121 | 2022-01-17 19:57:24.56+00 | 2022-01-17 19:57:24.89+00
(2 rows)

peertube_prod=# ALTER TABLE « videoChannel » ADD PRIMARY KEY (id);
ERROR: could not create unique index « videoChannel_pkey »
DETAIL: Key (id)=(4598) is duplicated.

I have a duplicate entry, I think I should remove it first and then it should be better.

yes you can delete one of them

Thanks Chocobozzz, everything works fine.
The upgrade works great. :slight_smile: