nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
517 stars 59 forks source link

[PHP] Error: getimagesizefromstring(): Error reading from ! at /var/www/html/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php#56 from ? #2259

Open bernd-wechner opened 5 months ago

bernd-wechner commented 5 months ago

Describe the bug My log file is filled with this message:

[PHP] Error: getimagesizefromstring(): Error reading from ! at /var/www/html/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php#56 from ?

Screenshots Just a small section of the Logging viewer: image

Nextcloud (please complete the following information):

Desktop (please complete the following information):

Additional context A complete formatted message is:

[PHP] Error: getimagesizefromstring(): Error reading from ! at /var/www/html/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php#56
    from ? by -- at 18 Jan 2024, 10:23:00 pm

and a complete raw message is:

{
  "reqId": "M10zk8LUgTEAALmH7HB5",
  "level": 3,
  "time": "2024-01-18T22:23:00+11:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": "getimagesizefromstring(): Error reading from ! at /var/www/html/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php#56",
  "userAgent": "--",
  "version": "28.0.1.1",
  "data": {
    "app": "PHP"
  },
  "id": "65a997949bbeb"
}
MihailCosmin commented 5 months ago

Have same issue, [Nextcloud Hub 7] (28.0.1)

image

RobTheBuilder2 commented 5 months ago

I had the same issue and also had a lot of picture missing from the "All Media" view. Funny thing was the missing photos were showing up in the "Folder View". I fixed this by increasing the PHP allowed memory in the nextcloud configuration. After that, I ran a scan of the photos and everything was back to normal as well as no more error messages. I think the latest update uses more memory when scanning photos for exif data for some reason. Its the only thing I can think of. Similar to this post

RobTheBuilder2 commented 5 months ago

I take it all back. After bumping my PHP memory limit, the problem went away for a few days. However, starting yesterday, I started to get the error again and now the 12G of PHP memory has been exceeded. Looks like a memory leak. Question is if this memory leak is a result of the exception handling or if hitting the memory limit is the actual cause of the errors. Either way, log file is flooded with the getimagesizefromstring() error again. Also, after getting into this state, the "All media" view no longer loads any photos. After I bounce my docker containers, "All Media" view starts to work properly again. Finally worth mentioning, while the PHP memory limit is set to 12G and there is an error message in NC log saying the limit was exceeded, my metrics show that there was never more than 800M claimed by the actual NC docker container. There is plenty of ram remaining on the server (32G) and for some reason, I get this memory limit exceeded error in PHP while it is only consuming 800M of the allowed 12G.

benoitdr commented 1 month ago

Seeing this too with 28.0.4

GomoDD commented 1 month ago

This issue is still not fixed, it also occurs in 28.0.6

joshtrichards commented 15 hours ago

Apply the patch in #2524 (instructions though it's easy to do manually as well since it's a short PR). Then you can set your loglevel temporarily to 0 (debug level) to see the file path. This may give a hint about what is going on (maybe a file that can't be read for some reason?).

While similar to #2257 and #2235, those are more obvious as to their underlying cause (images corrupt... at least from gd's perspective).