Skip to content

Common Pitfalls and Debugging

Y.D.X edited this page Oct 22, 2023 · 6 revisions

A command does not behave like expected

First step

Try to run the command without adding it to Pueue.
Do this by calling sh -c '$COMMAND' instead of pueue add '$COMMAND'.
If this fails, it's not a problem with Pueue, but the command or the shell's features itself.

Some examples of what can go wrong:

  • A single & somewhere in your command detaches the process, causing the Pueue task to finish immediately.
  • The system shell in Ubuntu 18.04 doesn't support the &> parameter, which is interpreted as & and detaches processes. Use 2>&1 instead.

Second step

Look at the process output:

This can be done via pueue log $task_id. You can also get a live view of the output with pueue follow $task_id.

The command formatting seems to be broken

Pueue takes your input and uses it exactly as is to create a new sh -c $command in the background.
If your command contains spaces or characters that need escaping, you might need to encapsulate it as a string:

pueue add -- ls -al "/tmp/this\ is\ a\ test\ directory"

Without quotes, the character escaping won't be transferred to the sh -c $command, as it's already removed by calling it from the current shell.

A process waits for input

Sometimes processes may wait for user input. For instance, most package manager wait for some kind of confirmation (y/n).

If this is the case, you can simply send the desired input to the process via the send subcommand:

pueue send "y
"

However, this can sometimes be avoided by adding something like a --yes flag to the command, given that such a flag is available.

My shell aliases don't work

Pueue doesn't support aliases in your shell's .*rc files, since that's pretty tricky. That's why Pueue brings it's own aliasing. Check the miscellaneous section on how to use it.

Display not found

All programs that require some kind of display/window manager won't work, as the tasks are executed in the background.
Don't use Pueue for commands that won't work in a non-visual environment.

Windows quirks

Due design differences between Windows and Linux, pueued --daemonize may not work as expected on Windows, including but not limited to the following quirks.

  • The daemon may still exit if you close the terminal.
  • If pueue follow in the same shell where pueued is spawned, then Ctrl+C may also shut down the daemon.

There are discussions / workarounds in #344, and implementation is welcomed.