[Samba] [smbd] get_static_share_mode_data failed: NT_STATUS_NO_MEMORY

L. van Belle belle at samba.org
Tue Nov 12 14:14:04 UTC 2019


Hai, 

Since this thread stopped.. I'll continue it.. 

Today a user complained about not being able to save an simple excel file.
The existed on here desktop ( which is a redirected folder in the homedir. )
I normally never hear these things, so i did have a look at it. 

I've not seen it in Samba 4.10.10 and lower as far i can tell but i do see
these in the 4.11.2 logs. 
At least its, so far i can see, not consitantly.. 

Memory might be tight for the server. 
free -hm
              total        used        free      shared  buff/cache
available
Mem:          960Mi       277Mi       203Mi       5.0Mi       480Mi
497Mi 

I'll increase this in coming weekend to 2GB, around 50-60 users on this
server. 
This server is running since samba 4.1 upgraded all the way from wheezy to
buster. ( and samba 4.11 )
This server only provides users home and profiles and a software
distrubution share.

Tried to log it with a level 10, but offcourse after a reload/restart of
smbd, 
These messages are not shown again. 

Andrew, anything else i can do to provide some logging for it. 

Some other info.
The rights on the users its "Desktop" folder where this occured.
getfacl /home/users/username/Desktop/

getfacl: Removing leading '/' from absolute path names
# file: home/users/username/Desktop/
# owner: username
# group: domain\040users
user::rwx
user:username:rwx
group::---
group:2005:rwx
group:domain\040users:---
mask::rwx
other::---
default:user::rwx
default:user:username:rwx
default:group::---
default:group:2005:rwx
default:group:domain\040users:---
default:mask::rwx
default:other::---


The running smb.conf, Debian Buster.
cat /etc/samba/smb.conf
## Samba Global config, verified up to 4.11.2 
## verified d.d. 06 Nov 2019

    # loglevels.
    log level = 1 auth_audit:3

    #####
    ## ALL IN CAPS HERE. 
    ## Read: 
    ##
https://social.technet.microsoft.com/wiki/contents/articles/34981.active-dir
ectory-best-practices-for-internal-domain-and-network-names.aspx
    ##
https://support.microsoft.com/nl-nl/help/909264/naming-conventions-in-active
-directory-for-computers-domains-sites-and
    ## Default network/Workgroup/REALM and netbios names. 
    workgroup = NTDOM
    security = ADS
    realm = REALM.DOMAIN.TLD
    netbios name = HOSTNAME
    #####

    ## Set master browser for the network.
    ## preffered + domain master = guarantee master browser ( man smb.conf )
    #preferred master = yes
    #domain master = yes

    ## Set interfaces, use ip's or interface names, I preffer IP.
    interfaces = 192.168.1.1 127.0.0.1
    bind interfaces only = yes
	
    ## Allow netbios names to resolve over DNS.
    dns proxy = yes

    ## Add and Update TLS Key
    tls enabled = yes
    tls keyfile = /etc/ssl/key.pem
    tls certfile = /etc/ssl/cert.pem
    ## Dont forget to publish the CA.pem (+intermediate) to you PC's.
    tls cafile = /etc/ssl/ca.pem

    ## map id's outside to domain to tdb files.
    idmap config * :backend = tdb
    idmap config * :range = 2000-9999

    ## map ids from the domain and (*) the range may not overlap !
    idmap config NTDOM : backend = ad
    idmap config NTDOM : schema_mode = rfc2307
    idmap config NTDOM : range = 10000-3999999

    ## winbind id related settings. 
    idmap config NTDOM : unix_nss_info = yes
    idmap config NTDOM : unix_primary_group = yes

    ## Keytab and kerberos methode. 
    dedicated keytab file = /etc/krb5.keytab
    kerberos method = secrets and keytab

    ## renew the kerberos ticket.
    winbind refresh tickets = yes

    ## Remove NTDOM\ from the username.
    winbind use default domain = yes

    ## Enable while testing with id/getent. ( it slows down your server )
    ## Disable, use getent passwd/group username/group
    winbind enum users  = no
    winbind enum groups = no

    ## Enable offline logins
    winbind offline logon = yes

    ## Check depth of nested groups, ! slows down you samba, if to much
groups depth
    winbind expand groups = 4

    ## User Administrator workaround, without it you are unable to set
privileges
    ## FORMAT NTDOM\Administrator 
    username map = /etc/samba/samba_usermapping

    ## Disable usershares creating, when set empty, no error log messages in
logs.
    usershare path =

    ## Disable printing completely
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes

    ## For Windows ACL support on member file server, enabled globaly,
OBLIGATED
    ## For a mixed setup of rights, put this per share!
    vfs objects = acl_xattr
    map acl inherit = yes
    store dos attributes = yes

    ## Share Setting Globally
    veto files = /.bash_logout/.bash_profile/.bash_history/.bashrc/
    hide unreadable = yes

######## SHARE DEFINITIONS ################
[profiles]
    browseable = yes
    path = /home/samba/profiles
    read only = no
    acl_xattr:ignore system acl = yes

[users]
    browseable = yes
    path = /home/samba/users
    read only = no
    acl_xattr:ignore system acl = yes

[public]
    browseable = yes
    path = /home/samba/public
    read only = no



Greetz, 

Louis



> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> Andrew Bartlett via samba
> Verzonden: zondag 3 november 2019 22:01
> Aan: ????????????; samba at lists.samba.org
> Onderwerp: Re: [Samba] [smbd] get_static_share_mode_data 
> failed: NT_STATUS_NO_MEMORY
> 
> On Sun, 2019-11-03 at 07:16 +0300, ???????????? via samba wrote:
> > Hi all. help please:
> > # systemctl status smbd.service
> > ...
> > Nov 03 06:53:09 server1.local.my smbd[4585]: [2019/11/03 
> > 06:53:09.857837,  1] 
> > ../../source3/locking/share_mode_lock.c:597(get_share_mode_lock)
> > Nov 03 06:53:09 server1.local.my smbd[4585]:   get_share_mode_lock: 
> > get_static_share_mode_data failed: NT_STATUS_NO_MEMORY
> > ...
> > 
> > current version (but w older too)
> > # smbd -V
> > Version 4.11.2
> > 
> > client - macos, (time machine session).
> > where can i add this memory?
> 
> I don't think it is actually memory, but some more logs would 
> help.  If
> talloc actually fails then it would say "talloc failed" in
> fresh_share_mode_lock(). 
> 
> Can you check that for me?
> 
> Assuming it doesn't say that, then the conditions for returning
> N_STATUS_NO_MEMORY from fresh_share_mode_lock() and
> so get_static_share_mode_data() are:
> 
> 	if ((servicepath == NULL) || (smb_fname == NULL) ||
> 	    (old_write_time == NULL)) {
> 		return NULL;
> 	}
> 
> None of these are memory related, confusingly. 
> 
> The full smb.conf Rowland asked for might help.
> 
> Otherwise, if you are confident and if you have self-compiled 
> this then
> if you can patch in a smb_panic() rather than the return NULL, and
> catch it under gdb when it panics, a 'bt full' will tell us which of
> these are the problem.
> 
> Thanks!
> 
> Andrew Bartlett
> 
> -- 
> Andrew Bartlett
> https://samba.org/~abartlet/
> Authentication Developer, Samba Team         https://samba.org
> Samba Development and Support, Catalyst IT   
> https://catalyst.net.nz/services/samba
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
> 
> 




More information about the samba mailing list