Bug 2248840

Summary: samba-tool can not load the default configuration file
Product: [Fedora] Fedora Reporter: cornel panceac <cpanceac>
Component: sambaAssignee: Pavel Filipensky <pfilipen>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: abokovoy, aboscatt, anoopcs, asn, gdeschner, lmohanty, pfilipen, sbose, ssorce
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-10-01 11:53:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
original samba.conf none

Description cornel panceac 2023-11-09 08:59:24 UTC
$ sudo samba-tool domain provision --interactive
[sudo] password for cornel: 


Reproducible: Always

Steps to Reproduce:
1.sudo samba-tool domain provision --interactive
2.
3.
Actual Results:  
ERROR(runtime): uncaught exception - Unable to load default file
  File "/usr/lib64/python3.12/site-packages/samba/netcmd/__init__.py", line 279, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/samba/netcmd/domain/provision.py", line 182, in run
    lp = sambaopts.get_loadparm()
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/samba/getopt.py", line 120, in get_loadparm
    self._lp.load_default()


Expected Results:  
samba-tool works.

testparm works fine

$ rpm -qf $(which samba-tool)
samba-tools-4.19.2-1.fc39.x86_64

Comment 1 Andreas Schneider 2023-11-10 07:25:04 UTC
I'm not able to reproduce this:

krikkit:~ # rm -f /etc/samba/smb.conf
krikkit:~ # samba-tool domain provision --interactive
Realm: wurst.brot

Does /etc/samba/smb.conf exist? What are the permissions of the file?

Comment 2 cornel panceac 2023-11-10 08:15:03 UTC
I confirm that the problem goes away if i remove smb.conf first.
I can reproduce it only if smb.conf is already present.
Thank you.

Comment 3 Andreas Schneider 2023-11-10 16:06:42 UTC
Can you share the failing smb.conf?

Comment 4 cornel panceac 2023-11-11 09:44:32 UTC
it's the default smb.conf, i'll share it on monday.

Comment 5 cornel panceac 2024-01-08 11:28:51 UTC
Created attachment 2007754 [details]
original samba.conf

Comment 6 cornel panceac 2024-01-16 18:13:48 UTC
what info is needed?

Comment 7 Andre Boscatto 2024-01-17 18:16:28 UTC
Hi Cornel,

I added the flag to Andreas to come back here later this week or the next one. There is no further action pending from your side at the moment, my apologies if it gave a wrong message.

Kindly

Comment 8 Pavel Filipensky 2024-08-21 09:46:41 UTC
The bug is fixed in upstream: https://bugzilla.samba.org/show_bug.cgi?id=15698 and will be backported to samba 4.20/4.21.