Been running into an issue with my scheduled web scraping job where the browser just... isn't launching?
Works absolutely fine when I run it manually via ssh. Tried removing from Laravel Kernel, adding manually to crontab AND as a systemd service.
I know what the issue is. Well, kinda. It's some sort of issue running the chromium snap package, likely permissions.
The solution:
bun add -g pm2
pm2 start "php8.2 /home/forge/mysite.app/artisan scrape" --cron "30 * * * *" --no-autorestart
Plus I get a cool dashboard now. Technically a workaround, no idea why pm2 works when everything else doesn't. I could spend more time trying to fix it but this works now, which is what matters.