Ahoy all, I'm experiencing an issue when installing Samba on a fresh Debian 
Jessie install and looking to see if others have encountered this issue, if 
there is an obvious fix/dependency I'm missing, or if a bug should be reported.

*Problem description*
After a clean install of Debian Jessie and making sure all packages are 
updated, I installed samba and then ran the samba-tool to provision a new 
domain. I get the following error:

root@firebat-vm:~# samba-tool domain provision --use-rfc2307 --interactive
Realm [HARMONYWAVE.COM]: HARMONYWAVE.COM
 Domain [HARMONYWAVE]: harmonywave
 Server Role (dc, member, standalone) [dc]: dc
 DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) 
[SAMBA_INTERNAL]: SAMBA_INTERNAL
 DNS forwarder IP address (write 'none' to disable forwarding) [10.1.30.2]: 
10.1.30.2
Administrator password:
Retype password:
*ERROR(<class 'samba.provision.ProvisioningError'>): Provision failed - 
ProvisioningError: guess_names: 'realm =' was not specified in supplied 
/etc/samba/smb.conf. Please remove the smb.conf file and let provision generate it*
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 434, in 
run
    nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode)
  File "/usr/lib/python2.7/dist-packages/samba/provision/__init__.py", line 
2022, in provision
    sitename=sitename, rootdn=rootdn, domain_names_forced=(samdb_fill == 
FILL_DRS))
  File "/usr/lib/python2.7/dist-packages/samba/provision/__init__.py", line 
603, in guess_names
    raise ProvisioningError("guess_names: 'realm =' was not specified in supplied 
%s.  Please remove the smb.conf file and let provision generate it" % lp.configfile)

I remove the /etc/samba/smb.conf file as the error suggests and then run the 
exact same command again and it provisions successfully. I just think that a 
clean install of Jessie should not throw this error the first time it is run. 
I've Googled and found a few pages and both Ubuntu and Debian bugs related to 
this exact error message, but it seems that most of them are related to 
upgrading the Samba package or after reboots, not when running the samba-tool 
utility.

After some further testing I found that I can just remove the 
/etc/samba/smb.conf file immediately after installing Samba and before running 
the samba-tool utility. It appears that the mere fact that an smb.conf file 
exists is the issue. Obviously this issue isn't that critical as the error 
tells you the problem and even how to fix it, it just seems odd that after a 
fresh install a provision does not work correctly, especially since it 
specifically asks for the realm.

*Steps to reproduce*

1. Install a clean OS of Debian Jessie
2. Upgrade all packages (apt-get update && apt-get -y dist-upgrade)
3. Install samba (apt-get install samba)
4. Run the samba-tool utility (samba-tool domain provision --use-rfc2307 
--interactive) and answer the questions asked by the script.


*TL;DR*
I guess the main question is: "Is a user expected to remove the smb.conf file before 
running the samba-tool utility to provision a domain? If so, I have not seen this in any 
documentation (Debian, Samba, Ubuntu or otherwise). Should this be considered a bug? The 
domain provision process expects that if the smb.conf file exists it is already setup for 
the domain being provisioned."

Thanks,
Joshua Schaeffer

Reply via email to