Skip to content

Unicode issues: umlauts in path are not working in some cases #261

@Sim0nW0lf

Description

@Sim0nW0lf

Configuration

My system is running Docker version 20.10.10, nextcloud:apache (currently v,22.2.0) with redis and Traefik in my docker-compose.yml on arm64 and also amd64
I use the previewgenerator app aswell as the camera raw preview app.
These are the necessary components installed and the altered policies.
Finally my preview settings in Nextclouds config.php.

Issue

The issue is, that RAW, tif, indd (all camerarawpreviews) images and MSOffice documents (maybe also others) throw errors instead of generating a preview if the path or filename contains any umlauts. (öäü)
txt, md, odt, png, jpg, pdf work. I didn't test more, maybe there are some more that don't work.

Example 1:

image
Logs:

[core] Error: unable to open image `/tmp/test.png': No such file or directory @ error/blob.c/OpenBlob/2924

GET /core/preview?fileId=250312&c=1248d325c58d97f7e6013764215d03ba&x=250&y=250&forceIcon=0&a=0
from 77.6.209.250 by root at 2021-11-12T17:16:46+00:00

{"reqId":"8rAq58Ukd7RRwoVnvqHD","level":3,"time":"2021-11-12T17:16:46+00:00","remoteAddr":"77.6.209.250","user":"root","app":"core","method":"GET","url":"/core/preview?fileId=250312&c=1248d325c58d97f7e6013764215d03ba&x=250&y=250&forceIcon=0&a=0","message":"unable to open image `/tmp/test.png': No such file or directory @ error/blob.c/OpenBlob/2924","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"ImagickException","Message":"unable to open image `/tmp/test.png': No such file or directory @ error/blob.c/OpenBlob/2924","Code":435,"Trace":[{"file":"/var/www/html/lib/private/Preview/Office.php","line":64,"function":"__construct","class":"Imagick","type":"->","args":["/tmp/test.png[0]"]},{"file":"/var/www/html/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OC\\Preview\\Office","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OC\\Preview\\MSOffice2007"},{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":250,"height":250,"crop":true,"mode":"fill"}],"application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[250312,250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/var/www/html/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Preview/Office.php","Line":64,"CustomMessage":"--"},"id":"618ea17f50c8c"}

[PHP] Error: unlink(/tmp/test.png): No such file or directory at /var/www/html/lib/private/Preview/Office.php#68

GET /core/preview?fileId=250312&c=1248d325c58d97f7e6013764215d03ba&x=250&y=250&forceIcon=0&a=0
from 77.6.209.250 by root at 2021-11-12T17:16:46+00:00

{"reqId":"8rAq58Ukd7RRwoVnvqHD","level":3,"time":"2021-11-12T17:16:46+00:00","remoteAddr":"77.6.209.250","user":"root","app":"PHP","method":"GET","url":"/core/preview?fileId=250312&c=1248d325c58d97f7e6013764215d03ba&x=250&y=250&forceIcon=0&a=0","message":"unlink(/tmp/test.png): No such file or directory at /var/www/html/lib/private/Preview/Office.php#68","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"unlink(/tmp/test.png): No such file or directory at /var/www/html/lib/private/Preview/Office.php#68","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"unlink(/tmp/test.png): No such file or directory","/var/www/html/lib/private/Preview/Office.php",68]},{"file":"/var/www/html/lib/private/Preview/Office.php","line":68,"function":"unlink","args":["/tmp/test.png"]},{"file":"/var/www/html/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OC\\Preview\\Office","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OC\\Preview\\MSOffice2007"},{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":250,"height":250,"crop":true,"mode":"fill"}],"application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[250312,250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/var/www/html/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"618ea17f50d00"}

Example 2:

image
logs:

[camerarawpreviews] Error: Unable to find preview data: /usr/bin/perl /var/www/html/custom_apps/camerarawpreviews/vendor/exiftool/exiftool/exiftool -json -preview:all -FileType '/media/ncdata/root/files/umlauts /DSC01740.ARW' -> 

GET /core/preview?fileId=250428&c=8d12c65ae12ad141ad691665e7a7a98c&x=250&y=250&forceIcon=0&a=0
from 77.6.209.250 by root at 2021-11-12T17:26:21+00:00

{"reqId":"G8Jz1uJTRQKjLAVjamyv","level":3,"time":"2021-11-12T17:26:21+00:00","remoteAddr":"77.6.209.250","user":"root","app":"camerarawpreviews","method":"GET","url":"/core/preview?fileId=250428&c=8d12c65ae12ad141ad691665e7a7a98c&x=250&y=250&forceIcon=0&a=0","message":"Unable to find preview data: /usr/bin/perl /var/www/html/custom_apps/camerarawpreviews/vendor/exiftool/exiftool/exiftool -json -preview:all -FileType '/media/ncdata/root/files/umlauts /DSC01740.ARW' -> ","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Exception","Message":"Unable to find preview data: /usr/bin/perl /var/www/html/custom_apps/camerarawpreviews/vendor/exiftool/exiftool/exiftool -json -preview:all -FileType '/media/ncdata/root/files/umlauts /DSC01740.ARW' -> ","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/camerarawpreviews/lib/RawPreviewBase.php","line":111,"function":"getBestPreviewTag","class":"OCA\\CameraRawPreviews\\RawPreviewBase","type":"->","args":["/media/ncdata/root/files/umlauts öä/DSC01740.ARW"]},{"file":"/var/www/html/custom_apps/camerarawpreviews/lib/RawPreviewBase.php","line":61,"function":"getResizedPreview","class":"OCA\\CameraRawPreviews\\RawPreviewBase","type":"->","args":["/media/ncdata/root/files/umlauts öä/DSC01740.ARW",2048,2048]},{"file":"/var/www/html/custom_apps/camerarawpreviews/lib/RawPreviewIProviderV2.php","line":25,"function":"getThumbnailInternal","class":"OCA\\CameraRawPreviews\\RawPreviewBase","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OCA\\CameraRawPreviews\\RawPreviewIProviderV2","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OCA\\CameraRawPreviews\\RawPreviewIProviderV2"},{"__class__":"OC\\Files\\Node\\File"},2048,2048]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"image/x-dcraw",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":250,"height":250,"crop":true,"mode":"fill"}],"image/x-dcraw"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[250428,250,250,false,false,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/var/www/html/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/camerarawpreviews/lib/RawPreviewBase.php","Line":196,"CustomMessage":"--"},"id":"618ea3bda77c2"}

Is this a configuration issue on my side or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions