[SOLVED] Unable add devices over CLI

This thread from @ ArkaNoid_76 is closed to new posts: Unable add devices over CLI

FYI, I had exactly the same problem, and I have the solution.

The problem was that I was in directory /root when issuing the command:

sudo -u librenms lnms device:add ...
...
In Process.php line 350:

  Unable to launch a new process.

I found the problem using strace:

[pid 51159] chdir("/root")              = -1 EACCES (Permission denied)

The solution was to cd /opt/librenms before issuing the command.