🧂 Salt: Failed to Run (SaltRenderError: Could not find relpath for...)

After reading the official doc of qubes os & gonzalo’s notes, I figure out the 1st step is to create the user directories for salt:

# Run in dom0
sudo dnf install qubes-mgmt-salt-base-config
# Enable the top (qubes.users-drs) that creates the users dirs
sudo qubesctl top.enable qubes.users-dirs

I first notice that the dom0 already have the qubes-mgmt-salt-base-config package. That is fine.

However, the 2nd command gives a bunch of errors:

$ sudo qubesctl top.enable qubes.users-dirs
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
SaltRenderError: Could not find relpath for qubes.users-dirs.top
traceback of the error
<py_dir>=/usr/lib/python2.7/site-packages/salt
<extmods>=/var/cache/salt/minion/extmods

SaltRenderError: Could not find relpath for qubes.users-dirs.top
Traceback (most recent call last):
  File "/bin/qubesctl", line 110, in <module>
    salt_call()
  File "<py_dir>/scripts.py", line 391, in salt_call
    client.run()
  File "<py_dir>/cli/call.py", line 58, in run
    caller.run()
  File "<py_dir>/cli/caller.py", line 134, in run
    ret = self.call()
  File "<py_dir>/cli/caller.py", line 204, in call
    ret['return'] = func(*args, **kwargs)
  File "<extmods>/modules/topd.py", line 74, in enable
    return TopUtils(__opts__, **kwargs).enable(paths, saltenv)
  File "<extmods>/utils/toputils.py", line 600, in enable
    toppaths, unseen = self.prepare_paths(paths)
  File "<extmods>/utils/toputils.py", line 453, in prepare_paths
    toppath = self.toppath(path)
  File "<extmods>/utils/toputils.py", line 332, in toppath
    saltenv = saltenv or self.saltenv(path, saltenv)
  File "<extmods>/utils/pathutils.py", line 128, in saltenv
    relpath = self.relpath(path)
  File "<extmods>/utils/pathutils.py", line 486, in relpath
    return self.path(path, saltenv)
  File "<extmods>/utils/toputils.py", line 269, in path
    return super(TopUtils, self).path(path, saltenv, path_type=path_type)
  File "<extmods>/utils/pathutils.py", line 445, in path
    raise SaltRenderError('Could not find relpath for {0}'.format(path))
SaltRenderError: Could not find relpath for qubes.users-dirs.top
Traceback (most recent call last):
  File "/bin/qubesctl", line 110, in <module>
    salt_call()
  File "<py_dir>/scripts.py", line 391, in salt_call
    client.run()
  File "<py_dir>/cli/call.py", line 58, in run
    caller.run()
  File "<py_dir>/cli/caller.py", line 134, in run
    ret = self.call()
  File "<py_dir>/cli/caller.py", line 204, in call
    ret['return'] = func(*args, **kwargs)
  File "<extmods>/modules/topd.py", line 74, in enable
    return TopUtils(__opts__, **kwargs).enable(paths, saltenv)
  File "<extmods>/utils/toputils.py", line 600, in enable
    toppaths, unseen = self.prepare_paths(paths)
  File "<extmods>/utils/toputils.py", line 453, in prepare_paths
    toppath = self.toppath(path)
  File "<extmods>/utils/toputils.py", line 332, in toppath
    saltenv = saltenv or self.saltenv(path, saltenv)
  File "<extmods>/utils/pathutils.py", line 128, in saltenv
    relpath = self.relpath(path)
  File "<extmods>/utils/pathutils.py", line 486, in relpath
    return self.path(path, saltenv)
  File "<extmods>/utils/toputils.py", line 269, in path
    return super(TopUtils, self).path(path, saltenv, path_type=path_type)
  File "<extmods>/utils/pathutils.py", line 445, in path
    raise SaltRenderError('Could not find relpath for {0}'.format(path))
salt.exceptions.SaltRenderError: Could not find relpath for qubes.users-dirs.top
DOM0 configuration failed, not continuing

What did I miss?

Nevermind. it is a spurious s in gonzalo’s notes.

His github repository mentions the correct command:

sudo qubesctl top.enable qubes.user-dirs
sudo qubesctl state.apply

made de title more specific to the issue you were having, so it’s easier for other in the same situation to find this discussion. Feel free to change it if you feel it doesn’t reflect the issue at hand.

Oh, yes, that should be qubes.user-dirs (docs)! The extra “s” is a typo, my bad. I’ll look for it and fix it, thank you @Qurious!

(If you find anything else, please don’t hesitate to bring my attention by “@gonzalo-bulnes” me!)

If you are starting out with salt in Qubes, I dont recommend using
user-dirs - you can, but it introduces complexity and confusion. It’s
called a new environment in salt.

You can simply create states under /srv/salt: e.g, create a new directory
there /srv/salt/Qurious, and reference the states Qurious.state.
Once you have got the basics you can move on to using the user-dirs
environment, if you wish.
Learn the basics first and then move on.
I know many people who salt extensively and only use a single
environment.

1 Like