Nextcloud blocked for files with size 0

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

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 (eg, 20.0.5): 26.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38
PHP version (eg, 7.4): 8.0
The issue you are facing:

the two nextcloud instances on the server crash in the moment that a folder was opened that contained a file with size 0.
The file has been deleted, including from the recycle bin, but the problem persists.
The apache service remains active but connecting to the web page also results in a timeout on the other unaffected instance.
The only solution is to perform a server restart.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Open the folder where the file was located

The output of your Nextcloud log in Admin > Logging:

[onlyoffice] Errore: Exception: Si è verificato un errore nel servizio documenti: Error while downloading the document file to be converted. at <<closure>>

 0. /var/www/html/n1/apps/onlyoffice/lib/documentservice.php line 95
    OCA\Onlyoffice\DocumentService->ProcessConvServResponceError()
 1. /var/www/html/n1/apps/onlyoffice/lib/preview.php line 269
    OCA\Onlyoffice\DocumentService->GetConvertedUri()
 2. /var/www/html/n1/lib/private/Preview/ProviderV1Adapter.php line 53
    OCA\Onlyoffice\Preview->getThumbnail()
 3. /var/www/html/n1/lib/private/Preview/GeneratorHelper.php line 64
    OC\Preview\ProviderV1Adapter->getThumbnail()
 4. /var/www/html/n1/lib/private/Preview/Generator.php line 440
    OC\Preview\GeneratorHelper->getThumbnail()
 5. /var/www/html/n1/lib/private/Preview/Generator.php line 164
    OC\Preview\Generator->getMaxPreview()
 6. /var/www/html/n1/lib/private/Preview/Generator.php line 116
    OC\Preview\Generator->generatePreviews()
 7. /var/www/html/n1/lib/private/PreviewManager.php line 192
    OC\Preview\Generator->getPreview()
 8. /var/www/html/n1/core/Controller/PreviewController.php line 144
    OC\PreviewManager->getPreview()
 9. /var/www/html/n1/core/Controller/PreviewController.php line 113
    OC\Core\Controller\PreviewController->fetchPreview()
10. /var/www/html/n1/lib/private/AppFramework/Http/Dispatcher.php line 230
    OC\Core\Controller\PreviewController->getPreviewByFileId()
11. /var/www/html/n1/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
12. /var/www/html/n1/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
13. /var/www/html/n1/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
14. /var/www/html/n1/lib/base.php line 1058
    OC\Route\Router->match()
15. /var/www/html/n1/index.php line 36
    OC::handleRequest()

GET /core/preview?fileId=745139&c=26b1b225af5806d8712dc32dd02cd4df&x=250&y=250&forceIcon=0&a=1
from 192.168.4.123 by **** at 2023-06-19T16:20:03+02:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '*****',
  'passwordsalt' => '****',
  'secret' => '****',
  'trusted_domains' =>
  array (
    0 => '****',
    1 => '****',
  ),
  'datadirectory' => '/CLOUDDATA/nc1_data',
  'dbtype' => 'mysql',
  'version' => '26.0.2.1',
  'overwrite.cli.url' => 'https://*****',
  'dbname' => '*****',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '****',
  'dbpassword' => '****',
  'installed' => true,
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'logfile' => '/CLOUDDATA/nc1_data/nextcloud.log',
  'loglevel' => 2,
  'logtimezone' => 'Europe/Rome',
  'default_phone_region' => 'IT',
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'quota_include_external_storage' => false,
  'share_folder' => '/Shares',
  'skeletondirectory' => '',
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'updater.release.channel' => 'stable',
  'lost_password_link' => 'disabled',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'n1',
  'mail_domain' => '****',
  'mail_smtphost' => '****',
  'mail_smtpport' => '25',
  'mail_smtpauthtype' => 'LOGIN',
  'simpleSignUpLink.shown' => false,
  'mysql.utf8mb4' => true,
  'app_install_overwrite' =>
  array (
    0 => 'w2g2',
    1 => 'occweb',
    2 => 'twofactor_rcdevsopenotp',
    3 => 'passwords',
    4 => 'terms_of_service',
    5 => 'ransomware_detection',
  ),
  'allow_local_remote_servers' => true,
);

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

no log

