I just noticed that it must have something to do with my old smb.conf. Although I did not change it and it used to run in older versions of samba4, samba works fine with the default config.
This must be where I have something bad in my config: [global] browseable = yes create mask = 0777 directory mask = 0777 force create mode = 0777 force directory mode = 0777 oplocks = yes locking = yes disable spoolss = yes load printers = no show add printer wizard = no printcap name = /dev/null disable spoolss = yes dos charset = CP850 deadtime = 10 use sendfile = yes case sensitive = auto display charset = UTF8 unix extensions = no passdb backend = smbpasswd store dos attributes = yes min receivefile size = 4096 client ntlmv2 auth = yes dos filetime resolution = no inherit acls = yes wide links = yes read only = no workgroup = NASGROUP server string = %h server dns proxy = no log level = 2 log file = /var/log/samba/log.%m max log size = 1000 panic action = /usr/share/samba/panic-action %d security = user encrypt passwords = true passdb backend = smbpasswd obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=65536 SO_SNDBUF=65536