You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm getting the below error under the following circumstances:
[PHP] Error: Division by zero at /var/www/html/custom_apps/maps/lib/Service/PhotofilesService.php#407
I have a bunch of photos uploaded to NextCloud. I then add them to the scan job with the following command:
docker exec --user www-data nextcloud php occ maps:scan-photos
The next time the cron job runs, I get the division by zero error, and none of the photos appear on the map.
The error is not happening for photos that I've recently uploaded through the Android app, and these seem to be added to the map just fine.
The photos giving the error were taken previously, and uploaded via the Linux desktop app.
Frist of all you don't need to run maps:scan-photos, after you uploaded pictures. maps:scan-photos will triger a full rescan of all files. When a file is uploaded a scan of this file is automatically scheduled.
Can you email me one sample picture, where the error occurs. Than I can see what's the exact problem. Otherwise I can just silence the error message by skipping the image.
Hi,
Thanks for your reply. I've done a bit more digging, and it looks like an issue with the GPS data on these photos... they seemed to be showing all 000's. Funny thing is that the originals on my phone still had intact GPS data, so i'm not sure where the issue lies.
--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:
https://tutanota.com
16 Apr 2020, 19:12 by notifications@github.com:
Fist of all you don't need to run maps:scan-photos, after you uploaded pictures. maps:scan-photos will triger a full rescan of all files. When a file is uploaded a scan of this file is automatically scheduled.
Related to > #123 <#123>> .
Can you email me one sample picture, where the error occurs. Than I can see what's the exact problem. Otherwise I can just silence the error message by skipping the image.
—
You are receiving this because you authored the thread.
Reply to this email directly, > view it on GitHub <#361 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AIMPMO2BAWK4LAZLMO3FDWLRM3DXRANCNFSM4MJKHKXQ>> .
I also found some lines in my log with this error:
Division by zero at /srv/www/nextcloud/apps/maps/vendor/lsolesen/pel/src/PelCanonMakerNotes.php#229
I guess it is also a problem that needs to be solved in the external library. Nevetheless, can we apply a catch for these lines as well? Where would I need to insert the logger line to get the path to these "broken" images? Is it the same as in the other issue?
Is the same as the other. The pel library is only used once to get exif data. And it is only a backup if the PHP internal function is not working for what ever reason.
I will close this issue as it seams to be a problem with the exif data.
I'm so sorry, but the cron job just silently fails because of that, and this is okay for you? No need to check or try-catch, or whatever you have there in php? The leak is on the other side of the boat?
How do I run my cron jobs again? I have no clue which of gazillons of pictures my users uploaded have wrong exif, how do I even find it?
I will close this issue as it seams to be a problem with the exif data.
I'm so sorry, but the cron job just silently fails because of that, and this is okay for you? No need to check or try-catch, or whatever you have there in php? The leak is on the other side of the boat?
How do I run my cron jobs again? I have no clue which of gazillons of pictures my users uploaded have wrong exif, how do I even find it?
I'm totally fine by this. I'm programming this in my free time which works for my usecases and you can use for free.
My cronjob is starting ever 5 minutes. I don't care if it crashed some time.
No, man, I'm sorry, I have a birthday today, and I have wasted it trying to figure out why my people don't see new files. Last place I thought it could be - is the maps app.
There you go, I have added some catches with new kind of exception appeared only in php8, that solved it for me and my cron is running now. If you care about other people cron jobs never been executed because of this silly poop - you should add it yourself https://www.php.net/manual/en/class.divisionbyzeroerror.php
Activity
tacruc commentedon Apr 16, 2020
Frist of all you don't need to run maps:scan-photos, after you uploaded pictures. maps:scan-photos will triger a full rescan of all files. When a file is uploaded a scan of this file is automatically scheduled.
Related to #123.
Can you email me one sample picture, where the error occurs. Than I can see what's the exact problem. Otherwise I can just silence the error message by skipping the image.
sirjaymond commentedon Apr 16, 2020
tacruc commentedon Apr 17, 2020
I will close this issue as it seams to be a problem with the exif data.
ggeorgg commentedon Apr 27, 2020
I also found some lines in my log with this error:
Division by zero at /srv/www/nextcloud/apps/maps/vendor/lsolesen/pel/src/PelCanonMakerNotes.php#229
I guess it is also a problem that needs to be solved in the external library. Nevetheless, can we apply a catch for these lines as well? Where would I need to insert the logger line to get the path to these "broken" images? Is it the same as in the other issue?
tacruc commentedon Apr 28, 2020
Is the same as the other. The pel library is only used once to get exif data. And it is only a backup if the PHP internal function is not working for what ever reason.
AykutCevik commentedon Jun 11, 2020
@sirjaymond how did you upload the pictures so the originals had the GPS data but the uploaded ones not?
TheBluestBird commentedon Mar 21, 2021
I'm so sorry, but the cron job just silently fails because of that, and this is okay for you? No need to check or try-catch, or whatever you have there in php? The leak is on the other side of the boat?
How do I run my cron jobs again? I have no clue which of gazillons of pictures my users uploaded have wrong exif, how do I even find it?
tacruc commentedon Mar 21, 2021
I'm totally fine by this. I'm programming this in my free time which works for my usecases and you can use for free.
My cronjob is starting ever 5 minutes. I don't care if it crashed some time.
You might try to fix the catch block in
maps/lib/Service/PhotofilesService.php
Line 385 in b2af5dd
It might help to replace PelException with Exception. I'm happy to review your PR.
TheBluestBird commentedon Mar 21, 2021
No, man, I'm sorry, I have a birthday today, and I have wasted it trying to figure out why my people don't see new files. Last place I thought it could be - is the maps app.
There you go, I have added some catches with new kind of exception appeared only in php8, that solved it for me and my cron is running now. If you care about other people cron jobs never been executed because of this silly poop - you should add it yourself
https://www.php.net/manual/en/class.divisionbyzeroerror.php
tacruc commentedon Mar 21, 2021
I'm quite aware of the php docs. Thanks for posting it anyways, have fun on your birthday.
mxm-tr commentedon Jul 15, 2022
The issue is still occurring on Maps 0.1.10 in my Nextcloud 24.0.2 install , the line number is now different though
The line is the following:
I manually patched it with the code from #648 and the error is gone now, maybe this PR could be merged? Thanks!