no log


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"Kcm5uOIZqcmQMRsy65Ji","level":3,"time":"2023-06-19T13:26:12+02:00","remoteAddr":"93.148.121.195","user":"cdabbicco","app":"onlyoffice","method":"GET","url":"/index.php/core/preview.png?file=File%20Privati/DIPLOMA/Iscrizione/Dichiarazione_Sostitutiva_Ammissione_Firmata.pdf&x=1024&y=1024&a=1&mode=cover","message":"GetConvertedUri: from pdf to jpeg","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/4.8.3","version":"26.0.2.1","exception":{"Exception":"Exception","Message":"Si \u00e8 verificato un errore nel servizio documenti: Error while downloading the document file to be converted.","Code":0,"Trace":[{"file":"/var/www/html/n1/apps/onlyoffice/lib/documentservice.php","line":95,"function":"ProcessConvServResponceError","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/html/n1/apps/onlyoffice/lib/preview.php","line":269,"function":"GetConvertedUri","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/html/n1/lib/private/Preview/ProviderV1Adapter.php","line":53,"function":"getThumbnail","class":"OCA\\Onlyoffice\\Preview","type":"->"},{"file":"/var/www/html/n1/lib/private/Preview/GeneratorHelper.php","line":64,"function":"getThumbnail","class":"OC\\Preview\\ProviderV1Adapter","type":"->"},{"file":"/var/www/html/n1/lib/private/Preview/Generator.php","line":440,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->"},{"file":"/var/www/html/n1/lib/private/Preview/Generator.php","line":164,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/html/n1/lib/private/Preview/Generator.php","line":116,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/html/n1/lib/private/PreviewManager.php","line":192,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/html/n1/core/Controller/PreviewController.php","line":144,"function":"getPreview","class":"OC\\PreviewManager","type":"->"},{"file":"/var/www/html/n1/core/Controller/PreviewController.php","line":84,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/html/n1/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/html/n1/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/n1/lib/base.php","line":1058,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/n1/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/n1/apps/onlyoffice/lib/documentservice.php","Line":241,"message":"GetConvertedUri: from pdf to jpeg","CustomMessage":"GetConvertedUri: from pdf to jpeg"}}
{"reqId":"RFN97zgqBOTXzmanNf7i","level":3,"time":"2023-06-19T13:43:22+02:00","remoteAddr":"192.168.70.10","user":"cdabbicco","app":"drawio","method":"DELETE","url":"/remote.php/dav/files/cdabbicco/File%20Privati/DIPLOMA/Iscrizione/Pagamento_erariale.pdf","message":"Can't delete preview for file: /cdabbicco/files/File Privati/DIPLOMA/Iscrizione/Pagamento_erariale.pdf","userAgent":"Mozilla/5.0 (Windows) mirall/3.9.0stable-Win64 (build 20230613) (Nextcloud, windows-10.0.22631 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.2.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/appdata_ocmnlilh543k/drawio/previews","Code":0,"Trace":[{"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/html/n1/lib/private/Files/Node/LazyFolder.php","line":72,"function":"call_user_func_array"},{"file":"/var/www/html/n1/lib/private/Files/Node/LazyFolder.php","line":149,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/html/n1/lib/private/Files/AppData/AppData.php","line":132,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/html/n1/apps/drawio/lib/Listeners/FileDeleteListener.php","line":39,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/var/www/html/n1/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\\Drawio\\Listeners\\FileDeleteListener","type":"->"},{"file":"/var/www/html/n1/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/var/www/html/n1/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/EventDispatcher/EventDispatcher.php","line":87,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/EventDispatcher/EventDispatcher.php","line":99,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/Files/Node/HookConnector.php","line":159,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/n1/lib/private/legacy/OC_Hook.php","line":105,"function":"postDelete","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/var/www/html/n1/lib/private/Files/View.php","line":1295,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/html/n1/lib/private/Files/View.php","line":1223,"function":"runHooks","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/n1/lib/private/Files/View.php","line":729,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/n1/apps/dav/lib/Connector/Sabre/File.php","line":536,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/n1/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/n1/apps/dav/lib/Server.php","line":366,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/n1/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/n1/remote.php","line":172,"args":["/var/www/html/n1/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/n1/lib/private/Files/Node/Root.php","Line":209,"message":"Can't delete preview for file: /cdabbicco/files/File Privati/DIPLOMA/Iscrizione/Pagamento_erariale.pdf","CustomMessage":"Can't delete preview for file: /cdabbicco/files/File Privati/DIPLOMA/Iscrizione/Pagamento_erariale.pdf"}}

Thank you

No real idea. But maybe you can re-scan the files for your Nextcloud database. First check that there is really not the file in the filesystem.

sudo -u www-data php occ files:scan --all
documentation

Hello,
I have already given these commands with no results:

su - www-data -s /bin/bash -c ‘php /var/www/html/n1/occ files:scan --all’
su - www-data -s /bin/bash -c ‘php8.0 /var/www/html/n1/occ files:cleanup’
su - www-data -s /bin/bash -c ‘php8.0 /var/www/html/n1/occ files:scan-app-data’

Thank you

We have removed the preview generation and now work good. I think there is a file that causes nextcloud to crash when the preview is generated.

The crash is really brutal, no need to restart apache. You need to restart the entire server.
it also occurs when the folder is accessed via the web.