Queue workers and background jobs
Atlas uses a Laravel PHP queue worker to process queued syncs, batches, and ticket sentiment jobs. PHP-FPM serves web requests; it does not process the Laravel queue. A scheduler triggers scheduled commands; it is not a substitute for the worker either.
1. Confirm the queue configuration
For the standard local database-backed queue, set this in src/.env:
QUEUE_CONNECTION=database
Ensure migrations have run so the queue and batch tables exist. The web app and worker must use the same environment, database, queue connection, and queue name. sync executes dispatched work inline and does not test the normal background-worker workflow.
After changing local environment configuration, clear cached config:
docker exec -u www-data -w /var/www its-internal-app-its-internal-app-1 \
php artisan config:clear
Then restart the worker using step 3 so it loads the new configuration.
2. Check the managed worker
The Docker development image starts Supervisor with config/supervisord.app.conf. That configuration enables one queue worker and a separate scheduler, both with automatic restart.
docker exec its-internal-app-its-internal-app-1 \
supervisorctl -c /etc/supervisor/conf.d/supervisord.app.conf status
Confirm these process names:
laravel-queue:laravel-queue_00 RUNNING
laravel-scheduler:laravel-scheduler_00 RUNNING
STOPPED, BACKOFF, EXITED, or FATAL is not ready. Check the queue log before retrying:
docker exec its-internal-app-its-internal-app-1 \
tail -n 100 /var/log/supervisor/laravel-queue.log
Supervisor control commands use the container’s administrative user because its control socket is restricted. The managed PHP worker itself runs as www-data.
3. Start or recover the worker
If stopped, or after correcting a startup error:
docker exec its-internal-app-its-internal-app-1 \
supervisorctl -c /etc/supervisor/conf.d/supervisord.app.conf \
start 'laravel-queue:*'
To reload changed application code/configuration during local development, let active jobs finish first, then restart:
docker exec its-internal-app-its-internal-app-1 \
supervisorctl -c /etc/supervisor/conf.d/supervisord.app.conf \
restart 'laravel-queue:*'
Repeat the status command and confirm the process stays RUNNING. Repeatedly restarting a failing worker is not a fix.
If the log mentions /root/.postgresql/postgresql.crt and Permission denied, the worker may have inherited the wrong home directory. The current source configuration sets HOME=/var/www for the worker. If the running image predates that fix, rebuild/recreate the app container:
docker compose up -d --build its-internal-app
This interrupts the local app and its workers; coordinate on shared development hosts and let active jobs finish first. Recheck status and logs afterward. Do not make /root readable or run the worker as root as a workaround.
4. Verify tickets actually sync and analyse
- Confirm the worker remains
RUNNING. - Trigger one authorized, scoped ticket-sync action in Atlas. Wait for completion and check the ticket’s sync timestamp and notes.
- Confirm global and per-organization sentiment analysis are enabled, Foundry is configured, and the ticket has notes with content.
- With the required analysis permissions, choose Analyze ticket or Re-analyze.
- Check the worker log for activity, refresh the ticket, and confirm a new sentiment result and analysis timestamp.
No timestamp change means the outcome is not verified, even if dispatch showed a success notification.
To inspect application errors or skipped-analysis messages:
docker exec its-internal-app-its-internal-app-1 \
tail -n 100 /var/www/storage/logs/laravel.log
If file logging is not enabled, inspect the configured logging destination/container logs instead. Logs may contain client information; redact them before sharing.
Foreground worker for debugging
Prefer the managed worker. To watch jobs interactively, first let active work finish and stop the managed worker so you do not accidentally add a second consumer:
docker exec its-internal-app-its-internal-app-1 \
supervisorctl -c /etc/supervisor/conf.d/supervisord.app.conf \
stop 'laravel-queue:*'
docker exec -it -u www-data -e HOME=/var/www -w /var/www \
its-internal-app-its-internal-app-1 \
php artisan queue:work --sleep=3 --tries=3 --max-time=3600
Keep the terminal open. Press Ctrl+C to stop when finished, then restore the managed worker with the start command above and verify RUNNING. The foreground command exits after its maximum runtime; unlike Supervisor, the terminal does not restart it automatically.
Scheduler and failed jobs
The scheduler does not enable production-only Autotask schedules locally. Trigger local sync deliberately; do not switch the app to production to activate recurring imports.
List failed jobs:
docker exec -u www-data -w /var/www its-internal-app-its-internal-app-1 \
php artisan queue:failed
After diagnosing and correcting a failure, retry only the intended job with php artisan queue:retry JOB_ID inside the same container as www-data. Do not blindly retry all failures or clear the queue.
Sentiment jobs may record a skipped analysis in the application log without entering failed jobs. Check both the logs and actual ticket result.