SMB v2 and v3 Not Working Centos7

Nextcloud version (eg, 10.0.2): 12.0.2
Operating system and version (eg, Ubuntu 16.04): CentOS7
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.6-45
PHP version (eg, 5.6): 7.1
Is this the first time you’ve seen this error?: Yes
Can you reliably replicate it? (If so, please outline steps): Yes

Hi,

I’ve hit a brick wall when trying to access file shares on our Windows Server 2012 R2 host using SMBv2. Using Wireshark on the windows host i can see the SMB request authenticate successfully but then fail with some unhelpful error messages:

Has anyone else experience problems connecting to windows shares when running Nextcloud on CentOS7 with PHP7.1? Not sure what else to try and would really appreciate some help.

FYI there is nothing that indicates an error in the Nextcloud logs.

Thanks,
Tom

1 Like

To rule out an issue with CentOS 7 and PHP7 i created a new instance running on Ubuntu 16.04 however this had exactly the same problem. I also decided to create a brand new share on our Windows 2012R2 host. The new share got me a step further however the SMB share does not list any contents in Nextcloud, the following error is recorded in the event log:

Error: Wrong parameters for Icewind\SMB\Exception\Exception([string $message [, long $code [, Throwable $previous = NULL]]])
/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php - line 17: Exception->__construct(‘Unknown error (…’, ‘NT_STATUS_INVAL…’)
/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php - line 35: Icewind\SMB\Exception\Exception unknown(’/New text file…’, ‘NT_STATUS_INVAL…’)
/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Parser.php - line 72: Icewind\SMB\Exception\Exception fromMap(Array, ‘NT_STATUS_INVAL…’, ‘/New text file…’)
/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Share.php - line 392: Icewind\SMB\Parser->checkForError(Array, ‘/New text file…’)
/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Share.php - line 147: Icewind\SMB\Share->parseOutput(Array, ‘/New text file…’)
/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 134: Icewind\SMB\Share->stat(’/New text file…’)
/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 441: OCA\Files_External\Lib\Storage\SMB->getFileInfo(’/New text file…’)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 220: OCA\Files_External\Lib\Storage\SMB->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 220: OC\Files\Storage\Wrapper\Wrapper->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 241: OC\Files\Storage\Wrapper\Wrapper->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 220: OC\Files\Storage\Wrapper\Availability->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 220: OC\Files\Storage\Wrapper\Wrapper->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/View.php - line 1310: OC\Files\Storage\Wrapper\Wrapper->file_exists(‘New text file.t…’)
/var/www/html/nextcloud/lib/private/Files/View.php - line 1356: OC\Files\View->getCacheEntry(Object(OCA\Files_Trashbin\Storage), ‘New text file.t…’, ‘SMB1/New text f…’)
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/ObjectTree.php - line 160: OC\Files\View->getFileInfo(’/1513FA86-BFF6-…’)
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/LockPlugin.php - line 59: OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath(‘SMB1/New text f…’)
[internal function] OCA\DAV\Connector\Sabre\LockPlugin->getLock(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466: Sabre\Event\EventEmitter->emit(‘beforeMethod’, Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/apps/dav/appinfo/v1/webdav.php - line 71: Sabre\DAV\Server->exec()
/var/www/html/nextcloud/remote.php - line 162: require_once(’/var/www/html/n…’)
{main}

@icewind @nickvergessen @MorrisJobke

Is anyone able to offer any assistance with this issue?

I’ve narrowed the problem down to SMB2 and SMB3 support. When i connect using SMB1 the folder mounts OK and i can add files and folders.

In production we cannot use SMB1 so i disable this on the file server and update the smb.conf file with the following options in the global config section:

client min protocol = SMB2
client max protocol = SMB3

Access to the SMB share is then no longer accessible in Nextcloud and the following error is logged:

Error: Wrong parameters for Icewind\SMB\Exception\Exception([string $message [, long $code [, Throwable $previous = NULL]]])

I have the following smb client packages installed:

Installed Packages
libsmbclient.x86_64 4.4.4-14.el7_3 @updates
php71-php-smbclient.x86_64 0.9.0-1.el7.remi @remi-safe

For those that are also having issues similar to this i cannot get SMBv2 working with the latest edition of CentOS:

Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-514.el7.x86_64
Architecture: x86-64

I’m not an expert but i believe the issue relates to one of these packages:

php-icewind-smb
libarchive
php-fedora-autoloader
php-icewind-streams
samba-client

The only path moving forward was to switch to Ubuntu server for Nextcloud as that seems to work providing all the smb modules are installed before configruating Nextcloud.

Cheers,
Tom

I’m running into the same issue. Have three centos7 Nextcloud servers on three different networks, but all trying to connect to windows 2016 data servers. Can’t get any SMB 2 or 3 shares to mount.

Also found that when the external storage app has any failed storage addresses in place, ALL files disappear and I’m greeted with “This directory is unavailable, please check the logs or contact the administrator” Even though my local files/data directory is still available.

Not sure if we should file a bug report for either of these issues?

There is already one on Github: