Missing smb4.conf on fresh install

EponymousOne

Dabbler
Joined
Jan 9, 2017
Messages
15
Hi,

I did a fresh install of FreeNAS 11.2-U5 and then upgraded to 11.2-U6.

I'm tyring to get SMB and Domain Controller services to start but every time I try either, it fails to start the service.

Looking in the logs it's because /usr/local/etc/smb4.conf is missing. Is this normally the case for a fresh install?

I tried changing some of the settings in the SMB service configuration page to see if it would force a re-create of the file but it doesn't.

I've scoured the docs and Google to find a solution to this but so far I haven't had any luck.

Do I need to re-install FreeNAS - will that even make a difference?

Thanks.
 

EponymousOne

Dabbler
Joined
Jan 9, 2017
Messages
15
Further testing:

If I disable "Domain Controller" -> "Start automatically" I can enable SMB without issue. It will even create the smb4.conf file needed.

It seems to be the Domain Controller part that is not working properly. I can't even change the settings I've put in the configuration screen as the Save button is always greyed out. This looks buggy to me.

I've tried different combinations of Domain Controller only enabled, SMB controller only enabled, both enabled etc.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
This looks buggy to me.

Get a ticket created. I don't use domain controllers, so can't help, but to your point, could be a bug. Have you looked the manual for that configuration, to ensure you are doing all you have?
 
D

dlavigne

Guest
Why are you trying to start the Domain Controller service? Is there no AD in your network?
 
Joined
May 20, 2016
Messages
28
Hello,

I dont know if there is a follow up on this. I appear to have the same problem. My box is not a brand new install, its an ixsystem mini xl that started in Freenas 9.X and now updated to the latest 11.3 U2. I have had the same problem since the 11.2 train, at least. On every reboot, I have to go run
Code:
sudo ln -s smb4_share.conf smb4.conf
so that smb will start.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hello,

I don't know if there is a follow up on this. I appear to have the same problem. My box is not a brand new install, its an ixsystem mini xl that started in Freenas 9.X and now updated to the latest 11.3 U2. I have had the same problem since the 11.2 train, at least. On every reboot, I have to go run
Code:
sudo ln -s smb4_share.conf smb4.conf
so that smb will start.
Please don't do that. They are separate files for a reason. If you're on 11.3-U2, post the output of midclt call smb.config
 
Joined
May 20, 2016
Messages
28
Ok, I would gadly not do that if smb were starting.

Here is the output
Code:
simonpie@sancy:~ % sudo midclt call smb.config
Password:
{"id": 1, "netbiosname": "sancy", "netbiosname_b": null, "netbiosalias": [], "workgroup": "WORKGROUP", "description": "Sancy", "enable_smb1": false, "unixcharset": "UTF-8", "loglevel": "MINIMUM", "syslog": false, "localmaster": false, "guest": "nobody", "admin_group": null, "filemask": "", "dirmask": "", "smb_options": "server signing = disabled\nclient signing = disabled\nclient ipc signing = disabled\nstore dos attributes = no\nea support = no", "zeroconf": true, "ntlmv1_auth": false, "bindip": [], "cifs_SID": "S-1-5-21-2463196758-1791381355-2150792768", "netbiosname_local": "sancy"}
simonpie@sancy:~ % 


While I am here, here is the output of log.smbd :

Code:
simonpie@sancy:/var/log/samba4 % cat log.smbd
[2020/04/21 13:09:55.896563,  0] ../../source3/smbd/server.c:1788(main)
  smbd version 4.10.13 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2019
[2020/04/21 13:09:55.898590,  0] ../../source3/smbd/server.c:1803(main)
  error opening config file '/usr/local/etc/smb4.conf'
[2020/04/21 13:11:52.567589,  0] ../../source3/smbd/server.c:1788(main)
  smbd version 4.10.13 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2019
[2020/04/21 13:11:52.567886,  0] ../../source3/smbd/server.c:1803(main)
  error opening config file '/usr/local/etc/smb4.conf'
 
Joined
May 20, 2016
Messages
28
Yes there are :

