Skip to content
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

MariaDB: Make sure that a supported version is used #2381

Closed
ZoXx opened this issue May 30, 2022 · 19 comments
Closed

MariaDB: Make sure that a supported version is used #2381

ZoXx opened this issue May 30, 2022 · 19 comments
Assignees
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release technical-support Support request

Comments

@ZoXx
Copy link

ZoXx commented May 30, 2022

Hello,

since the last update (docker image) we've got problems while uploading pictures to folders (albums).

Here is our log:
2022-05-30 12:45:18 ERRO file: Error 1292: Incorrect datetime value: '0000-00-00' for column 'photo_taken_at' at row 1 while saving

@graciousgrey graciousgrey added the incomplete Cannot be processed due to missing information label May 30, 2022
@graciousgrey
Copy link
Member

Please follow our issue template for reporting potential bugs :)

@ZoXx
Copy link
Author

ZoXx commented May 30, 2022

Will do next time.
But your template is a lot to do and this bug exist since last image. I dont know how you can reproduce it but i cant be the only one with this behaviour. The other "bugs" doesnt fill in template too.

@graciousgrey
Copy link
Member

But your template is a lot to do

This also applies to the development of this software and answering questions.

Uploading photos to albums works without problems on our public demo and private instances.
So it could be a problem with your setup or files.

@graciousgrey
Copy link
Member

Might also be caused by a failed migration - could you run the following command

docker-compose exec photoprism photoprism migrations ls

to see if there have been errors

@ZoXx
Copy link
Author

ZoXx commented May 30, 2022

