Trouble running `cmd.script` salt module

I am trying to run a script with cmd.script module (don’t mistake it for states.cmd, this is modules.cmdmod), but it fails in qubes:

$ sudo qubesctl --show-output --targets disp1337 cmd.script salt://test-module.sh saltenv=user
local:
    ----------
    pid:
        62922
    retcode:
        0
    stderr:
    stdout:
        module works
disp1337:
      ----------
      cache_error:
          True
      pid:
          0
      retcode:
          1
      stderr:
      stdout:

The script itself:

echo "module works"

Do you have any idea why would it behave this way?

p.s. couple of other execution modules I checked seem to work flawlessly, I have a suspicion that it fails to download the script.

p.p.s. Maybe you have some knowledge about cache_error and what it means here? I can’t find it in the salt reference…

Add --skip-dom0 otherwise it tries to run it on dom0 (this is the local part).

I can reproduce your problem, although this works fine when I use cmd.script in a state and run state.highstate.

1 Like

This is the exact problem I have: it runs in dom0 no problem (as you can see by the correct return under “local”), but fails in any qube (retcode 1 and cache_error under “disp1337”).

Yes, states.cmd works for me too, no matter how I invoke it. I guess these modules are different under the hood.

p.s. Thanks for checking it for me!

For anyone who might stumble upon this in the future, I’ve posted an issue: