Deployment fails after activating Horizon on Laravel server

Hi I have activated Horizon - which appears to be running,

However deployments now fail with the horizon hook added, the error is…

1736703145965-laravel-horizon-hook 20250112053641529
sudo: undefined: command not found

The hook has saved as the following (minus site path)

sudo -u cleavr undefined /home/cleavr/******/current/artisan horizon:terminate

Ok so, for anyone else that experiences this…

I think the issue is - I setup my deployment through my Load Blaancer so I can deploy all site web servers at the same time…

Load Balancers don’t have PHP installed - so I assume this is where the undefined error is generating from…

Updating the hook and replacing undefined with php fixed the issue for me.

Add my finding here is case it helps others

1 Like

Hi @NateRoweSFA ,

Thanks for sharing your findings!

The deployment flows should run on the target app servers; would you be able to provide some more insights on what was updated on the deployment hook? Thanks!

Sure the issue (although only a guess) is that I activated horizon on my web servers via the deployment settings page (as they are networked) on the load balancer, and as this doesn’t have php installed on the load balancer, I guess the place holder in your template couldn’t extract the php command - so dumped undefined into it. once I updated it it runs from the load balancer fine :slight_smile:

The screenshot option attached will not work, but assume if you activated it on the web server directly then i would have.

1 Like