Error Running Cron

When running the following command in cron on a self-hosting (v4.4.0) installation:

php /path/to/artisan ninja:send-invoices

I get this error:

In ArgvInput.php line 280:

Invalid argument supplied f
or foreach()

X-Powered-By: PHP/7.0.27
Content-type: text/html; charset=UTF-8

The Laravel log reads:

[2018-05-06 17:20:02] production.ERROR: ***ErrorException*** [0] : /home/hyweljen/public_html/invoices.hyweljenkins.com/vendor/symfony/console/Input/ArgvInput.php [Line 280] => Invalid argument supplied for foreach() {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"127.0.0.1","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []

However, if I run exactly the same command and the terminal, it completes correctly.

Any pointers? PHP is version 7.0.27 (cli)

I’m not sure, it’s the first time I’ve seen this error.

Maybe this will help: https://stackoverflow.com/a/29784188/497368