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

Sync Error #205

Closed
SlimeyIceCream opened this issue May 23, 2023 · 11 comments · Fixed by #229
Closed

Sync Error #205

SlimeyIceCream opened this issue May 23, 2023 · 11 comments · Fixed by #229

Comments

@SlimeyIceCream
Copy link

SlimeyIceCream commented May 23, 2023

Hello! This is my first time using Piwigo and I installed piwigo-videojs so videos will show up and I encounter this error:

Fatal error: Uncaught mysqli_sql_exception: Incorrect datetime value: '-0001-11-30 00:00:00' for column piwigo.piwigo_images.date_creation at row 1 in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /config/www/plugins/piwigo-videojs/include/function_sync2.php(104): pwg_query() #2 /config/www/plugins/piwigo-videojs/admin/admin_sync.php(104): require_once('...') #3 /config/www/plugins/piwigo-videojs/admin/admin.php(68): include_once('...') #4 /app/www/public/admin/plugin.php(53): include_once('...') #5 /app/www/public/admin.php(345): include('...') #6 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132

What I did:
Synced piwigo with the built in tool with the directories + files option selected
Went to the plugin paged and went to settings for videojs
Went to the synchronize area of the settings
Left as default and pressed sync, got the error I sent earlier
.
Also, the sync works when I do it as a simulation.

Other info:
I'm using the docker image from linux server to run piwigo(Version 13)
Running on my pi3 (1 GB of ram but that doesn't seem to be the issue)

@lilian-pouliquen
Copy link

Hello!
I got the same issue while testing the plugin with the latest master.
I'm going to investigate to find the origin, I'll let you know if I find something interesting

@lilian-pouliquen
Copy link

@SlimeyIceCream,

After further investigation I found that the error was due to the date of creation of the medias being null or not set.
When photos and videos are imported into Piwigo, they don't have any creation date. The sync process try to insert it into the database, null takes the value -0001-11-30 00:00:00 which is not a valid value.

To avoid the error:

  1. Open the edition menu of your video
  2. Go to the VideoJS tab
  3. Click on "Sync metadata"

image

You can also set a date for all your videos like so:

  1. Go to Admin > Photos > Batch manager
  2. Choose filters to apply
  3. Refresh the result
  4. Select elements to edit
  5. Set creation date on elements

Don't forget to apply changes:

image

I hope this will be useful,
Lilian POULIQUEN

@klaoun
Copy link

klaoun commented Jul 28, 2023

Hi @lilian-pouliquen
Wich version PHP ?
Thx

@lilian-pouliquen
Copy link

Hi @lilian-pouliquen Wich version PHP ? Thx

Hi @klaoun
I'm using PHP 8.1.21 FPM in a homemade Docker image

Thanks for your reply!

@SlimeyIceCream
Copy link
Author

@SlimeyIceCream,

After further investigation I found that the error was due to the date of creation of the medias being null or not set. When photos and videos are imported into Piwigo, they don't have any creation date. The sync process try to insert it into the database, null takes the value -0001-11-30 00:00:00 which is not a valid value.

To avoid the error:

1. Open the edition menu of your video

2. Go to the VideoJS tab

3. Click on "Sync metadata"

image

You can also set a date for all your videos like so:

1. Go to Admin > Photos > Batch manager

2. Choose filters to apply

3. Refresh the result

4. Select elements to edit

5. Set creation date on elements

Don't forget to apply changes:

image

I hope this will be useful, Lilian POULIQUEN

I was beginning to think it was going to be 2024 by the time I got a reply! Thank you so much, ill test this soon.

@SlimeyIceCream
Copy link
Author

I still get an error and I also get an error with I click "sync metadata"(but thats fine I can just select a random date), but it seems to work now that i've added a date to it. Thanks

@lilian-pouliquen
Copy link

I still get an error and I also get an error with I click "sync metadata"(but thats fine I can just select a random date), but it seems to work now that i've added a date to it. Thanks

I'm glad this helped you!
What are the errors you get?

@SlimeyIceCream
Copy link
Author

SlimeyIceCream commented Aug 6, 2023

I still get an error and I also get an error with I click "sync metadata"(but thats fine I can just select a random date), but it seems to work now that i've added a date to it. Thanks

I'm glad this helped you! What are the errors you get?

Sync meta deta error:
Fatal error: Uncaught mysqli_sql_exception: Incorrect datetime value: '-0001-11-30 00:00:00' for column piwigo.piwigo_images.date_creation at row 1 in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /config/www/plugins/piwigo-videojs/include/function_sync2.php(104): pwg_query() #2 /config/www/plugins/piwigo-videojs/admin/admin_photo.php(102): require_once('...') #3 /app/www/public/admin/plugin.php(53): include_once('...') #4 /app/www/public/admin.php(345): include('...') #5 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132

The upload error is different from when I last did it for some reason. The "Deprecated:" repeats a lot with different values each time so I didnt bother including the entire wall of text.
Upload error:

Deprecated: Implicit conversion from float 182.5 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 122

Deprecated: Implicit conversion from float 1299.75 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 122

Deprecated: Implicit conversion from float 224.5 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 122

Deprecated: Implicit conversion from float 1241.25 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 126

Deprecated: Implicit conversion from float 1299.75 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 130

Deprecated: Implicit conversion from float 219.5 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 130

Deprecated: Implicit conversion from float 64.5 to int loses precision in /config/www/plugins/piwigo-videojs/include/function_frame.php on line 98

Fatal error: Uncaught mysqli_sql_exception: Incorrect datetime value: '-0001-11-30 00:00:00' for column `piwigo`.`piwigo_images`.`date_creation` at row 1 in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /config/www/plugins/piwigo-videojs/include/function_sync2.php(104): pwg_query() #2 /config/www/plugins/piwigo-videojs/admin/admin_sync.php(104): require_once('...') #3 /config/www/plugins/piwigo-videojs/admin/admin.php(68): include_once('...') #4 /app/www/public/admin/plugin.php(53): include_once('...') #5 /app/www/public/admin.php(345): include('...') #6 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132

@lilian-pouliquen
Copy link

Are you at the latest version of the master branch? (just to make sure)

Do you have all requirements installed and configured to manage metadata? (see here)

It seems that your videos does not have any creation date, even after syncing metadata. It is possible that it does not have one I think. In this case you must add it manually.
I don't know well enough how metadata work so I may not be too helpful.

For your upload error, when does it happen? on the video upload?
Also the plugin require to sync Piwigo with what you uploaded with Maintainance > Synchronize (I couldn't find it again in the plugin wiki), maybe it'll help?

@bmaehr
Copy link

bmaehr commented Aug 14, 2023

Have the same problem. Even after setting date_creation in database the problem persits.

@bmaehr
Copy link

bmaehr commented Aug 14, 2023

The problem is in include/exiftool.php
I have commented line 70

//$exif['date_creation'] = date('Y-m-d H:i:s', strtotime((string)$general['MediaCreateDate']));

Additionally I changed in in include/mediainfo.php line 138 to

$exif['date_creation'] = date('Y-m-d H:i:s', strtotime((string)$general->Recorded_Date));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants