Hello,
I’m trying to solve a very annoying issue. I have a docker container of nextcloud using LinuxServer image. I’m using an s3 object storage at Scaleway which has been working great until know.
I have a tons of log error and console error when opening the network inspector in Firefox. The result is that files are listed, but I cannot have any preview of it, or open it.
Some logs
{"reqId":"Ja6eD9XgVwgC2oPcJuUZ","level":3,"time":"2020-04-20T13:44:00+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"PHP","method":"GET","url":"\/apps\/gallery\/preview\/40946?width=400&height=200","message":"fread() expects parameter 1 to be resource, bool given at \/config\/www\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#858","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"Ja6eD9XgVwgC2oPcJuUZ","level":3,"time":"2020-04-20T13:44:00+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"PHP","method":"GET","url":"\/apps\/gallery\/preview\/40946?width=400&height=200","message":"fclose() expects parameter 1 to be resource, bool given at \/config\/www\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#859","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"aUnja1I02Yagec0wv2Xb","level":3,"time":"2020-04-20T13:44:01+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"PHP","method":"GET","url":"\/apps\/gallery\/preview\/40951?width=400&height=200","message":"fopen(https:\/\/s3-imp-nextcloud.s3.nl-ams.scw.cloud\/urn%3Aoid%3A42389): failed to open stream: HTTP request failed! HTTP\/1.1 500 Internal Server Error\r\n at \/config\/www\/nextcloud\/lib\/private\/Files\/ObjectStore\/S3ObjectTrait.php#70","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"aUnja1I02Yagec0wv2Xb","level":3,"time":"2020-04-20T13:44:01+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"gallery","method":"GET","url":"\/apps\/gallery\/preview\/40951?width=400&height=200","message":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"\/config\/www\/nextcloud\/lib\/private\/PreviewManager.php","line":210,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},410,256,false,"fill","image\/jpeg"]},{"file":"\/config\/www\/nextcloud\/apps\/gallery\/lib\/Service\/PreviewService.php","line":106,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},400,200,false]},{"file":"\/config\/www\/nextcloud\/apps\/gallery\/lib\/Controller\/Preview.php","line":167,"function":"createPreview","class":"OCA\\Gallery\\Service\\PreviewService","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},400,200,true,false]},{"file":"\/config\/www\/nextcloud\/apps\/gallery\/lib\/Controller\/Preview.php","line":117,"function":"getPreviewData","class":"OCA\\Gallery\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},true,400,200,true,false]},{"file":"\/config\/www\/nextcloud\/apps\/gallery\/lib\/Controller\/PreviewController.php","line":134,"function":"getData","class":"OCA\\Gallery\\Controller\\PreviewController","type":"->","args":[40951,400,200]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":170,"function":"getPreview","class":"OCA\\Gallery\\Controller\\PreviewController","type":"->","args":[40951,400,200]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Gallery\\Controller\\PreviewController"},"getPreview"]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Gallery\\Controller\\PreviewController"},"getPreview"]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["PreviewController","getPreview",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"fileId":"40951","_route":"gallery.preview.get_preview"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"fileId":"40951","_route":"gallery.preview.get_preview"}]},{"file":"\/config\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"fileId":"40951","_route":"gallery.preview.get_preview"}]},{"file":"\/config\/www\/nextcloud\/lib\/base.php","line":997,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/gallery\/preview\/40951"]},{"file":"\/config\/www\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/config\/www\/nextcloud\/lib\/private\/Preview\/Generator.php","Line":156,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"aUnja1I02Yagec0wv2Xb","level":3,"time":"2020-04-20T13:44:01+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"gallery","method":"GET","url":"\/apps\/gallery\/preview\/40951?width=400&height=200","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"Ja6eD9XgVwgC2oPcJuUZ","level":3,"time":"2020-04-20T13:44:01+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"PHP","method":"GET","url":"\/apps\/gallery\/preview\/40946?width=400&height=200","message":"fopen(https:\/\/s3-imp-nextcloud.s3.nl-ams.scw.cloud\/urn%3Aoid%3A41625): failed to open stream: HTTP request failed! HTTP\/1.1 500 Internal Server Error\r\n at \/config\/www\/nextcloud\/lib\/private\/Files\/ObjectStore\/S3ObjectTrait.php#70","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
{"reqId":"Ja6eD9XgVwgC2oPcJuUZ","level":3,"time":"2020-04-20T13:44:01+00:00","remoteAddr":"172.18.0.1","user":"c4534a82-ebf6-1038-9fee-d975121bf7b5","app":"index","method":"GET","url":"\/apps\/gallery\/preview\/40946?width=400&height=200","message":{"Exception":"TypeError","Message":"Argument 3 passed to OC\\AppFramework\\Middleware\\MiddlewareDispatcher::beforeOutput() must be of the type string, null given, called in \/config\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php on line 123","Code":0,"Trace":[{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":123,"function":"beforeOutput","class":"OC\\AppFramework\\Middleware\\MiddlewareDispatcher","type":"->","args":[{"__class__":"OCA\\Gallery\\Controller\\PreviewController"},"getPreview",null]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Gallery\\Controller\\PreviewController"},"getPreview"]},{"file":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["PreviewController","getPreview",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"fileId":"40946","_route":"gallery.preview.get_preview"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"fileId":"40946","_route":"gallery.preview.get_preview"}]},{"file":"\/config\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"fileId":"40946","_route":"gallery.preview.get_preview"}]},{"file":"\/config\/www\/nextcloud\/lib\/base.php","line":997,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/gallery\/preview\/40946"]},{"file":"\/config\/www\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/config\/www\/nextcloud\/lib\/private\/AppFramework\/Middleware\/MiddlewareDispatcher.php","Line":157,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36","version":"17.0.4.2"}
It can still be visible at https://nextcloud.media.imperium-gaming.fr
I was on 18.03 version (latest), but tried to rollback to 3 differents backups (nextcloud config files + database), including a nextcloud v17.04 and it was always the same issue.
I would have just started from fresh if I could but as nextcloud is storing files in some specific ways (creating files like “urn:oid:48802”) I sadly cannot get my files back…
I’m still conversion with my object storage provider to see if he has any backup but i’m not optimist…
My config.php but not sure it helps:
Also, encrytion is disabled.
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'instanceid' => 'xxx',
'passwordsalt' => 'xxxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => 'nextcloud.media.imperium-gaming.fr',
),
'dbtype' => 'mysql',
'version' => '17.0.4.2',
'overwrite.cli.url' => 'https://nextcloud.media.imperium-gaming.fr',
'installed' => true,
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'nextcloud.media',
'mail_domain' => 'mydomain',
'mail_smtphost' => 'my-smtp',
'mail_smtpport' => '587',
'app_install_overwrite' =>
array (
0 => 'impersonate',
),
'mysql.utf8mb4' => true,
'dbname' => 'nextcloud',
'dbhost' => 'mariadb',
'dbuser' => 'nextcloud',
'dbpassword' => 'xxxx',
'datadirectory' => '/data',
'objectstore' =>
array (
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' =>
array (
'bucket' => 'xxxx',
'autocreate' => true,
'key' => 'xxxx',
'secret' => 'xxxx',
'hostname' => 's3.nl-ams.scw.cloud',
'port' => 443,
'use_ssl' => true,
'region' => 'nl-ams',
),
),
);
Any one with the ability to help will be appreciated.