mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
[Bug]: DB upgrade error #772
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Terrofont on GitHub (Aug 4, 2025).
Where is the problem occurring?
I encountered the problem while interacting with the server (Backend)
What browsers are you seeing the problem on?
Other
Current behavior
Hello! I updated to 1.26.2 as it was recommended in the guide, ran it once and then tried upgrading the database. It returned me error
I assumed that the reason might be in the postgres version, so I migrated postgres 14->16, as this version was recommended in some discussion on gh. Still no luck. I also tried upgrading through rc2 version and got the same error. I am using Docker installation
Desired behavior
Automatically upgrade database without problems
Steps to reproduce
To planka 1.16.3 migrated multiple boards from Trello with manually expanded actions' jsons (parsing 1000 actions at once) with trello2planka script. Later updated to 1.24.4. Finally, I updated to 1.26.2 as it was recommended in the guide, ran it once and then tried upgrading the database on the rc3 image
Other information
No response
@meltyshev commented on GitHub (Aug 4, 2025):
Hi! Thanks for reporting this. I believe the issue is that Postgres is hitting the parameter limit in
whereInqueries. I'll look into finding a way to fix it.@meltyshev commented on GitHub (Aug 4, 2025):
Quick question: are you using the Docker version or a manual installation? I've fixed the upgrade script, and it would be great if you could test upgrading with it - If everything works well, I'll go ahead and push it.
@Terrofont commented on GitHub (Aug 4, 2025):
Docker
@Terrofont commented on GitHub (Aug 4, 2025):
Sure, I can test it
@meltyshev commented on GitHub (Aug 4, 2025):
docker-compose.ymlfile is located, create a new file namedupgrade.jswith the following content:docker-compose.ymlfile and attach the newupgrade.jsas a volume:Follow the upgrade documentation.
After completing the upgrade, delete the
upgrade.jsfile and remove the- ./upgrade.js:/app/db/upgrade.jsvolume entry fromdocker-compose.yml.Thanks for testing! If the upgrade will be fine, I'll push the fix :)
@Terrofont commented on GitHub (Aug 4, 2025):
Database upgraded, but now I don't see any attachments on the cards..
@Terrofont commented on GitHub (Aug 4, 2025):
And I don't see them in the attachments folder either
@meltyshev commented on GitHub (Aug 4, 2025):
Hmm, we need to make sure that all the correct volumes are attached. For example, if the container name is different, Docker might create new empty volumes. You can check all existing volumes with
docker volume ls.UPD: if you're using Docker Desktop, you can also inspect the contents of the volumes to see whether the expected files are there.
@Terrofont commented on GitHub (Aug 4, 2025):
I can verify that the script deleted all the attachments
UPD: ~40GB space freed on the disk
@meltyshev commented on GitHub (Aug 4, 2025):
Please try restoring everything from the backup and run the upgrade script again.
The upgrade script only deletes attachments that are no longer in use. In version 1, there was an issue where, for example, deleting a board would leave its attachments on disk. The script is meant to clean up those unused files.
It's hard to say why everything would get deleted - this should only happen if the database migration didn't run before the file migration. However, no one else has reported this issue, and we tested the migration thoroughly before releasing it. Strange...
@meltyshev commented on GitHub (Aug 4, 2025):
Basically, you can try restoring just the backed-up attachments to the volume and then run the upgrade script - it should simply upgrade the files.
If you need help restoring the backup to the volume, feel free to let me know and I'll guide you through it.
@meltyshev commented on GitHub (Aug 4, 2025):
To restore from the
attachments.tar.gzfile (whereplanka_attachmentsis the name of your volume), run:@Terrofont commented on GitHub (Aug 4, 2025):
Ran the script once again after restoring the backup, seem to have worked fine this time, but most of the card thumbnails aren't displayed with 404 error and their preview in attachments isn't visible either. Out of which i saw, only one displayed properly. When I try to open the file it opens without any issue and is downloadable
Also, the upgrade script hangs on me after seeming to finish and Docker says it's unhealthy
Another thing is that in the notifications remaining from before the update all the authors named Deleted User, while in the card itself they appeared fine
@meltyshev commented on GitHub (Aug 4, 2025):
Please try opening a board in Incognito mode (or clear your browser cache completely) to check if all images load properly - it's likely a browser caching issue.
As for the upgrade script, it seems you have a large amount of data, and this might be the first upgrade with such volume. It's helpful to know if something isn't working as expected so we can optimize it. The heaviest part of the script is resizing all image files to the new dimensions. If there are many images, this step can take a while.
It's also possible that not all files were upgraded, so you might want to try running the script again - it will only process files that haven't been upgraded yet. Additionally, for debugging, you can insert a log at line 761:
to see which files are being processed, and another at line 920:
to confirm that the process finishes. I'll also add more logging to the script to make it easier to track progress.
Thanks for reporting the notification issue - I'll take a look at that too.
@meltyshev commented on GitHub (Aug 4, 2025):
I've added status output to the upgrade script, so you'll now clearly see when it finishes. I also fixed the reported issue with notifications -
creator_user_idis now set correctly.If you'd like, you can download the updated version from here:
https://raw.githubusercontent.com/plankanban/planka/refs/heads/master/server/db/upgrade.js. Then use it again via the mounted volume as before.
@Terrofont commented on GitHub (Aug 5, 2025):
Added logging to thumbnails re-render to verify that script runs, let it finish and thumbnails restored