Unable to execute office commands | Nextcloud Docker Image

Hello,
I have installed Nextcloud over the official docker image.

Sometimes I get some random error messages that Nextcloud was unable to execute 'command -v libreoffice' at /var/www/html/lib/private/PreviewManager.php#402.

But I haven’t installed Collabora Online or the Colloabora Built-in CODE Server. I already tried to install and remove the Collabora-App, with no success.

The error messages (see below) appears randomly.
Sometimes this error leads to an “Internal Server Error” Page. After reloading, Nextcloud is fine but i have these errors in the log:

{"reqId":"XbQNwyCAmF77tbFPHfI9","level":3,"time":"2021-08-10T11:15:20+00:00","remoteAddr":"77.20.131.17","user":"Ziesie","app":"PHP","method":"GET","url":"/core/preview?fileId=36459&x=256&y=256&a=true&v="4e317173f1cf9e96126f8d56a46dcaea"","message":"shell_exec(): Unable to execute 'command -v openoffice' at /var/www/html/lib/private/PreviewManager.php#405","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36","version":"22.0.0.11","exception":{"Exception":"Error","Message":"shell_exec(): Unable to execute 'command -v openoffice' at /var/www/html/lib/private/PreviewManager.php#405","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"shell_exec(): Unable to execute 'command -v openoffice'","/var/www/html/lib/private/PreviewManager.php",405,{"0":"And 1 more entries, set log level to debug to see all entries","checkImagick":{"__class__":"Imagick"},"provider":{"mimetype":"/image\\/sgi/","class":"OC\\Preview\\SGI"},"queryFormat":"SGI","class":"OC\\Preview\\SGI","officeFound":false}]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":405,"function":"shell_exec","args":["command -v openoffice"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":222,"function":"registerCoreProviders","class":"OC\\PreviewManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":178,"function":"isMimeSupported","class":"OC\\PreviewManager","type":"->","args":["image/jpeg"]},{"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":256,"height":256,"crop":false,"mode":"fill"}],"image/jpeg"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},256,256,false,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},256,256,false,"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"},256,256,true,true,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[36459,256,256,true,true,"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":"61125fd2bec19"}

{"reqId":"XbQNwyCAmF77tbFPHfI9","level":3,"time":"2021-08-10T11:15:20+00:00","remoteAddr":"77.20.131.17","user":"Ziesie","app":"PHP","method":"GET","url":"/core/preview?fileId=36459&x=256&y=256&a=true&v="4e317173f1cf9e96126f8d56a46dcaea"","message":"shell_exec(): Unable to execute 'command -v libreoffice' at /var/www/html/lib/private/PreviewManager.php#402","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36","version":"22.0.0.11","exception":{"Exception":"Error","Message":"shell_exec(): Unable to execute 'command -v libreoffice' at /var/www/html/lib/private/PreviewManager.php#402","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"shell_exec(): Unable to execute 'command -v libreoffice'","/var/www/html/lib/private/PreviewManager.php",402,{"checkImagick":{"__class__":"Imagick"},"provider":{"mimetype":"/image\\/sgi/","class":"OC\\Preview\\SGI"},"queryFormat":"SGI","class":"OC\\Preview\\SGI","officeFound":false}]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":402,"function":"shell_exec","args":["command -v libreoffice"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":222,"function":"registerCoreProviders","class":"OC\\PreviewManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":178,"function":"isMimeSupported","class":"OC\\PreviewManager","type":"->","args":["image/jpeg"]},{"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":256,"height":256,"crop":false,"mode":"fill"}],"image/jpeg"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":189,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},256,256,false,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},256,256,false,"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"},256,256,true,true,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[36459,256,256,true,true,"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":"61125fd2bed09"}

Nextcloud version : 22.0.0
Operating system and version : Linux 4.15.0 x86_64
PHP version : 7.4.21

Does anyone else have this problem? or have anybody an idea how I can fix this issue?

Thank you very much!

1 Like