# SMB v2 and v3 Not Working Centos7

**URL:** <https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007>\
**Category:** ℹ️ Support\
**Tags:** external\_storage\
**Created:** [August 23, 2017, 2:08pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007 "2017-08-23T14:08:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Hiscocks](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tom_hiscocks/32/5419_2.png) [@Tom\_Hiscocks](https://help.nextcloud.com/u/Tom_Hiscocks)\
**Post date:** [August 23, 2017, 2:08pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/1 "2017-08-23T14:08:01Z")

</div>

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:

 ![error](https://help.nextcloud.com/uploads/default/original/2X/5/54e66a0eaf4efcad78759978bff2e9998f93f789.PNG)

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

---

<div class="post-metadata">

**Author:** ![Tom\_Hiscocks](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tom_hiscocks/32/5419_2.png) [@Tom\_Hiscocks](https://help.nextcloud.com/u/Tom_Hiscocks)\
**Post date:** [August 24, 2017, 10:12am UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/2 "2017-08-24T10:12:16Z")

</div>

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}

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [August 24, 2017, 10:37am UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/3 "2017-08-24T10:37:54Z")

</div>

@icewind @nickvergessen @MorrisJobke

---

<div class="post-metadata">

**Author:** ![Tom\_Hiscocks](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tom_hiscocks/32/5419_2.png) [@Tom\_Hiscocks](https://help.nextcloud.com/u/Tom_Hiscocks)\
**Post date:** [September 12, 2017, 1:39pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/4 "2017-09-12T13:39:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tom\_Hiscocks](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tom_hiscocks/32/5419_2.png) [@Tom\_Hiscocks](https://help.nextcloud.com/u/Tom_Hiscocks)\
**Post date:** [September 13, 2017, 1:06pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/5 "2017-09-13T13:06:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![protocol6v](https://help.nextcloud.com/letter_avatar/protocol6v/32/5_5575768a8748004e209b776fc1b2916d.png) [@protocol6v](https://help.nextcloud.com/u/protocol6v)\
**Post date:** [September 15, 2017, 6:01pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/6 "2017-09-15T18:01:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alfred](https://help.nextcloud.com/letter_avatar/alfred/32/5_5575768a8748004e209b776fc1b2916d.png) [@alfred](https://help.nextcloud.com/u/alfred)\
**Post date:** [September 15, 2017, 7:22pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/7 "2017-09-15T19:22:14Z")

</div>

There is already one on Github:

> <https://github.com/eduardok/libsmbclient-php/issues/53>

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 2, 2024, 2:27pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/8 "2024-12-02T14:27:45Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 1:48pm UTC](https://help.nextcloud.com/t/smb-v2-and-v3-not-working-centos7/20007/9 "2024-12-04T13:48:59Z")

</div>


