[4.5.0] — 2026-05-04
Fixed
- Panel API: silent 500 under load (no log written) — Long sync calls in the API (deploy, artisan, MCP,
sudo cipi …) saturated a too-small PHP-FPM pool (pm.max_children = 10); whenrequest_terminate_timeout = 300fired, FPMSIGKILL'd workers mid-request, so Laravel's exception handler never ran and nothing reachedstorage/logs/laravel.logorcipi-api-php-error.log— the only trace was injournalctl -u php<ver>-fpm. Fixed by enlarging the pool, adding a slowlog (PHP backtrace 30s before the kill), and capturing child stderr in the FPM log. - Panel API:
database is locked500s — SQLite defaultjournal_mode=DELETEplus Laravel's ~5sbusy_timeoutcaused contention between thecipi-queueworker and FPM children under burst traffic. Switched the panel SQLite DB toWAL+synchronous=NORMAL+busy_timeout=15000(set on everycipi api setup|update|upgradeand on existing servers via migration 4.5.0). cipi-queuememory drift — The systemd worker ranqueue:workindefinitely; long-lived PHP processes leak memory. Now restarted automatically every hour or 200 jobs (--max-time=3600 --max-jobs=200 --rest=1).
Changed
- PHP-FPM pool for the Panel API —
_api_create_fpm_pool(inlib/api.sh) andlib/migrations/4.5.0.shnow write a tuned pool:pm.max_children = 25,pm.start_servers = 4,pm.min_spare_servers = 2,pm.max_spare_servers = 8,pm.max_requests = 200,pm.process_idle_timeout = 60s,listen.backlog = 1024. Addedrequest_slowlog_timeout = 30withslowlog = /var/log/cipi-api-fpm-slow.logandcatch_workers_output = yesso child stderr/fatals land in the FPM log even when a worker dies before Laravel can log. The PHP childerror_logmoved from/var/log/nginx/cipi-api-php-error.log(logically Nginx's) to/var/log/cipi-api-php-error.log, registered in a newlogrotate.d/cipi-api-logs. - Nginx vhost for the Panel API —
_api_create_nginx_vhostnow sets explicit FastCGI buffers (fastcgi_buffers 16 32k,fastcgi_buffer_size 64k,fastcgi_busy_buffers_size 128k) and adds a local-onlylocation = /cipi-api-fpm-status(allow 127.0.0.1) used bycipi api statusto read pool stats. - Laravel logging defaults —
LOG_CHANNEL=stackandLOG_STACK=single,stderrare now forced in/opt/cipi/api/.envon install/update/upgrade/migration, mirroring errors to FPM stdout/stderr so they survive aSIGKILL'd worker. cipi api status— Now also prints active/idle FPM workers, listen queue depth, and slowlog hits (when present), so operators can see pool saturation at a glance.
Added
lib/migrations/4.5.0.sh— Retrofits installed servers (auto-detects the PHP version actively running the API pool) by rewritingcipi-api.conf,cipi-queue.service, the Nginx vhost,.envlog channels, the SQLite pragmas, and the logrotate config. Runscertbot --nginx --reinstallwhen an SSL cert exists, so the redirect/443 block survives the vhost rewrite. Idempotent and safe to re-run.