Code:
[2020/04/29 21:33:57]
(DEBUG) EtcService.render():38 - Failed to render mako template:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 35, in render
    return await self.service.middleware.run_in_thread(do)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
    return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 33, in do
    return tmpl.render(middleware=self.service.middleware)
  File "/usr/local/lib/python3.7/site-packages/mako/template.py", line 475, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 882, in _render
    **_kwargs_for_callable(callable_, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 919, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 946, in _exec_template
    callable_(context, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 389, in render_body
    parsed_conf = parse_config(db)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 383, in parse_config
    add_idmap_params(pc, db)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 348, in add_idmap_params
    idmap_domains = middleware.call_sync('idmap.get_configured_idmap_domains')
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1147, in call_sync
    io_thread=True, job_on_progress_cb=job_on_progress_cb,
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1170, in run_coroutine
     return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1081, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 961, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/idmap.py", line 200, in get_configured_idmap_domains
    [('domain.idmap_domain_name', '=', domain['domain']['idmap_domain_name'])]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1125, in call
    serviceobj, methodobj = self._method_lookup(name)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1108, in _method_lookup
    raise CallError(f'Method "{method_name}" not found in "{service}"', CallError.ENOMETHOD)
CallError: [ENOMETHOD] Method "query" not found in "idmap.fruit"

[2020/04/29 21:33:57] (ERROR) EtcService.generate():237 - Failed to render mako:local/smb4.conf
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1105, in _method_lookup
    serviceobj = self.get_service(service)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/__init__.py", line 539, in get_service
    return self._services_aliases[name]
KeyError: 'idmap.fruit'

During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 235, in generate
    rendered = await renderer.render(path)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 35, in render
    return await self.service.middleware.run_in_thread(do)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
    return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 33, in do
    return tmpl.render(middleware=self.service.middleware)
  File "/usr/local/lib/python3.7/site-packages/mako/template.py", line 475, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 882, in _render
    **_kwargs_for_callable(callable_, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 919, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 946, in _exec_template
    callable_(context, *args, **kwargs)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 414, in render_body
    parsed_conf = parse_config(db)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 408, in parse_config
    add_idmap_params(pc, db)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 373, in add_idmap_params
    idmap_domains = middleware.call_sync('idmap.get_configured_idmap_domains')
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1147, in call_sync
    io_thread=True, job_on_progress_cb=job_on_progress_cb,
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1170, in run_coroutine
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1081, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 961, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/idmap.py", line 200, in get_configured_idmap_domains
    [('domain.idmap_domain_name', '=', domain['domain']['idmap_domain_name'])]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1125, in call
    serviceobj, methodobj = self._method_lookup(name)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1108, in _method_lookup
      raise CallError(f'Method "{method_name}" not found in "{service}"', CallError.ENOMETHOD)
middlewared.service_exception.CallError: [ENOMETHOD] Method "query" not found in "idmap.fruit"
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Yes there are :

Code:
[2020/04/29 21:33:57]
(DEBUG) EtcService.render():38 - Failed to render mako template:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 35, in render
    return await self.service.middleware.run_in_thread(do)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
    return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 33, in do
    return tmpl.render(middleware=self.service.middleware)
  File "/usr/local/lib/python3.7/site-packages/mako/template.py", line 475, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 882, in _render
    **_kwargs_for_callable(callable_, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 919, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 946, in _exec_template
    callable_(context, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 389, in render_body
    parsed_conf = parse_config(db)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 383, in parse_config
    add_idmap_params(pc, db)
  File "/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf", line 348, in add_idmap_params
    idmap_domains = middleware.call_sync('idmap.get_configured_idmap_domains')
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1147, in call_sync
    io_thread=True, job_on_progress_cb=job_on_progress_cb,
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1170, in run_coroutine
     return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1081, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 961, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/idmap.py", line 200, in get_configured_idmap_domains
    [('domain.idmap_domain_name', '=', domain['domain']['idmap_domain_name'])]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1125, in call
    serviceobj, methodobj = self._method_lookup(name)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1108, in _method_lookup
    raise CallError(f'Method "{method_name}" not found in "{service}"', CallError.ENOMETHOD)
CallError: [ENOMETHOD] Method "query" not found in "idmap.fruit"

[2020/04/29 21:33:57] (ERROR) EtcService.generate():237 - Failed to render mako:local/smb4.conf
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1105, in _method_lookup
    serviceobj = self.get_service(service)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/__init__.py", line 539, in get_service
    return self._services_aliases[name]
KeyError: 'idmap.fruit'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 235, in generate
    rendered = await renderer.render(path)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 35, in render
    return await self.service.middleware.run_in_thread(do)
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
    return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/etc.py", line 33, in do
    return tmpl.render(middleware=self.service.middleware)
  File "/usr/local/lib/python3.7/site-packages/mako/template.py", line 475, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 882, in _render
    **_kwargs_for_callable(callable_, data)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 919, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/lib/python3.7/site-packages/mako/runtime.py", line 946, in _exec_template
    callable_(context, *args, **kwargs)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 414, in render_body
    parsed_conf = parse_config(db)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 408, in parse_config
    add_idmap_params(pc, db)
  File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4.conf.py", line 373, in add_idmap_params
    idmap_domains = middleware.call_sync('idmap.get_configured_idmap_domains')
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1147, in call_sync
    io_thread=True, job_on_progress_cb=job_on_progress_cb,
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1170, in run_coroutine
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1081, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 961, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/idmap.py", line 200, in get_configured_idmap_domains
    [('domain.idmap_domain_name', '=', domain['domain']['idmap_domain_name'])]
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1125, in call
    serviceobj, methodobj = self._method_lookup(name)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1108, in _method_lookup
      raise CallError(f'Method "{method_name}" not found in "{service}"', CallError.ENOMETHOD)
middlewared.service_exception.CallError: [ENOMETHOD] Method "query" not found in "idmap.fruit"
Oh. Looks like idmap_fruit generation is broken. I'll put in a fix for 11.3-U4 since we're in code freeze for U3. Did you intentionally select this backend? If so, what's the particular use-case that compelled you for this selection?
 
Joined
May 20, 2016
Messages
28
Sorry,

I did not read or I forgot about the config file and I just noticed that smb still does not work under 11.3-U4
Code:
simonpie@sancy:/usr/local/etc % cat smb4.conf
#
# SMB.CONF(5)        The configuration file for the Samba suite
# $FreeBSD$
#


[TestNC]
        read only = no
        vfs objects = catia fruit streams_xattr zfs_space zfsacl
        fruit:metadata = stream
        fruit:resource = stream
        nfs4:chown = true
        nfs4:acedup = merge
        aio write size = 0
        mangled names = illegal
        ea support = false
        force user =  www
        path = /mnt/tank/TestNC

[principal]
        read only = no
        hide dot files = no
        fruit:locking = netatalk
        strict locking = auto
        streams_xattr:prefix = user.
        streams_xattr:store_stream_type = no
        vfs objects = catia fruit streams_xattr zfs_space zfsacl
        fruit:metadata = stream
        fruit:resource = stream
        nfs4:chown = true
        nfs4:acedup = merge
        aio write size = 0
        mangled names = illegal
        ea support =  no
        zfsacl:expose_snapdir = True
        veto files =  /.windows/.mac/
        server signing =  disabled
        client signing =  disabled
        client ipc signing =  disabled
        store dos attributes =  no
        path = /mnt/tank/principal

simonpie@sancy:/usr/local/etc %
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
@anodos is asking you to go to System->Advanced, and click the "Save Debug" button. Once the debug file is downloaded, start a conversation here with him, and attach the debug file to it.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
RIght. Forgot about this report. idmap_fruit (not to be confused with vfs_fruit) has been deprecated. A copy of the config file would also be helpful.
 
Joined
May 20, 2016
Messages
28
@anodos is asking you to go to System->Advanced, and click the "Save Debug" button. Once the debug file is downloaded, start a conversation here with him, and attach the debug file to it.


Thanks. Done,

May I ask, what are the advantages of starting a separate conversation ? Apparently my netiquette needs improvement.
 
Top