Here we go:
`
time="2022-05-30T13:27:57Z" level=info msg="PhotoPrism® needs your support!"
time="2022-05-30T13:27:57Z" level=info msg="Visit https://photoprism.app/membership to learn more."
|-----------------|---------|---------------------|---------------------|--------------------------------|
| ID | Dialect | Started At | Finished At | Status |
|-----------------|---------|---------------------|---------------------|--------------------------------|
| 20211121-094727 | mysql | 2022-02-26 22:16:19 | 2022-02-26 22:16:19 | OK |
| 20211124-120008 | mysql | 2022-02-26 22:16:19 | 2022-02-26 22:16:19 | OK |
| 20220329-030000 | mysql | 2022-05-17 03:02:35 | 2022-05-17 03:02:35 | OK |
| 20220329-040000 | mysql | 2022-05-17 03:02:35 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | idx_albums_album_filter ON |
| | | | | albums' at line 1 |
| 20220329-050000 | mysql | 2022-05-17 03:02:35 | 2022-05-17 03:02:37 | OK |
| 20220329-060000 | mysql | 2022-05-17 03:02:37 | 2022-05-17 03:02:40 | OK |
| 20220329-061000 | mysql | 2022-05-17 03:02:40 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to use |
| | | | | near 'INDEX idx_files_photo_id |
| | | | | ON files (photo_id, |
| | | | | file_primary)' at line 1 |
| 20220329-070000 | mysql | 2022-05-17 03:02:40 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to use |
| | | | | near 'IF EXISTS photo_taken_at |
| | | | | DATETIME AFTER photo_uid' at |
| | | | | line 1 |
| 20220329-071000 | mysql | 2022-05-17 03:02:40 | 2022-05-17 03:02:41 | OK |
| 20220329-080000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | media_id VARBINARY(32) AFTER |
| | | | | photo_taken_at' at line 1 |
| 20220329-081000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to |
| | | | | use near 'UNIQUE INDEX |
| | | | | idx_files_search_media ON |
| | | | | files (media_id)' at line 1 |
| 20220329-083000 | mysql | 2022-05-17 03:02:41 | 2022-05-17 03:02:41 | OK |
| 20220329-090000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | time_index VARBINARY(48) AFTER |
| | | | | photo_taken_at' at line 1 |
| 20220329-091000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to |
| | | | | use near 'UNIQUE INDEX |
| | | | | idx_files_search_timeline ON |
| | | | | files (time_index)' at line 1 |
| 20220329-093000 | mysql | 2022-05-17 03:02:41 | 2022-05-17 03:02:42 | OK |
| 20220421-200000 | mysql | 2022-05-17 03:02:42 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check the |
| | | | | manual that corresponds to |
| | | | | your MySQL server version for |
| | | | | the right syntax to use near |
| | | | | 'INDEX idx_files_missing_root |
| | | | | ON files (file_missing, |
| | | | | file_root)' at line 1 |
| 20220521-000001 | mysql | 2022-05-25 03:02:43 | 2022-05-25 03:02:44 | OK |
| 20220521-000002 | mysql | 2022-05-25 03:02:44 | 2022-05-25 03:02:45 | OK |
| 20220521-000003 | mysql | 2022-05-25 03:02:45 | 2022-05-25 03:02:45 | OK |
|-----------------|---------|---------------------|---------------------|--------------------------------|

time="2022-05-30T13:27:57Z" level=info msg="closed database connection"

@graciousgrey graciousgrey added bug Something isn't working and removed incomplete Cannot be processed due to missing information labels May 30, 2022
@ZoXx
Copy link
Author

ZoXx commented May 30, 2022

So it's an official bug? The tag was set at least

@graciousgrey
Copy link
Member

Possibly, @lastzero will have a look as soon as possible

@graciousgrey graciousgrey added the needs-analysis Requires further investigation label May 30, 2022
@gyto6
Copy link
Contributor

gyto6 commented May 30, 2022

Did you check this command in MariaDB? It stopped the trouble to me.

mysql_upgrade --user=root --password=<root_pwd>

@lastzero
Copy link
Member

lastzero commented May 31, 2022

Please verify if you are using a supported mariadb version >= 10.5.12 and its service config includes the following environment variables as shown in our docker-compose.yml examples on dl.photoprism.app:

environment:
      MARIADB_AUTO_UPGRADE: "1"
      MARIADB_INITDB_SKIP_TZINFO: "1"

If you do not use auto upgrade, our Troubleshooting Guide includes a section about MariaDB that explains how to upgrade it manually.

@ZoXx
Copy link
Author

ZoXx commented May 31, 2022

Please verify if you are using a supported mariadb version >= 10.5.12 and its service config includes the following environment variables as shown in our docker-compose.yml examples on dl.photoprism.app:

environment:
      MARIADB_AUTO_UPGRADE: "1"
      MARIADB_INITDB_SKIP_TZINFO: "1"

If you do not use auto upgrade, our Troubleshooting Guide includes a section about MariaDB that explains how to upgrade it manually.

iam using my own mysql docker database.
Latest docker image with mysql version 8.0.29

@lastzero
Copy link
Member

@graciousgrey graciousgrey added technical-support Support request and removed bug Something isn't working needs-analysis Requires further investigation labels May 31, 2022
@ZoXx
Copy link
Author

ZoXx commented May 31, 2022

👉 https://docs.photoprism.app/getting-started/troubleshooting/#mysql-errors

MySQL Errors
Official support for MySQL 8 is discontinued

So not longer MYSQL Support and i have to switch to MariaDB?

@ZoXx
Copy link
Author

ZoXx commented May 31, 2022

We switched from MYSQL to MariaDB and imported our sql database.
Now we can upload photos again but we cant create albums? There is no error in logs.

@ZoXx
Copy link
Author

ZoXx commented May 31, 2022

The folders are created in the database, but they are not visible in Photoprism. In Photoprism there are no errors in the log. Also an indexing brings here no success.

There are no more problems with the images.

lastzero added a commit to photoprism/photoprism-docs that referenced this issue May 31, 2022
see photoprism/photoprism#2381

Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit to photoprism/photoprism-docs that referenced this issue May 31, 2022
see photoprism/photoprism#2381

Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

@ZoXx
Copy link
Author

ZoXx commented Jun 1, 2022

👉 https://docs.photoprism.app/getting-started/troubleshooting/mariadb/#incompatible-schema

docker exec photoprism photoprism migrations ls
time="2022-06-01T06:32:10Z" level=info msg="PhotoPrism® needs your support!"
time="2022-06-01T06:32:10Z" level=info msg="Visit https://photoprism.app/membership to learn more."
|-----------------|---------|---------------------|---------------------|--------------------------------|
| ID | Dialect | Started At | Finished At | Status |
|-----------------|---------|---------------------|---------------------|--------------------------------|
| 20211121-094727 | mysql | 2022-02-26 22:16:19 | 2022-02-26 22:16:19 | OK |
| 20211124-120008 | mysql | 2022-02-26 22:16:19 | 2022-02-26 22:16:19 | OK |
| 20220329-030000 | mysql | 2022-05-17 03:02:35 | 2022-05-17 03:02:35 | OK |
| 20220329-040000 | mysql | 2022-05-17 03:02:35 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | idx_albums_album_filter ON |
| | | | | albums' at line 1 |
| 20220329-050000 | mysql | 2022-05-17 03:02:35 | 2022-05-17 03:02:37 | OK |
| 20220329-060000 | mysql | 2022-05-17 03:02:37 | 2022-05-17 03:02:40 | OK |
| 20220329-061000 | mysql | 2022-05-17 03:02:40 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to use |
| | | | | near 'INDEX idx_files_photo_id |
| | | | | ON files (photo_id, |
| | | | | file_primary)' at line 1 |
| 20220329-070000 | mysql | 2022-05-17 03:02:40 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to use |
| | | | | near 'IF EXISTS photo_taken_at |
| | | | | DATETIME AFTER photo_uid' at |
| | | | | line 1 |
| 20220329-071000 | mysql | 2022-05-17 03:02:40 | 2022-05-17 03:02:41 | OK |
| 20220329-080000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | media_id VARBINARY(32) AFTER |
| | | | | photo_taken_at' at line 1 |
| 20220329-081000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to |
| | | | | use near 'UNIQUE INDEX |
| | | | | idx_files_search_media ON |
| | | | | files (media_id)' at line 1 |
| 20220329-083000 | mysql | 2022-05-17 03:02:41 | 2022-05-17 03:02:41 | OK |
| 20220329-090000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an |
| | | | | error in your SQL syntax; |
| | | | | check the manual that |
| | | | | corresponds to your MySQL |
| | | | | server version for the right |
| | | | | syntax to use near 'IF EXISTS |
| | | | | time_index VARBINARY(48) AFTER |
| | | | | photo_taken_at' at line 1 |
| 20220329-091000 | mysql | 2022-05-17 03:02:41 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check |
| | | | | the manual that corresponds |
| | | | | to your MySQL server version |
| | | | | for the right syntax to |
| | | | | use near 'UNIQUE INDEX |
| | | | | idx_files_search_timeline ON |
| | | | | files (time_index)' at line 1 |
| 20220329-093000 | mysql | 2022-05-17 03:02:41 | 2022-05-17 03:02:42 | OK |
| 20220421-200000 | mysql | 2022-05-17 03:02:42 | - | Error 1064: You have an error |
| | | | | in your SQL syntax; check the |
| | | | | manual that corresponds to |
| | | | | your MySQL server version for |
| | | | | the right syntax to use near |
| | | | | 'INDEX idx_files_missing_root |
| | | | | ON files (file_missing, |
| | | | | file_root)' at line 1 |
| 20220521-000001 | mysql | 2022-05-25 03:02:43 | 2022-05-25 03:02:44 | OK |
| 20220521-000002 | mysql | 2022-05-25 03:02:44 | 2022-05-25 03:02:45 | OK |
| 20220521-000003 | mysql | 2022-05-25 03:02:45 | 2022-05-25 03:02:45 | OK |
|-----------------|---------|---------------------|---------------------|--------------------------------|

time="2022-06-01T06:32:10Z" level=info msg="closed database connection"


docker exec photoprism photoprism migrations run -f
time="2022-06-01T06:33:43Z" level=info msg="PhotoPrism® needs your support!"
time="2022-06-01T06:33:43Z" level=info msg="Visit https://photoprism.app/membership to learn more."
time="2022-06-01T06:33:43Z" level=info msg="migrate: running previously failed migrations"
time="2022-06-01T06:33:43Z" level=info msg="migrating database schema..."
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-040000 successful [47.839887ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-061000 successful [44.680234ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-070000 successful [33.164792ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-080000 successful [24.364695ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-081000 successful [32.74057ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-090000 successful [30.963455ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220329-091000 successful [33.414971ms]"
time="2022-06-01T06:33:44Z" level=info msg="migrate: 20220421-200000 successful [34.272154ms]"
time="2022-06-01T06:33:44Z" level=info msg="migration completed in 1.188280732s"
time="2022-06-01T06:33:44Z" level=info msg="closed database connection"


docker exec photoprism photoprism index -f
runs too. Updated a lot of and matched.

-> Now it is working. Thank you very much!!!

@lastzero
Copy link
Member

lastzero commented Jun 1, 2022

You're welcome! 👉 https://photoprism.app/membership

@lastzero lastzero changed the title Error 1292: Incorrect datetime value: '0000-00-00' MariaDB: Make sure that a supported version is used Oct 8, 2022
@lastzero lastzero added the enhancement Refactoring, improvement or maintenance task label Oct 8, 2022
lastzero added a commit that referenced this issue Oct 8, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero reopened this Oct 8, 2022
@lastzero
Copy link
Member

lastzero commented Oct 8, 2022

After this happened again several times, we decided to display an error message with a link to the documentation:

$ photoprism --db-server mysql:4001 migrate
ERRO[2022-10-08T16:34:52Z] config: MySQL 8.0.27 is not supported, please upgrade
to MariaDB 10.5.12 or later (https://docs.photoprism.app/getting-started/#databases) 

@graciousgrey graciousgrey added the please-test Ready for acceptance test label Oct 23, 2022
@lastzero lastzero added released Available in the stable release and removed please-test Ready for acceptance test labels Nov 4, 2022
@lastzero
Copy link
Member

lastzero commented Nov 4, 2022

Nobody complained so far, so I'll move ahead and close this as done!

@lastzero lastzero closed this as completed Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release technical-support Support request
Projects
Status: Release 🌈
Development

No branches or pull requests

4 participants