SMB shares are not accessible, Error when trying to save changes to SMB

  • There's a bit of backstory to this issue. I'm going to give a short description of the issue and troubleshooting below then give the history that I think is pertinent to what may be causing the issue (but I don't know how to solve).


    The issue I'm having is that SMB shares are not accessible and when I try to add a share I an error when attempting to apply the config changes (I will reply to this thread with the error...it says my post is too long when I try to include it).


    What I have tried:

    1. Remove all shares and re-add (The error appears when I attempt to re-add). I also attempted a reboot between removal and re-add.
    2. Stop samba and start samba.
    3. Review config.xml and clean up some invalid file systems (see my backstory below for why these existed). Note I retried 1 and 2 above after this
    4. All of the various repair utilitiesin omv-firstaid
    5. An assortment of "other" things that I no longer remember (sorry).


    Backstory:

    I had an issue with drive enclosures not reporting the actual drive serial. This caused issues recognizing drives. I applied a fix in rules.d that worked, mostly. It would (periodically) switch up the drive assignments as well as "lose" the serial assignment and would take 2-3 reboots to be fixed. eventually I found an official page about this exact issue that had a different rules.d fix that was more stable. Unfortunately, this rules.d fix changed up my drive assignments etc. After making the change I ended up with multiple invalid filesystem entries and new filesystem entries for the new drive assignments.


    This obviously caused issues saving config.xml in general. I went through and cleaned up config.xml and openmediavault-filesystem.conf so that the only entries present are the valid entries. Once this was done I was able to start saving config changes in general. It was after this that I realized that SMB was broken and that I can't make smb-specific config changes.



    At this point I think the above backstory is what caused the issue but I'm at a loss for how to solve it and was hoping someone could help me out with that.

  • Here's the error message:


    Code
    Error #0: OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run samba 2>&1' with exit code '1': raspberrypi: ---------- ID: configure_samba_global Function: file.managed Name: /etc/samba/smb.conf Result: True Comment: File /etc/samba/smb.conf is in the correct state Started: 13:59:28.710464 Duration: 138.71 ms Changes: ---------- ID: configure_samba_shares Function: file.append Name: /etc/samba/smb.conf Result: False Comment: An exception occurred in this state: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 718, in execute self._response = self._response[0] IndexError: list index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 394, in render_jinja_tmpl output = template.render(**decoded_context) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "<template>", line 33, in top-level template code File "/var/cache/salt/minion/extmods/modules/omv_conf.py", line 98, in get_sharedfolder_path mp_obj = get('conf.system.filesystem.mountpoint', sf_obj['mntentref']) File "/var/cache/salt/minion/extmods/modules/omv_conf.py", line 39, in get objs = db.get(id_, identifier) File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 85, in get query.execute() File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 723, in execute raise DatabaseQueryNotFoundException(self.xpath, self.model) openmediavault.config.database.DatabaseQueryNotFoundException: No such object: //system/fstab/mntent[uuid='d636bc59-12a9-4535-8cae-9064eb88c696'] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call **cdata['kwargs']) File "/usr/lib/python3/dist-packages/salt/loader.py", line 1951, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/salt/states/file.py", line 5265, in append context=context) File "/usr/lib/python3/dist-packages/salt/states/file.py", line 1153, in _get_template_texts **kwargs File "/usr/lib/python3/dist-packages/salt/modules/cp.py", line 348, in get_template **kwargs) File "/usr/lib/python3/dist-packages/salt/fileclient.py", line 745, in get_template **kwargs File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 169, in render_tmpl output = render_str(tmplstr, context, tmplpath) File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 443, in render_jinja_tmpl trace=tracestr) salt.exceptions.SaltRenderError: Jinja error: No such object: //system/fstab/mntent[uuid='d636bc59-12a9-4535-8cae-9064eb88c696'] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 718, in execute self._response = self._response[0] IndexError: list index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 394, in render_jinja_tmpl output = template.render(**decoded_context) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "<template>", line 33, in top-level template code File "/var/cache/salt/minion/extmods/modules/omv_conf.py", line 98, in get_sharedfolder_path mp_obj = get('conf.system.filesystem.mountpoint', sf_obj['mntentref']) File "/var/cache/salt/minion/extmods/modules/omv_conf.py", line 39, in get objs = db.get(id_, identifier) File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 85, in get query.execute() File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 723, in execute raise DatabaseQueryNotFoundException(self.xpath, self.model) openmediavault.config.database.DatabaseQueryNotFoundException: No such object: //system/fstab/mntent[uuid='d636bc59-12a9-4535-8cae-9064eb88c696'] ; line 33 --- [...] {%- for share in config.shares.share | selectattr('enable') %} [{{ salt['omv_conf.get_sharedfolder_name'](share.sharedfolderref) }}] {%- if share.comment | length > 0 %} comment = {{ share.comment }} {%- endif %} path = {{ salt['omv_conf.get_sharedfolder_path'](share.sharedfolderref) }} <====================== guest ok = {% if share.guest != 'no' %}yes{% else %}no{% endif %} guest only = {% if share.guest == 'only' %}yes{% else %}no{% endif %} read only = {% if share.readonly | to_bool %}yes{% else %}no{% endif %} browseable = {% if share.browseable | to_bool %}yes{% else %}no{% endif %} inherit acls = {% if share.inheritacls | to_bool %}yes{% else %}no{% endif %} [...] --- Started: 13:59:28.849476 Duration: 198.187 ms Changes: ---------- ID: configure_samba_recyclebin_cron Function: file.managed Name: /etc/cron.daily/openmediavault-samba-recycle Result: True Comment: File /etc/cron.daily/openmediavault-samba-recycle is in the correct state Started: 13:59:29.048019 Duration: 2.876 ms Changes: ---------- ID: remove_samba_recyclebin_cron_scripts Function: module.run Result: True Comment: file.find: [] Started: 13:59:29.052396 Duration: 1.85 ms Changes: ---------- file.find: ---------- ID: configure_default_wsdd Function: file.managed Name: /etc/default/wsdd Result: True Comment: File /etc/default/wsdd is in the correct state Started: 13:59:29.054534 Duration: 3.882 ms Changes: ---------- ID: test_samba_service_config Function: cmd.run Name: samba-tool testparm --suppress-prompt Result: True Comment: Command "samba-tool testparm --suppress-prompt" run Started: 13:59:29.060200 Duration: 204.62 ms Changes: ---------- pid: 22524 retcode: 0 stderr: stdout: # Global parameters [global] disable spoolss = Yes encrypt passwords = Yes getwd cache = Yes guest account = nobody log file = /var/log/samba/log.%m logging = syslog log level = 0 max log size = 1000 min receivefile size = 16384 pam password change = Yes panic action = /usr/share/samba/panic-action %d passdb backend = tdbsam passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . passwd program = /usr/bin/passwd %u printcap name = /dev/null server string = %h server socket options = TCP_NODELAY IPTOS_LOWDELAY unix extensions = Yes workgroup = WORKGROUP fruit:aapl = yes aio read size = 16384 aio write size = 16384 create mask = 0777 directory mask = 0777 use sendfile = Yes write cache size = 524288 ---------- ID: start_samba_service Function: service.running Name: smbd Result: False Comment: One or more requisite failed: omv.deploy.samba.20shares.configure_samba_shares Started: 13:59:29.291814 Duration: 0.02 ms Changes: ---------- ID: start_samba_service_nmbd Function: service.running Name: nmbd Result: False Comment: One or more requisite failed: omv.deploy.samba.default.start_samba_service Started: 13:59:29.292626 Duration: 0.014 ms Changes: ---------- ID: start_wsdd_service Function: service.running Name: wsdd Result: True Comment: The service wsdd is already running Started: 13:59:29.292756 Duration: 87.784 ms Changes: Summary for raspberrypi ------------ Succeeded: 6 (changed=2) Failed: 3 ------------ Total states run: 9 Total run time: 637.943 ms/usr/lib/python3/dist-packages/salt/utils/path.py:265: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if not isinstance(exes, collections.Iterable): in /usr/share/php/openmediavault/system/process.inc:182 Stack trace: #0 /usr/share/php/openmediavault/engine/module/serviceabstract.inc(60): OMV\System\Process->execute() #1 /usr/share/openmediavault/engined/rpc/config.inc(167): OMV\Engine\Module\ServiceAbstract->deploy() #2 [internal function]: Engined\Rpc\Config->applyChanges(Array, Array) #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array) #4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array) #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(588): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusSK...', '/tmp/bgoutput1x...') #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure)) #7 /usr/share/openmediavault/engined/rpc/config.inc(189): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array) #8 [internal function]: Engined\Rpc\Config->applyChangesBg(Array, Array) #9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array) #10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array) #11 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1) #12 {main}
  • All, I got this figured out.


    The corruption traced back to the shared folders. I was able to go back and removed each shared folder, leaving the content, then recreate it. After I did that i had to add it to each service where it's hosted and now everything is working.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!