Confirmation that I can reproduce that error.
Of note, this seems to only concern our Samba standalone script, and not other standalone scripts such as the st-snapshot
from scheduled_tasks.
After adding a simple debugging attempt in src.rockstor.scripts.__init__.py
:
import os
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
import django # noqa E402
from system.osi import run_command
o, e, rc = run_command("pass")
logger.debug(f"o: {o}; e: {e}, rc: {rc}")
django.setup()
I get the following when trying to access a samba share from my Tumbleweed laptop:
Error: password store is empty. Try "pass init".
Traceback (most recent call last):
File "/opt/rockstor/.venv/bin/mnt-share", line 3, in <module>
from scripts.mount_share import mount_share
File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 17, in <module>
o, e, rc = run_command("pass")
^^^^^^^^^^^^^^^^^^^
File "/opt/rockstor/src/rockstor/system/osi.py", line 263, in run_command
raise CommandException(cmd, out, err, rc)
system.exceptions.CommandException: Error running a command. cmd = p a s s. rc = 1. stdout = ['']. stderr = ['Error: password store is empty. Try "pass init".', '']
So, same as the original report above.
As a reminder, this script is triggered as a preexec in our smb.conf
. In my case:
[test_share01]
root preexec = "/opt/rockstor/.venv/bin/mnt-share test_share01"
Running this script manually from the shell works without issue.
My best guess at the moment is that this relates to how Samba calls this root preexec
script… Maybe we need to give it some env variables or something like that…
For reference:
https://manpages.opensuse.org/Tumbleweed/samba-client/smb.conf.5.en.html