-
- Notifications
You must be signed in to change notification settings - Fork 78
Description
Describe the bug
The newly introduced webp exif feature #3202 does not work due to one of the classes in the dependencies not autoloaded.
To Reproduce
- Install nextcloud 33.0
- Upload a webp image to the Photos folder
- Get 500 Internal Server Error
- The file does get uploaded, but exif is not parsed
Expected behaviour
No error, parsed exif.
Browser log
PUT
https://domain/remote.php/dav/files/admin/Photos/img.webp
[HTTP/1.1 500 Internal Server Error 1031ms]
Additional context
Error in the log:
Details
{ "reqId": "EmDwlb9lr0fRnymUyh1t", "level": 3, "time": "2026-02-18T22:53:55+00:00", "remoteAddr": "::1", "user": "admin", "app": "no app in context", "method": "PUT", "url": "/remote.php/dav/files/admin/Photos/IMG_1954.webp", "scriptName": "/remote.php", "message": "Uncaught exception", "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0", "version": "33.0.0.16", "exception": { "Exception": "Error", "Message": "Class \"WoltLab\\WebpExif\\ChunkType\" not found", "Code": 0, "Trace": [ { "file": "/tmpe/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php", "line": 180, "function": "decodeChunk", "class": "WoltLab\\WebpExif\\Decoder", "type": "->" }, { "file": "/tmpe/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php", "line": 82, "function": "getExifFromWebP", "class": "OCA\\Photos\\Listener\\ExifMetadataProvider", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php", "line": 57, "function": "handle", "class": "OCA\\Photos\\Listener\\ExifMetadataProvider", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 220, "function": "__invoke", "class": "OC\\EventDispatcher\\ServiceEventListener", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 56, "function": "callListeners", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line": 67, "function": "dispatch", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line": 79, "function": "dispatch", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php", "line": 100, "function": "dispatchTyped", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/FilesMetadata/Listener/MetadataUpdate.php", "line": 42, "function": "refreshMetadata", "class": "OC\\FilesMetadata\\FilesMetadataManager", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php", "line": 57, "function": "handle", "class": "OC\\FilesMetadata\\Listener\\MetadataUpdate", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 220, "function": "__invoke", "class": "OC\\EventDispatcher\\ServiceEventListener", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 56, "function": "callListeners", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line": 67, "function": "dispatch", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line": 79, "function": "dispatch", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/Files/Node/HookConnector.php", "line": 83, "function": "dispatchTyped", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->" }, { "file": "/tmpe/nextcloud/lib/private/legacy/OC_Hook.php", "line": 85, "function": "postWrite", "class": "OC\\Files\\Node\\HookConnector", "type": "->" }, { "file": "/tmpe/nextcloud/apps/dav/lib/Connector/Sabre/File.php", "line": 443, "function": "emit", "class": "OC_Hook", "type": "::" }, { "file": "/tmpe/nextcloud/apps/dav/lib/Connector/Sabre/File.php", "line": 363, "function": "emitPostHooks", "class": "OCA\\DAV\\Connector\\Sabre\\File", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 1137, "function": "put", "class": "OCA\\DAV\\Connector\\Sabre\\File", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php", "line": 492, "function": "updateFile", "class": "Sabre\\DAV\\Server", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/tmpe/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php", "line": 89, "function": "httpPut", "class": "Sabre\\DAV\\CorePlugin", "type": "->" }, { "file": "/tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 472, "function": "emit", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/tmpe/nextcloud/apps/dav/lib/Connector/Sabre/Server.php", "line": 212, "function": "invokeMethod", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/tmpe/nextcloud/apps/dav/lib/Server.php", "line": 427, "function": "start", "class": "OCA\\DAV\\Connector\\Sabre\\Server", "type": "->" }, { "file": "/tmpe/nextcloud/apps/dav/appinfo/v2/remote.php", "line": 25, "function": "exec", "class": "OCA\\DAV\\Server", "type": "->" }, { "file": "/tmpe/nextcloud/remote.php", "line": 151, "args": [ "/tmpe/nextcloud/apps/dav/appinfo/v2/remote.php" ], "function": "require_once" } ], "File": "/tmpe/nextcloud/apps/photos/vendor/woltlab/webp-exif/src/Decoder.php", "Line": 96, "message": "Uncaught exception", "exception": "{\"class\":\"Error\",\"message\":\"Class \\\"WoltLab\\WebpExif\\ChunkType\\\" not found\",\"code\":0,\"file\":\"/tmpe/nextcloud/apps/photos/vendor/woltlab/webp-exif/src/Decoder.php:96\",\"trace\":\"#0 /tmpe/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php(180): WoltLab\\WebpExif\\Decoder->decodeChunk()\\n#1 /tmpe/nextcloud/apps/photos/lib/Listener/ExifMetadataProvider.php(82): OCA\\Photos\\Listener\\ExifMetadataProvider->getExifFromWebP()\\n#2 /tmpe/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php(57): OCA\\Photos\\Listener\\ExifMetadataProvider->handle()\\n#3 /tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(220): OC\\EventDispatcher\\ServiceEventListener->__invoke()\\n#4 /tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners()\\n#5 /tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(67): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()\\n#6 /tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(79): OC\\EventDispatcher\\EventDispatcher->dispatch()\\n#7 /tmpe/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php(100): OC\\EventDispatcher\\EventDispatcher->dispatchTyped()\\n#8 /tmpe/nextcloud/lib/private/FilesMetadata/Listener/MetadataUpdate.php(42): OC\\FilesMetadata\\FilesMetadataManager->refreshMetadata()\\n#9 /tmpe/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php(57): OC\\FilesMetadata\\Listener\\MetadataUpdate->handle()\\n#10 /tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(220): OC\\EventDispatcher\\ServiceEventListener->__invoke()\\n#11 /tmpe/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners()\\n#12 /tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(67): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()\\n#13 /tmpe/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(79): OC\\EventDispatcher\\EventDispatcher->dispatch()\\n#14 /tmpe/nextcloud/lib/private/Files/Node/HookConnector.php(83): OC\\EventDispatcher\\EventDispatcher->dispatchTyped()\\n#15 /tmpe/nextcloud/lib/private/legacy/OC_Hook.php(85): OC\\Files\\Node\\HookConnector->postWrite()\\n#16 /tmpe/nextcloud/apps/dav/lib/Connector/Sabre/File.php(443): OC_Hook::emit()\\n#17 /tmpe/nextcloud/apps/dav/lib/Connector/Sabre/File.php(363): OCA\\DAV\\Connector\\Sabre\\File->emitPostHooks()\\n#18 /tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(1137): OCA\\DAV\\Connector\\Sabre\\File->put()\\n#19 /tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(492): Sabre\\DAV\\Server->updateFile()\\n#20 /tmpe/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\\DAV\\CorePlugin->httpPut()\\n#21 /tmpe/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\\DAV\\Server->emit()\\n#22 /tmpe/nextcloud/apps/dav/lib/Connector/Sabre/Server.php(212): Sabre\\DAV\\Server->invokeMethod()\\n#23 /tmpe/nextcloud/apps/dav/lib/Server.php(427): OCA\\DAV\\Connector\\Sabre\\Server->start()\\n#24 /tmpe/nextcloud/apps/dav/appinfo/v2/remote.php(25): OCA\\DAV\\Server->exec()\\n#25 /tmpe/nextcloud/remote.php(151): require_once('...')\\n#26 {main}\"}", "CustomMessage": "Uncaught exception" }, "id": "69964c0de08e1" } I managed to identify he cause of the bug. As the error message says, the enum WoltLab\WebpExif\ChunkType cannot be found, which is referenced in the dependency WoltLab\WebpExif\Decoder.php.
This file cannot be found, because it is not included the autoload classmap generated by composer for some reason. If you download the NC 33 release you can see that the file apps/photos/vendor/composer/autoload_classmap.php doesn't contain WoltLab\WebpExif\ChunkType. However when running composer install or composer dump-autoload locally the line
'WoltLab\\WebpExif\\ChunkType' => $vendorDir . '/woltlab/webp-exif/src/ChunkType.php', does get inserted, as expected.
After generating the correct autload file, webp upload works as expected.
I suspect that "classmap-authoritative": true in composer.json might be responsible for the emission of this file (also: see this blogpost ), but I'm not 100% certain as locally I could generate the correct classmap even with this option enabled.
To resolve this bug please try to figure out why this class is missing from the autoloader and make sure that the nexcloud bundle ships with the correct autoload_classmap.php.