Avatar generation - Error: imagepng(): Argument #1 ($image) must be of type GdImage, bool given

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version : Nextcloud Hub 8 (29.0.3)
Operating system and version: rocky linux 9.4
Apache or nginx version: 2.4.57-8.el9
PHP version: 8.2.20

The issue you are facing:
I get an error in log frequently. Something about my avatar. The avatar is visible in top right corner.

Is this the first time you’ve seen this error?: N

Steps to replicate it:

  1. I upgraded from 25.0.13 using web interface

The output of your Nextcloud log in Admin > Logging:

{"reqId":"ZoezMSYrVJeDC4XTDeo55AAAAIQ","level":3,"time":"2024-07-05T08:47:45+00:00","remoteAddr":"176.12.17.226","user":"npelov","app":"webdav","method":"GET","url":"/remote.php/dav/avatars/npelov/128.png","message":"imagepng(): Argument #1 ($image) must be of type GdImage, bool given","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","version":"29.0.3.4","exception":{"Exception":"TypeError","Message":"imagepng(): Argument #1 ($image) must be of type GdImage, bool given","Code":0,"Trace":[{"file":"/home/nextcloud/www/apps/dav/lib/Avatars/AvatarNode.php","line":63,"function":"imagepng"},{"file":"/home/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":85,"function":"get","class":"OCA\\DAV\\Avatars\\AvatarNode","type":"->"},{"file":"/home/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/home/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/home/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/home/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/home/nextcloud/www/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/home/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/home/nextcloud/www/remote.php","line":172,"args":["/home/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/home/nextcloud/www/apps/dav/lib/Avatars/AvatarNode.php","Line":63,"message":"imagepng(): Argument #1 ($image) must be of type GdImage, bool given","exception":[],"CustomMessage":"imagepng(): Argument #1 ($image) must be of type GdImage, bool given"},"id":"6687b3d911941"}

The output of your Apache/nginx/system log in /var/log/____:

nothing here

have you tried deleting and re-enabling it?

I tried that now. but this error only appears about once a day. It’s multiple log entries - 5-10, but after it appears 5-10 times it doesn’t appear anymore for 24 hours. So I’ll check tomorrow