Update failed: 503 service unavailable

Upgrading issue:
Current version: 5.9.4
New version: 5.10.4

Getting the following error: 503: Service Unavailable

Error_log: PHP Warning: PHP Startup: Invalid date.timezone value ‘’, using ‘UTC’ instead in Unknown on line 0

[2024-06-30 09:22:15] production.INFO: Test filesystem is writable
[2024-06-30 09:22:18] production.INFO: Clear cache directory
[2024-06-30 09:22:18] production.INFO: copying release file
[2024-06-30 09:22:23] production.INFO: Copied file from URL
[2024-06-30 09:22:23] production.INFO: Finished copying
[2024-06-30 09:22:23] production.INFO: Extracting tar

I notice that the tar is unpacked, and then the update is stopped. At least that’s what it seems like in this log.

This log file does not show any additional information regarding the update.


It may help to increase your server’s PHP memory limit.

One workaround is to manually copy over the latest release tar.

Thank you for your quick response. That is appreciated.

Memory Limit is 2048M, which should be sufficient.

So unpack tar and copy over it. Do I need to do anything else afterwards? Or will the update be started automatically by an action or something automatically?

There are two parts to the update: new code and possible database changes.

Copying over the tar file updates the code. The app includes database migrations to update the database, you can run them either by loading /update or running php artisan migrate from the command line.

I do not have rights to a command line. Can I also use php artisan migrate in a cron job?

Calling /update will attempt to run the migrations

Unfortunately it was not possible manually. Tar unpacked and placed over it. Then called /update. Which results in an error:


[30-Jun-2024 13:00:06 UTC] PHP Fatal error: During class fetch: Uncaught ErrorException: include(/home/dummy/public_html/factuur/vendor/composer/…/sentry/sentry-laravel/src/Sentry/Laravel/Features/Concerns/TracksPushedScopesAndSpans.php): Failed to open stream: No such file or directory in /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php:576
Stack trace:
#0 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php(576): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()
#2 /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php(576): include(‘/home/dummy/pu…’)
#3 /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}()
#4 /home/dummy/public_html/factuur/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Features/QueueIntegration.php(30): Composer\Autoload\ClassLoader->loadClass()
#5 /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php(576): include(‘/home/dummy/pu…’)
#6 /home/dummy/public_html/factuur/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}()
#7 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#8 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Container/Container.php(904): ReflectionClass->__construct()
#9 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Container/Container.php(293): Illuminate\Container\Container->build()
#10 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Container/Container.php(900): Illuminate\Container\Container->Illuminate\Container{closure}()
#11 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Container/Container.php(787): Illuminate\Container\Container->build()
#12 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1041): Illuminate\Container\Container->resolve()
#13 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Container/Container.php(723): Illuminate\Foundation\Application->resolve()
#14 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1026): Illuminate\Container\Container->make()
#15 /home/dummy/public_html/factuur/vendor/sentry/sentry-laravel/src/Sentry/Laravel/ServiceProvider.php(179): Illuminate\Foundation\Application->make()
#16 /home/dummy/public_html/factuur/vendor/sentry/sentry-laravel/src/Sentry/Laravel/ServiceProvider.php(136): Sentry\Laravel\ServiceProvider->registerFeatures()
#17 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(868): Sentry\Laravel\ServiceProvider->register()
#18 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register()
#19 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(843): Illuminate\Foundation\ProviderRepository->load()
#20 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(37): Illuminate\Foundation\Application->registerConfiguredProviders()
#21 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(316): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap()
#22 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(470): Illuminate\Foundation\Application->bootstrapWith()
#23 /home/dummy/public_html/factuur/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(194): Illuminate\Foundation\Console\Kernel->bootstrap()
#24 /home/dummy/public_html/factuur/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#25 {main} in /home/dummy/public_html/factuur/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Features/QueueIntegration.php on line 30

Now back to version 5.9.4 with a restore

Did you use the file called invoiceninja.tar?

Yes I did that. Might an intermediate step be useful? Like, for example, first to 5.9.9 and then to the latest version? Or should that make no difference.

It shouldn’t matter, it may help to clear the contents of the bootstrap/cache/ folder.

Clearing the cache didn’t help.

I thought I didn’t have commandline access, but this is not the case.
I run php artisan migrate on the command line. The message, you want to run this command, yes. INFO Nothing to migrate.

I’m thinking of placing a test environment next to it, this will make testing etc. easier.
Copy files, import Php admin SQL dump and adjust *.env? Or should I think about something else?

What do you see if you run composer dump-autoload

What are you looking for, 1019 lines…

@david do you have any suggestions?

hard to say, but looks like either missing extension, or wrong php version.

I am using Php version 8.2.20. What I do see is that there must be an extension ‘common’ according to the invoiceninja installation manual.

This is also not listed in my Php extensions. Is this a normal option to enable or is this already part of PHP itself?

I use several hosting providers, both of which do not have that. And I don’t see this on Google either.

Could this be the problem? Here is the php info: PHP 8.2.20 - phpinfo()

Yes, php8.2-common is a package that is required to be installed. It is installed as a separate package when installing PHP. It will not be listed in your list of modules when you run php -m. I also do not see php8.2-fpm installed.

The php8.2-common is not in the list of modules here and appropriately so, because it is not a module. But it is listed in the code snippet immediately below the list of modules for all of the packages that need installation.

It’s curious that you have PHP installed in the /opt directory. That’s more commonly (though not exclusively) done for user installed packages (often apps) and if a user doesn’t have privileges. Rereading through the replies I now see that you do not have access to the CLI, which makes this more difficult.

Thank you for your response. That is appreciated.

This concerns a shared hosting environment with a hosting provider. I do have a CLI, but it will be limited in terms of rights.

The strange thing is of course that version 5.9.4 still works, I also had to switch to PHP version 8.2 for that and then updating to 5.10.4 no longer works.

Is there another way to check whether php-common is installed?

I see that I am running cpanel on CloudLinux version 7.9. So I don’t know if -fpm is necessary.

@louwerj I have never used cpanel, so I am not really sure how it works. However, doing a 15 second internet search indicates there is a cpanel interface where you are able to list installed packages. Maybe that will help you?

The odd situation is that if 5.9.4 is working for you, it is relatively safe to assume that php8.2-common is already installed because that was also a requirement for previous versions.

I am not familiar with either of those or the relationship they may have to php-8.2-fpm. According to this help article you are able to install php-fpm via cpanel on cloudlinux. However, that also touches on my previous comment. If 5.9.4 is working, then maybe it’s also installed?

It’s a difficult problem. Same problem in my development environment. Although it does run on the same shared hosting environment. I am now working on placing it in a different environment. I’m curious and will keep you informed.