Moments: Error while removing duplicate moments #1292

Closed
opened 2026-02-20 00:09:49 -05:00 by deekerman · 4 comments
Owner

Originally created by @jakubtopic on GitHub (Jan 13, 2022).

I noticed that I get the following error many times after importing photos:

moments: Error 1093: You can't specify target table 'albums' for update in FROM clause (remove duplicates)

I'm not sure what impact this has on the functionality of the app, it seems to me that Moments work just fine. Anyway, I think I have identified the faulty query:
github.com/photoprism/photoprism@0f0c0aaa0b/internal/query/moments.go (L276)
A similar query was addressed in this issue: #599, and it was also related to MySQL database, as in my case.

Photoprism version: 220107-f5b7ef83-Linux-x86_64
Database server: MySQL 8.0.27

Originally created by @jakubtopic on GitHub (Jan 13, 2022). I noticed that I get the following error many times after importing photos: ``` moments: Error 1093: You can't specify target table 'albums' for update in FROM clause (remove duplicates) ``` I'm not sure what impact this has on the functionality of the app, it seems to me that Moments work just fine. Anyway, I think I have identified the faulty query: https://github.com/photoprism/photoprism/blob/0f0c0aaa0b2dcf89df6400c49915efc4bdef1f80/internal/query/moments.go#L276 A similar query was addressed in this issue: #599, and it was also related to MySQL database, as in my case. Photoprism version: 220107-f5b7ef83-Linux-x86_64 Database server: MySQL 8.0.27
deekerman 2026-02-20 00:09:49 -05:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@lastzero commented on GitHub (Jan 13, 2022):

Does it work with MariaDB 10.5.12+?

@lastzero commented on GitHub (Jan 13, 2022): Does it work with MariaDB 10.5.12+?
Author
Owner
@lastzero commented on GitHub (Jan 13, 2022): https://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause 👀
Author
Owner

@lastzero commented on GitHub (Jan 13, 2022):

https://mariadb.com/kb/en/delete/#deleting-from-the-same-source-and-target 🧐

@lastzero commented on GitHub (Jan 13, 2022): https://mariadb.com/kb/en/delete/#deleting-from-the-same-source-and-target 🧐
Author
Owner

@lastzero commented on GitHub (Jan 14, 2022):

  • Since we have not heard back from you, I will move ahead and close the issue.
  • We had friends over yesterday and not much time for a detailed response:
    • The links above point to related issues and the MariaDB documentation.
    • This explains that your problems are caused by a missing feature in old MySQL and MariaDB versions, which are not supported according to the system requirements: https://docs.photoprism.app/getting-started/#databases
  • MySQL issues are now also more explicitly referenced in our Troubleshooting Guide: https://docs.photoprism.app/getting-started/troubleshooting/#mysql-errors
  • Next time, please do not open a report for an error in PhotoPrism if it might "just" be a technical support question and you did not first go through our troubleshooting guide (which would have led you to the answer).
  • Sponsors receive direct technical support via email.
  • Thank you and have a great weekend :)
@lastzero commented on GitHub (Jan 14, 2022): - Since we have not heard back from you, I will move ahead and close the issue. - We had friends over yesterday and not much time for a detailed response: - The links above point to related issues and the MariaDB documentation. - This explains that your problems are caused by a missing feature in old MySQL and MariaDB versions, which are not supported according to the system requirements: https://docs.photoprism.app/getting-started/#databases - MySQL issues are now also more explicitly referenced in our Troubleshooting Guide: https://docs.photoprism.app/getting-started/troubleshooting/#mysql-errors - Next time, please do not open a report for an error in PhotoPrism if it might "just" be a technical support question and you did not first go through our troubleshooting guide (which would have led you to the answer). - Sponsors receive direct technical support via email. - Thank you and have a great weekend :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#1292
No description provided.