Author Topic: Samba issue  (Read 106 times)

tamuin

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +1/-0
    • View Profile
Samba issue
« on: February 07, 2020, 04:24:55 am »
I am having an issue where part way through the day several users lose their mapped network drives (and their ability to access shared folders using the UNC path).  Windows file explorer will just hang if you try to access a mapped drive and any program will hang if you go to file - open and try to navigate to a mapped drive.

When this happens I can not ping their machines from the server but usually they can still ping the server from their machine.

The users can still access the internet through a browser when this happens, and zentyal is acting as a gateway.

Logging off and back on again typically solves the problem; however, if several users experience the problem at the same time I have to reboot the server to restore access.

I have tried various method of mapping the drives, initially I had been mapping the drives with a group policy then switched to running a local a script file that runs when a user logs on to their workstation.  The script file essentially does this for several shared directories:
Code: [Select]
net use n: /delete
net use n: \\server\share

I suspect this is a samba issue, but I can not find any smoking gun in:
/var/log/syslog
/var/log/samba/*
/var/log/zentyal/*

I do see the following error messages at various times during the day in /var/log/samba/samba.old
Code: [Select]
samba.log.old:  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[5] status[NT_STATUS_INVALID_PARAMETER] || at ../source3/smbd/smb2_ioctl.c:309
samba.log.old:[2020/02/06 16:18:31.443160,  3] ../source3/smbd/smb2_server.c:3139(smbd_smb2_request_error_ex)
samba.log.old:  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[9] status[STATUS_NO_MORE_FILES] || at ../source3/smbd/smb2_query_directory.c:155
samba.log.old:[2020/02/06 16:18:31.443599,  3] ../source3/smbd/smb2_server.c:3139(smbd_smb2_request_error_ex)
samba.log.old:  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_getinfo.c:154
but the time at which these errors occur does not correspond to the time at which the users have the issue.

I just started running running Zentyal 6.1 in a VM under proxmox and everything had been running well for a while (2 weeks) and then this issue cropped up.

One last bit of information, the issue often happens when the users are using Adobe Indesign.

Any thoughts are appreciated.
« Last Edit: February 07, 2020, 04:27:43 am by tamuin »

doncamilo

  • Zen Samurai
  • ****
  • Posts: 331
  • Karma: +68/-1
    • View Profile
Re: Samba issue
« Reply #1 on: February 12, 2020, 11:20:40 pm »
 :)

I like the way you present your case. Thank you. I'm learning simply by reading your post.

Did you check the shares accessibility through the  IP instead of the UNC while the issue self manifests?

I think this issue should be studied from the Windows Client side. Did you check the Microsoft event viewer of these clients?

Paste here the errors, please, I think this is will be interesting for much more people.

cheers!
"That place... is strong with the
dark side of the Force.  A domain
of evil it is.  In you must go."

Yoda.

tamuin

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +1/-0
    • View Profile
Re: Samba issue
« Reply #2 on: February 14, 2020, 02:58:45 am »
> I like the way you present your case. Thank you. I'm learning simply by reading your post.
Thanks!

I think I was experiencing two issues (maybe more).  First, I believe some connections were being dropped because of inactivity as described here:
https://support.microsoft.com/en-us/help/297684/mapped-drive-connection-to-network-share-may-be-lost

I believe I have addressed this issue by running the following command on each workstation:
Code: [Select]
net config server /autodisconnect:-1
Second, I believe that there is an oplocks issue with Abobe Creative Suite programs (especially InDesign).  I found that if I released all of the locks for the affected user(s) (i.e. kill the pid of the smbd process for the affected user, this can be found using smbstatus) that seemed to resolve the issue.

I have added kernel oplocks = yes to smb.conf (/usr/share/zentyal/stubs/samba/smb.conf.mas).  If the problem reappears I will turn off oplocks entirely, if that doesn't work I revert to trying random solutions I find on the internet. (tried this, but it seemed to cause issues for Autodesk users).

As I mentioned, I am running Zentyal on a VM under proxmox.  The shares are actually on the host machine (proxmox) and shared with the Zentyal VM using the 9P filesystem.  This seems to be a pretty slick method and the performance is quite good.  If anyone is interested in this some information can be found here:https://forum.proxmox.com/threads/virtfs-virtio-9p-plans-to-incorporate.35315/#post-184993

> I think this issue should be studied from the Windows Client side. Did you check the Microsoft event viewer of these clients?
Good suggestion, I should have done this, I got focused on the server side logs.  I will take a look.  I also should crank up the logging level on the server.

>Did you check the shares accessibility through the  IP instead of the UNC while the issue self manifests?
The affected workstations could not access the shares suing the mapped drive letter OR the UNC path OR the IP (we tried them all).

As an aside, I had a weird issue that I believe is unrelated to my other issues.  When things were working fine, I could get to the shares just fine by typing the UNC path into the windows file explorer address bar, but when I typed the IP address (\\10.10.10.1\SharedDirectoryName).  It would either take a long time to load the directory or give me an error saying that it was not available.  The firewall logs showed dropped packets from those clients on port 111, so I opened up port 111 on "Filtering rules from internal networks to Zentyal" and the issue went away.  Is this some new windows 'feature' or 'security measure' or do I possible have something setup wrong?

« Last Edit: February 14, 2020, 04:55:59 pm by tamuin »