Can't download anything from SMB share

[/details]

Nextcloud version (eg, 20.0.5): 20.0.1
Operating system and version (eg, Ubuntu 20.04): Windows Server 2019 build 1809
Apache or nginx version (eg, Apache 2.4.25): Linuxserver docker
PHP version (eg, 7.4): 7.4 I believe

The issue you are facing:
Cant download anything from my SMB share attached to my nextcloud. I can view everything and upload just not download.

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

Steps to replicate it:

  1. Attempt to download anything
  2. Receive an error message saying “couldn’t download file”

The output of your Nextcloud log in Admin > Logging:

Error: fread(): Icewind\SMB\Native\NativeReadStream::stream_read - read 87615 bytes more data than requested (95807 read, 8192 max) - excess data will be lost at /config/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php#55

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /config/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php - line 55:

    fread()

    /config/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php - line 96:

    Icewind\Streams\Wrapper->stream_read()

    <<closure>>

    Icewind\Streams\CallbackWrapper->stream_read()

    /config/www/nextcloud/lib/private/Preview/ProviderV2.php - line 92:

    file_put_contents()

    /config/www/nextcloud/lib/private/Preview/Image.php - line 50:

    OC\Preview\ProviderV2->getLocalFile()

    /config/www/nextcloud/lib/private/Preview/GeneratorHelper.php - line 63:

    OC\Preview\Image->getThumbnail()

    /config/www/nextcloud/lib/private/Preview/Generator.php - line 244:

    OC\Preview\GeneratorHelper->getThumbnail()

    /config/www/nextcloud/lib/private/Preview/Generator.php - line 140:

    OC\Preview\Generator->getMaxPreview()

    /config/www/nextcloud/lib/private/Preview/Generator.php - line 109:

    OC\Preview\Generator->generatePreviews()

    /config/www/nextcloud/lib/private/PreviewManager.php - line 190:

    OC\Preview\Generator->getPreview()

    /config/www/nextcloud/core/Controller/PreviewController.php - line 170:

    OC\PreviewManager->getPreview()

    /config/www/nextcloud/core/Controller/PreviewController.php - line 143:

    OC\Core\Controller\PreviewController->fetchPreview()

    /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 218:

    OC\Core\Controller\PreviewController->getPreviewByFileId()

    /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127:

    OC\AppFramework\Http\Dispatcher->executeController()

    /config/www/nextcloud/lib/private/AppFramework/App.php - line 157:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /config/www/nextcloud/lib/private/Route/Router.php - line 302:

    OC\AppFramework\App::main()

    /config/www/nextcloud/lib/base.php - line 993:

    OC\Route\Router->match()

    /config/www/nextcloud/index.php - line 37:

    OC::handleRequest()

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

Can't find this in docker. 

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

Also can't find this in docker. 

This seems to be an issue with Icewind, we were getting the same issue. Files truncated to 8192b and corrupts all files over this value. It has been reported HERE on GitHub. We replaced the icewind folder with a previous version (from backup) and it all works fine again.

1 Like

I can report same problem with Nextcloud 21.0.1.

I also do get the same error in log:
Error: fread(): Icewind\SMB\Native\NativeReadStream::stream_read - read 516096 bytes more data than requested (524288 read, 8192 max)

Nextcloud 21.0.1

Hi, please see Files on SMB-share corrupted while up- and downloading · Issue #26457 · nextcloud/server · GitHub

1 Like