Cannot access NAS via SMB

Windows Access Rights Management
Mousetick
Experience counts
Posts: 1081
Joined: Thu Aug 24, 2017 10:28 pm

Re: Cannot access NAS via SMB

Post by Mousetick »

Lurick wrote: Mon Jul 05, 2021 7:30 pm I think I finally figured it out and hope this might help others.
There are two smb.conf files in QNAP:
/etc/smb.conf
/mnt/HDA_ROOT/.config/smb.conf
These strange issues may indeed be caused by smb.conf busted by the firmware update, but on a normal healthy NAS these two files should actually be one and the same.

/etc/smb.conf is a symbolic link to /etc/config/smb.conf
/etc/config is a symbolic link to /mnt/HDA_ROOT/.config

As demonstrated on my NAS:

Code: Select all

$ ls -l /etc/smb.conf
lrwxrwxrwx 1 admin administrators 15 Jul  5 13:14 /etc/smb.conf -> config/smb.conf
$ ls -l /etc/config
lrwxrwxrwx 1 admin administrators 21 Jul  5 11:16 /etc/config -> /mnt/HDA_ROOT/.config
$ cmp /etc/smb.conf /mnt/HDA_ROOT/.config/smb.conf
# cp /mnt/HDA_ROOT/.config/smb.conf /etc/smb.conf
cp: `/mnt/HDA_ROOT/.config/smb.conf' and `/etc/smb.conf' are the same file
The contents of /etc are reset at startup. What happens if you reboot the NAS? Does SMB still work or is it busted again?
If it's busted again, take a closer look at /etc/smb.conf: is it a symbolic link? If yes, to what? If not, what are its contents?
Lurick
New here
Posts: 4
Joined: Sun Jun 25, 2017 8:53 pm

Re: Cannot access NAS via SMB

Post by Lurick »

Mousetick wrote: Mon Jul 05, 2021 7:53 pm
Lurick wrote: Mon Jul 05, 2021 7:30 pm I think I finally figured it out and hope this might help others.
There are two smb.conf files in QNAP:
/etc/smb.conf
/mnt/HDA_ROOT/.config/smb.conf
These strange issues may indeed be caused by smb.conf busted by the firmware update, but on a normal healthy NAS these two files should actually be one and the same.

/etc/smb.conf is a symbolic link to /etc/config/smb.conf
/etc/config is a symbolic link to /mnt/HDA_ROOT/.config

As demonstrated on my NAS:

Code: Select all

$ ls -l /etc/smb.conf
lrwxrwxrwx 1 admin administrators 15 Jul  5 13:14 /etc/smb.conf -> config/smb.conf
$ ls -l /etc/config
lrwxrwxrwx 1 admin administrators 21 Jul  5 11:16 /etc/config -> /mnt/HDA_ROOT/.config
$ cmp /etc/smb.conf /mnt/HDA_ROOT/.config/smb.conf
# cp /mnt/HDA_ROOT/.config/smb.conf /etc/smb.conf
cp: `/mnt/HDA_ROOT/.config/smb.conf' and `/etc/smb.conf' are the same file
The contents of /etc are reset at startup. What happens if you reboot the NAS? Does SMB still work or is it busted again?
If it's busted again, take a closer look at /etc/smb.conf: is it a symbolic link? If yes, to what? If not, what are its contents?
So it looks like the symlink was busted when I checked so that's good to know. After some fiddling around with that I found that one of the shares for some reason was causing an issue. I removed it from the smb.conf file and now IP and DNS/etc. work as expected. I'll dig a little deeper into why one share would cause some issues but now everything is working after a reboot too!
asbath
Starting out
Posts: 13
Joined: Thu May 28, 2020 3:37 am

Re: Cannot access NAS via SMB

Post by asbath »

Lurick wrote: Mon Jul 05, 2021 9:56 pm
Mousetick wrote: Mon Jul 05, 2021 7:53 pm
Lurick wrote: Mon Jul 05, 2021 7:30 pm I think I finally figured it out and hope this might help others.
There are two smb.conf files in QNAP:
/etc/smb.conf
/mnt/HDA_ROOT/.config/smb.conf
These strange issues may indeed be caused by smb.conf busted by the firmware update, but on a normal healthy NAS these two files should actually be one and the same.

/etc/smb.conf is a symbolic link to /etc/config/smb.conf
/etc/config is a symbolic link to /mnt/HDA_ROOT/.config

As demonstrated on my NAS:

Code: Select all

