-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Albums: Pictures are suddenly all the same #3320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Signed-off-by: Michael Mayer <michael@photoprism.app>
My best guess is that this is either a database migration issue after upgrading to a newer version, or a problem with updating the |
Hi, I was one of the users experiencing this. I am not sure what exactly caused this to happen, but the only change I made was an upgrade from MariaDB from 10.10 to 10.11. |
Signed-off-by: Michael Mayer <michael@photoprism.app>
Thanks for your feedback! Since we haven't tested with 10.11 yet, there is a small risk. See our documentation:
For example, it is possible that the error codes have changed so that our library no longer recognizes |
Signed-off-by: Michael Mayer <michael@photoprism.app>
An updated development preview and public demo will be available for testing soon. Of course, if you're not sure how to reproduce this, it can be difficult to test if the changes are helpful or not... |
@barry-luijten Are you using our MariaDB config example at https://dl.photoprism.app/docker/docker-compose.yml or does your server not only have a different version but also different settings, for example for query compatibility? |
@lastzero : Yes, I'm using the exact same command and environment variables in my database container.
I can try to turn experimental features "on" again and perform the search. I think it's only useful to test the preview version if I can reproduce the problem ;) Thanks for your quick response and help so far! |
Search should never change the contents of the database. I'm also not aware of any experimental features that could cause this. |
Update: I searched my "Folder" albums and found one named "January 2019", which was in fact referencing a folder named 2016/10, which was the exact string that was found in the |
So maybe this could have happened when you renamed folder albums in the UI? Did you also rename any folders on the disk? |
I have the same issue, I didn’t rename anything. Could it be caused by this SQL migration? what was the previous length? if it was longer then maybe it broke the path? |
If it was, it should have only affected Folder albums that have a path assigned to them, not all albums? |
Do you happen to know what exact versions you had installed before? A full rescan changes nothing? |
it’s hard to say when it’s happened, around the beginning of this year :), I’m using truecharts, currently I have "PhotoPrism® Plus Build 221118-e58fee0fb", and I update every time there is a new version let me know if I can help you with investigating this issue |
full rescan does not help (it takes ~2 days for me, I have > 200k photos) |
Any change in the filesystem should do as this should trigger a refresh of the albums table. You don't need to refresh all your files. |
Based on your reports, it looks like the batch update happened here when the function was called on a folder album instance without a primary key (which unfortunately omits the where part in the SQL statement with the ORM library we use): photoprism/internal/entity/album.go Lines 633 to 636 in a74a02c
Edit: The changes I made earlier this week should prevent this, since the primary key is checked before values are updated. |
My guess is that the SQL select in the find function returned an error other than "not found", e.g. because the database server was unavailable for a short time or because the ORM library didn't properly detect it. The update statement was then executed without a where condition, resulting in a batch update of the Clearing the |
that’s worked, thank you! |
@5783354 Exactly, that's the update query as I would have written it: UPDATE albums SET album_path = '', album_filter = '' WHERE album_type = 'album'; The slug is not really important for the albums to work. I think it should be updated automatically when you change the name of an album. |
…3320 Signed-off-by: Michael Mayer <michael@photoprism.app>
Signed-off-by: Michael Mayer <michael@photoprism.app>
…3320 Signed-off-by: Michael Mayer <michael@photoprism.app>
omg thanks a lot, that worked, i can finally get back to finishing scanning my parents 40 year old photos! |
@IPMAN890 : If you want to recover your album names too, and you have enabled the backup yml files option (enabled by default), you can use this shell script to generate the SQL statements required to restore them: #!/bin/bash
album_files=$(find . -type f -name '*.yml')
for album_file in $album_files; do
album_uid=$(basename $album_file .yml)
title=$(awk 'BEGIN {FS=": "} $1 == "Title" {print $2}' $album_file)
echo "UPDATE albums SET album_title = '"$title"', album_filter = '' WHERE album_uid = '"$album_uid"';"
done Just place this script in in your storage/albums/album directory, make it executable and run it from there. |
A small number of users report that all their albums "suddenly" have the same pictures:
We have created this issue to find the root cause and implement code changes if needed. Since most users, including our team, have never had a problem like this, we suspect it is something very specific that cannot be found easily.
In order to reproduce the reported behavior, we therefore need to ask for your help:
If you are using Docker Compose with our default configuration, the following will create an SQL dump of your album-related database tables (without anything else) so we can use them for debugging your problem:
Please note:
MARIADB_PASSWORD
, see yourdocker-compose.yml
Dumps and sample files can be emailed directly to us so you don't have to post them publicly:
👉 https://www.photoprism.app/contact
Any help in providing a solution is greatly appreciated, as it allows our team to work on other issues that our community is waiting for. Thank you very much!
The text was updated successfully, but these errors were encountered: