Migration 29 (Postgresql 13 -> 15) failed after upgrade to Yunohost 12

If the German localisation of the logfiles is a problem, I will be glad to change the language setting of the logging system, but I need a hint how to do it.

Can you temporarily move huge files elsewhere to free up space on the system disk? Check using ncdu /home after installing ncdu (sudo apt install ncdu). Or mount /home/yunohost.multimedia on the new disk.

Let’s retry only postgresql cluster upgrade

systemctl stop postgresql.service
systemctl stop postgresql@13-main.service
systemctl stop postgresql@15-main
export PGHOST=/mnt/plusdisk
LC_ALL=C pg_upgradecluster -m upgrade 13 main -v 15

ncdu shows the largest directory is

/home/yunohost.backup

which is mounted to

/mnt/storagespace/home/yunohost.backup

both have 72.5GB. /mnt/storagespace is the first additional disk over nfs, /mnt/plusdisc the second.

So /home has 80.2GB, /mnt 72.5GB.

Is it possible that the backup is double counted? I do not really understand what df -h shows and ncdu.

I might delete the 72GB backup since I have downloaded it which took 6 hrs. Opening the local file with an archive manager resulted in an error though, so I am not sure if it is consistent.

yunohost/multimedia is only 1GB.

Use ncdu /home -x to scan only local system.
sudo ncdu / -x to scan the whole disk

Thank you.
I could move the 72GB backup file to /mnt/plusdisk and see what is free, couldn’t I?

No problem

postgresql failed again. There is not yet enough space:
df -h shows

Filesystem                                        Size  Used Avail Use% Mounted on
udev                                              3.9G     0  3.9G   0% /dev
tmpfs                                             795M  660K  794M   1% /run
/dev/sda3                                         153G  119G   26G  83% /
tmpfs                                             3.9G     0  3.9G   0% /dev/shm
tmpfs                                             5.0M     0  5.0M   0% /run/lock
/dev/sda2                                         974M   84M  823M  10% /boot
ipaddress:/voln353211a1                       250G  889M  250G   1% /mnt/storagespace
ipaddress:/voln353211a1/home/yunohost.backup  250G  889M  250G   1% /home/yunohost.backup
tmpfs                                             795M     0  795M   0% /run/user/1007
ipaddress:/voln353211a2                       250G   72G  179G  29% /mnt/plusdisk

During the migration, /dev/sda3 grows from 83% to 100% until it is aborted.

With ncdu I cannot find those 119G

With ncdu -x / (sorry, I overlooked the -x), I found this:

  • /var/lib/postgresql/13/main has 50.7GB
  • /home/yunohost.app/nextcloud has 30.0GB
  • there is no way to reduce that
  • there is 28GB free disk space on system disk
  • moving 79GB archive file to /mnt/plusdisk did not free any space on the system disk because it came from the first external disk /mnt/storagespace. I will move it back
  • I have 250GB free disk space on /mnt/plusdisk

The next important question is: How can I tell postgresql to write on /mnt/plusdisk ???

@jarod500, you told me to set PGHOST to /mnt/plusdisk, but during the postgresql migration nothing has been written to this path.
Why? Is it the wrong variable?

What other options are there to do the migration?

  • move the whole postgresql database temporarily to the external disk /mnt/plusdisk ?
  • How to do this ?

I hope someone could help me with this postgresql problem.
I appreciate any help.

I don’t know anything about PostgreSQL and its configuration. Since I am running out of options, this idea came to my mind:

  1. move the folder /var/lib/postgresql → /mnt/plusdisk/postgresql (with 250gb capacity)
  2. create a symlink from /var/lib/postgresql to the moved location
  3. start the migration 29 (PostgreSQL 13 → 15)
  4. after it finishes without problems, move PostgreSQL 15 folder back

@jarod5001 , @Aleks : is this a feasable procedure?

imho the problem is you are not user postgres. a similar problem and solution you find here: YunoHost 11.0 (Bullseye) release / Sortie de YunoHost 11.0 (Bullseye) - #217 by emo

Thank you very much.
I might chown a folder to user postgresql?
Matthias

hi matalb, wrong direction :slight_smile: the postgres related files are owned by user postgres. so if you want to do something with it, you have to do it with

sudo -u postgres 

Thank you! I will try it.

sudo -u postgres failed, but was not necessary, either.

I managed to do the PostgreSQL migration successfuly by running this:

mv /var/lib/postgresql /mnt/plusdisk/
ln -s /mnt/plusdisk/postgresql /varLib/postgresql
yunohost tools migrations run

The mv and migrations took som time, of course. After that, the PostgreSQL service is running!

To restore PostgreSQL on th system disk, I stopped the service and moved all back:

rm /var/lib/postgresql
mv /mnt/plusdisk/postgresql /var/lib

and started postgresql service again. It works!!!

1 Like

The issue is solved. Thanks to all who helped!

congrats, that’s fine.
just to be sure, check the owner of the db, perhaps it changed to root or user.

Can you give me a hint how to do that? Thanks.

go in directory you copied back you’re db and

ls -l

give you all information you need

Here it is at /var/lib/postgresql:

total 4
drwxr-xr-x 3 postgres postgres 4096 Mar 14 13:20 15

looks fine

1 Like