If it’s a timeout you should be able to increase the time limit to resolve the issue, here’s what ChatGPT suggests:
Thanks for the detailed info and screenshots — even though they didn’t come through visually here, your descriptions were clear enough to get a good sense of what’s going on.
TL;DR:
You’re running into a 504 Gateway Timeout error when attempting to upgrade Invoice Ninja (IN) through the new UI, and falling back to the old UI (Windows app) also fails. You’ve checked /storage/logs
and Plesk logs and found a timeout error but no detailed trace from the app itself. This used to work fine before.
Let’s walk through some likely causes and ideas to try:
Potential Issues & Fixes
1. 504 Gateway Timeout = Server not responding in time
This suggests:
- Something in the upgrade process is taking too long (long DB migrations? large queue jobs?)
- Or it’s hanging indefinitely
- Or the reverse proxy (Nginx/Apache behind Plesk) is timing out too quickly
Suggestions:
- Increase timeout settings for your web server:
- Apache:
Timeout
, ProxyTimeout
- Nginx:
proxy_read_timeout
, fastcgi_read_timeout
- Check Plesk’s domain-specific settings and increase those timeout values if needed
2. Run upgrade manually via CLI
This is often the most reliable way:
php artisan migrate --force
php artisan optimize
php artisan config:clear
php artisan route:clear
Also worth trying:
php artisan ninja:post-update
This will manually apply migrations and cleanup. If there’s an error here, it’ll be clearer than in the browser.
3. Check PHP-FPM / Worker Limits
If you’re using PHP-FPM (which Plesk often does), it could be:
- Running out of memory or workers
- Crashing silently
Things to check:
- PHP-FPM logs (
/var/log/phpX.X-fpm.log
)
- Increase
pm.max_children
and memory limits
- Make sure
max_execution_time
is high enough (try 300)
4. Queue Worker Stuck?
If the upgrade triggers a queue job (like database seeding or cache rebuild), and your queue driver is database
or redis
, it may be stuck or not running.
Try:
php artisan queue:restart
php artisan queue:work
If that solves it, you may want to make sure your queue workers are auto-starting (via Supervisor or systemd).
5. Check Disk Space & Permissions
Sometimes overlooked, but:
- Make sure there’s enough free disk space (especially
/tmp
, /var
, or the site’s storage/
)
- Ensure proper permissions on
storage/
, bootstrap/cache/
chown -R www-data:www-data /path-to-invoice-ninja
chmod -R 775 /path-to-invoice-ninja/storage
(Substitute www-data
if you’re using a different user like apache
, pleskuser
, etc.)
6. Isolate Version Issue
If it worked before and suddenly doesn’t:
- Did the latest IN version change anything major in the upgrade process? Check their GitHub release notes
- Could be a breaking migration or dependency issue
Other Ideas
-
Turn on debug in .env
during upgrade to get better error trace:
APP_DEBUG=true
LOG_CHANNEL=stack
-
Check your Laravel version compatibility – sometimes newer IN releases bump their Laravel version, which could require PHP upgrades or additional dependencies
If nothing works and you’re stuck, feel free to share:
- Your IN version before and after
- PHP version
- Log lines from
storage/logs/laravel.log
after enabling debug
- Your
.env
(scrub sensitive data)
I can help review it in more depth.
Let me know how it goes!