External Storage not syncing correctly

Dear community,
some weeks ago I installed NC 26.0.1. Since then I facing various Issues. The biggest “pain in the ass” is: external storages are not synchronized correctly. NC synchronises randomly some files and some not. Nor the cloud itself nor the clients (for Windows + Android) show the complete content of the connected folders. The storage is connected via SMB/CIFS. It all worked fine with NC 24.

Any idea how to fix the issue?

Best Joon

Details:

Nextcloud version: 26.0.1
Operating system and version : 22.04 LTS
nginx version: 1.18.0
PHP version: 8.2.7
mariaDB Version: 10.6.12
smbd Version: 4.15.13
External Storage support Version: 1.18.0

The issue you are facing:

Is this the first time you’ve seen this error? Yes:

Steps to replicate it: The Issue is random, sometimes content is shown, sometimes not. After one failed trail of syncing the content is never shown anymore - it´s not deleted, but noted as 0B content.

The output of your Nextcloud log in Admin > Logging:

[PHP] Fehler: Undefined array key "attributes" at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php#155

and:

[webdav] Fehler: Icewind\SMB\Exception\Exception: Malformed state response from server at <<closure>>

 0. /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php line 217
    Icewind\SMB\Wrapped\Parser->parseStat()
 1. /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php line 191
    Icewind\SMB\Wrapped\Share->stat()
 2. /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php line 666
    OCA\Files_External\Lib\Storage\SMB->getFileInfo()
 3. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
    OCA\Files_External\Lib\Storage\SMB->file_exists()
 4. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
    OC\Files\Storage\Wrapper\Wrapper->file_exists()
 5. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php line 244
    OC\Files\Storage\Wrapper\Wrapper->file_exists()
 6. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
    OC\Files\Storage\Wrapper\Availability->file_exists()
 7. /var/www/nextcloud/lib/private/Files/View.php line 1350
    OC\Files\Storage\Wrapper\Wrapper->file_exists()
 8. /var/www/nextcloud/lib/private/Files/View.php line 1394
    OC\Files\View->getCacheEntry()
 9. /var/www/nextcloud/lib/private/Files/Node/Root.php line 205
    OC\Files\View->getFileInfo()
10. /var/www/nextcloud/lib/private/Files/Node/Folder.php line 139
    OC\Files\Node\Root->get()
11. /var/www/nextcloud/lib/private/Files/Node/Folder.php line 148
    OC\Files\Node\Folder->get()
12. /var/www/nextcloud/apps/text/lib/Service/WorkspaceService.php line 26
    OC\Files\Node\Folder->nodeExists()
13. /var/www/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php line 110
    OCA\Text\Service\WorkspaceService->getFile()
14. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    OCA\Text\DAV\WorkspacePlugin->propFind()
15. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1052
    Sabre\DAV\Server->emit()
16. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 984
    Sabre\DAV\Server->getPropertiesByNode()
17. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1662
    Sabre\DAV\Server->getPropertiesIteratorForPath()
18. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1647
    Sabre\DAV\Server->writeMultiStatus()
19. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 346
    Sabre\DAV\Server->generateMultiStatus()
20. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPropFind()
21. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
22. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
23. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
24. /var/www/nextcloud/apps/dav/lib/Server.php line 366
    Sabre\DAV\Server->exec()
25. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
26. /var/www/nextcloud/remote.php line 172
    require_once("/var/www/nextcl ... p")

For your first issue, are you adding files to the External Mount outside of NC?

For the second issue, that looks like a bug. It may be worth reporting:

However troubleshooting SMB issues is challenging because there are a lot of dependencies.

It looks like you’re using the smbclient binary rather than the recommended libsmbclient-php. That isn’t necessarily the source of your issues though - and it should work with either way. The main downside to the binary is lower performance.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/smb.html

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html#adding-files-to-external-storages

HI jtr,
thanks for the tipp. The first link resolved the problem. I installed the libsmbclient-php with:
apt-get install php-smbclient
and removed the other smbclient completely with:
apt-get purge --auto-remove smbclient
rebooted and now all works fine
Thanks!!!

Best Joon