$ ls -l /etc/smb.conf
lrwxrwxrwx 1 admin administrators 15 Jul  5 13:14 /etc/smb.conf -> config/smb.conf
$ ls -l /etc/config
lrwxrwxrwx 1 admin administrators 21 Jul  5 11:16 /etc/config -> /mnt/HDA_ROOT/.config
$ cmp /etc/smb.conf /mnt/HDA_ROOT/.config/smb.conf
# cp /mnt/HDA_ROOT/.config/smb.conf /etc/smb.conf
cp: `/mnt/HDA_ROOT/.config/smb.conf' and `/etc/smb.conf' are the same file
The contents of /etc are reset at startup. What happens if you reboot the NAS? Does SMB still work or is it busted again?
If it's busted again, take a closer look at /etc/smb.conf: is it a symbolic link? If yes, to what? If not, what are its contents?
So it looks like the symlink was busted when I checked so that's good to know. After some fiddling around with that I found that one of the shares for some reason was causing an issue. I removed it from the smb.conf file and now IP and DNS/etc. work as expected. I'll dig a little deeper into why one share would cause some issues but now everything is working after a reboot too!
I get the same results as Mousetick when I check my smb.conf files. Symlink is good, and the contents are the same.
torch1 wrote: Sun Jul 04, 2021 8:26 am As far as I know, 0x02ff is not a legitimate SMB dialect...https://docs.microsoft.com/en-us/opensp ... 3944f52fc5 - scroll down to Dialects at the bottom.
Is this Dialect response from the IP of your QNAP NAS? I don't know what this could be, but if your NAS does not return a dialect that is in the Request from your client, they cannot communicate.
I would check the MS Networking settings on your NAS.
I also recommend giving your LAN a domain name. When you use just a hostname without the .domain portion ("\\NAS\" instead of "\\NAS.lan\"), I don't know if your Windows pc correctly queries your router for the IP of the NAS on your LAN. Windows does not use Bonjour, so I don't know if their service discovery finds the QNAP smb service. (i.e. for the _smb._tcp service) You should check this with Wireshark when you first connect to your LAN and try to connect to the QNAP NAS using just \\NAS\.
Exactly, 0x02ff isn't a valid dialect, so my NAS's SMB must be "broken" in some way. The Dialect response is from the IP of the NAS, exactly. This is why I've been saying earlier that it's almost like SMB itself is broken. I've reset my NAS twice now (3-second and 10-second hold down) and neither reset helped fix the SMB issue. I had to set up brand new shares all over again, and user accounts, and still the NAS can't communicate with these clients.

As mentioned before, I have no problems accessing it over NFS and AFP, or SSH or ping. It's purely the SMB service that seems to be broken on the NAS, other services seem just fine, as well as other network access.
torch1
Know my way around
Posts: 137
Joined: Thu Jul 04, 2019 4:53 am

Re: Cannot access NAS via SMB

Post by torch1 »

Apparently 0x02ff is a valid response even though it is not a valid dialect
https://docs.microsoft.com/en-us/opensp ... fa552949a5 (scroll down to DialectRevision)
0x02FF: SMB2 wildcard revision number; indicates that the server implements SMB 2.1 or future dialect revisions and expects the client to send a subsequent SMB2 Negotiate request to negotiate the actual SMB 2 Protocol revision to be used. The wildcard revision number is sent only in response to a multi-protocol negotiate request with the "SMB 2.???" dialect string.<23>
Did your laptop/pc send a "SMB2.???" in its Negotiate Protocol Request instead of a list of dialects (0x0202, etc)? Apparently that is what the server (NAS) thinks...
asbath
Starting out
Posts: 13
Joined: Thu May 28, 2020 3:37 am

Re: Cannot access NAS via SMB

Post by asbath »

Aha! Yes, my laptop and desktop both sent over 3 (identical) Requested dialects when sending a protocol = SMB request:
-NT LM 0.12
-SMB 2.002
-SMB 2.???

So it appears that the 0x02ff response is warranted, given that the NAS received that request multiple times from multiple clients. But when sending a protocol = SMB2 request, it sends over 5 dialects, all as we listed above

I ran wireshark on a couple of machines - one laptop that doesn't connect, and one desktop that does connect, and both the Requests are the same. So the Requested dialects didn't change. Weird.

I've also updated the OP to mention that I can also "connect" to the NAS via the DLNA service through the Multimedia Console and the Media Streaming Add-On app. I didn't use them before, but I installed/enabled them just now to see they are also impacted. Looks like not.
torch1
Know my way around
Posts: 137
Joined: Thu Jul 04, 2019 4:53 am

Re: Cannot access NAS via SMB

Post by torch1 »

Suggest you disable SMB1 (NT LM 0.12) and enable SMB3 (highest SMB version) on the QNAP NAS. On your clients there should be a way to disable signing (on Macs you configure it a /etc/nsmb.conf file).
torch1
Know my way around
Posts: 137
Joined: Thu Jul 04, 2019 4:53 am

Re: Cannot access NAS via SMB

Post by torch1 »

asbath
Starting out
Posts: 13
Joined: Thu May 28, 2020 3:37 am

Re: Cannot access NAS via SMB

Post by asbath »

torch1 wrote: Fri Jul 09, 2021 11:21 am Suggest you disable SMB1 (NT LM 0.12) and enable SMB3 (highest SMB version) on the QNAP NAS. On your clients there should be a way to disable signing (on Macs you configure it a /etc/nsmb.conf file).
Yup, I've already disabled SMB1, by setting the lowest SMB to SMB v2.0
torch1
Know my way around
Posts: 137
Joined: Thu Jul 04, 2019 4:53 am

Re: Cannot access NAS via SMB

Post by torch1 »

Apparently your Windows clients still want to use SMB1 (NT LM 0.12) and don't offer anything other than "SMB 2.002" (dialect is actually 2.02). Why don't they offer any of the SMB3 dialects? Are they old versions of Windows? Have you tried disabling SMB1 on the Windows side?
asbath
Starting out
Posts: 13
Joined: Thu May 28, 2020 3:37 am

Re: Cannot access NAS via SMB

Post by asbath »

Nope, the oldest version of Windows 10 that I test is build 2004, which I recently updated to 20H2. The newest Windows 10 build is the latest 21H2.

I've disabled SMB1 by ensuring that the "SMB/CIFS" option is disable in the Add/Remove Windows features, and also used the Powershell commands to disable it manually. Redundant steps, but can never be too certain.

HOWEVER (!!!11!1!1oneONE!), possibly incident resolved. Still patiently waiting to see if it stays. It should stick this time, but we'll see. Basically the steps are (1) disable SMB, (2) remove old SMB config, (3) replace SMB config with system default, (4) startup SMB

Code: Select all

/etc/init.d/smb.sh stop
cp /etc/config/smb.conf /etc/config/smb.conf_backup
cp /etc/default_config/smb.conf /etc/config/smb.conf
/etc/init.d/smb.sh start
This wiped all my shares (perfectly fine by me), and I was able to set up new shares and they've been working ever since. Also, just to make sure that the SMB config doesn't have anything remotely close to the original paths, I renamed the source directories at /share/CACHEDEV1_DATA/<dir> and used new share paths. This way all the paths for these temporary shares are completely different from the old SMB. Necessary? Nope. Paranoid? Yup. But hey, doesn't hurt, right?

Keeping my fingers and toes crossed. Props to QNAP's support staff for helping me with reinitializing the SMB config this way.
User avatar
Sangie
Starting out
Posts: 12
Joined: Sun Jun 21, 2020 7:23 am

Re: Cannot access NAS via SMB

Post by Sangie »

So I can connect to my QNAP and Windows 10 sees it in browse, but ever since reinstalling Windows 10, it keeps prompting me for my credentials over and over. I can SSH to my qnap from the same machine without issue so my credentials are right. What is weird is it asks for an email and password or a PIN.

I do not have SMB1 enabled on Windows 10 and the lowest version of SMB on QNAP is set to 2 and the highest is 3. I am using a TS-673 with QTS 4.5.4.1741.

My Windows account is an Office 365 Business account. I wouldn't think that would matter.
User avatar
Sangie
Starting out
Posts: 12
Joined: Sun Jun 21, 2020 7:23 am

Re: Cannot access NAS via SMB

Post by Sangie »

I found the fix! It's dumb. You put in WORKGROUP\Username and the password. It worked just fine and I didn't have to revert to SMB 1.0.
User avatar
cynik606
New here
Posts: 7
Joined: Tue Aug 24, 2021 3:35 pm

Re: Cannot access NAS via SMB

Post by cynik606 »

Hi guys,
Suddenly I have this "obvious" error message on all Windows 10 clients (21H2):
"Device attached to the system is not functioning"
Other services work fine (surveillance, sftp, ssh).
Any suggestions?
Thanks
Ricardopaiva
Starting out
Posts: 16
Joined: Sat Jun 17, 2017 7:03 pm

Re: Cannot access NAS via SMB

Post by Ricardopaiva »

I was having some issues connecting a Windows machine to NAS using Samba and this article helped fixing the issue.
https://www.qnap.com/en/how-to/faq/arti ... ws-via-smb
Basically the problem is related to the user that Windows uses by default to initialise the connection.
User avatar
cynik606
New here
Posts: 7
Joined: Tue Aug 24, 2021 3:35 pm

Re: Cannot access NAS via SMB

Post by cynik606 »

In my case the problem was resolved by support guy. He told me that there were some "temporal locks on samba".
Post Reply

Return to “Windows”