Composer error after upgrade

I noticed there was an update since it was not a recent notice, I updated the system.
The result:
Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.2.0”
I have upgraded my PHP to 8.3

root@InvoiceNinja ~# php -v
PHP 8.3.10 (cli) (built: Aug 2 2024 15:59:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.10, Copyright (c) Zend Technologies
with Zend OPcache v8.3.10, Copyright (c), by Zend Technologies
I am using a Turnkeylinux install.
Have been reading all blogs for the past 24 hours, and still had no help so I’ve come home.
Anxiously awaiting your response.

I’m using PHP8.3 with composer without any problems. Do you still have previous versions of PHP installed? Do you have all the correct dependencies installed? Do your config files reference the correct version of PHP?

Are there any specific errors in your laravel.log?

Please where can I find the laravel logs?
Tried installing the php-xml package and it seems to have been installed to php7.4 really can’t figure this out.
Thanks for your help

You can run ls -la /etc/php and that will list all versions of PHP that are possibly installed. Just because a directory is listed does not mean it’s actually installed.

You can find the laravel.log in storage/logs.

In other words, /my_path_to_invoiceninja/storage/logs/laravel.log. You can either print the contents of the file using the cat command or you can read it with nano or vim or your preferred way. You will want to scroll to the end of the logs and see the errors since you made the change. They will be listed by date/time, with oldest first and newest last.

You can also run php -m and this will list all of the PHP modules that you have installed to make sure all correct ones are there.

Apologies if that was all information that you know, just trying to help.

Thank you for your assistance.
PHP installations:
root@InvoiceNinja ~# update-alternatives --config php
There are 4 choices for the alternative php (providing /usr/bin/php).

Selection Path Priority Status

0 /usr/bin/php.default 100 auto mode
1 /usr/bin/php.default 100 manual mode
2 /usr/bin/php7.4 74 manual mode
3 /usr/bin/php8.1 81 manual mode

  • 4 /usr/bin/php8.3 83 manual mode

Press to keep the current choice[*], or type selection number:

My latest log entry from Laravel is attached.
Laravel logs(Invoice Ninja).txt (3.5 KB)

output of php -m:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
igbinary
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcach

In trying to update the extensions I noticed that they were being installed in php7.4, however, I used apt install php8.3-“extension” to get it done. I am wondering if I should delete the other PHP versions because it seems that regardless of what the system is saying 7.4 might still be the default although I was using 8.1 before the update.

Yes, recommended best practices with PHP is to only have one version installed, unless you’re very experienced and know what you’re doing. For most of us regular users, it reduces a lot of headaches.

I would recommend purging PHP7.3 and 8.1 from your system. Remove it specifically by name, otherwise you might remove parts of 8.3 in the process. Use apt purge to do that. If you have not used that previously, just be careful and make sure you understand what you’re doing.

Prior to version 8 and higher, you used to be able to just install php-module, but since 7 and 8 have existed side by side, it’s now recommended to use php8.3-module to avoid issues like you’re experiencing.

I didn’t have the list of required modules to hand at the moment, but that list looks pretty good. Just make sure you compare it with the installation instructions in the InvoiceNinja docs.

Edit: I also should add, there are some modules that were previously installed separately, are now bundled with php-common and/or php8.3 and a few other bigger packages. This is particularly noticeable with 8.3, you may see package not found or similar error on Ubuntu. But it should also notify you that it was installed as part of another package or offer an alternative package installation.

1 Like

ok this issue is driving me somewhere.

I removed all installs via purge etc.
php -v output
root@InvoiceNinja ~# php -v
PHP 8.3.10 (cli) (built: Aug 2 2024 15:59:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.10, Copyright (c) Zend Technologies
with Zend OPcache v8.3.10, Copyright (c), by Zend Technologies

yet I receive,
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.2.0”. You are running 8.1.29. in /var/www/invoiceninja/vendor/composer/platform_check.php on line 28

tried uploading the dump of the db to a new install and I get this

Desperate right now any help is greatly appreciated.

Anything in your laravel.log?

Are you using nginx or Apache2?

I am using Apache2

laravel log follows:

[previous exception] [object] (PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:612)
[stacktrace]
#0 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php(612): PDOStatement->execute()
#1 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#2 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php(783): Illuminate\Database\Connection->runQueryCallback()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php(619): Illuminate\Database\Connection->run()
#4 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php(564): Illuminate\Database\Connection->affectingStatement()
#5 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3756): Illuminate\Database\Connection->delete()
#6 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(357): Illuminate\Database\Query\Builder->delete()
#7 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(30): Illuminate\Queue\DatabaseQueue->Illuminate\Queue\{closure}()
#8 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(359): Illuminate\Database\Connection->transaction()
#9 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php(66): Illuminate\Queue\DatabaseQueue->deleteReserved()
#10 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(82): Illuminate\Queue\Jobs\DatabaseJob->delete()
#11 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\Queue\CallQueuedHandler->call()
#12 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\Queue\Jobs\Job->fire()
#13 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\Queue\Worker->process()
#14 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\Worker->runJob()
#15 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(138): Illuminate\Queue\Worker->daemon()
#16 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(121): Illuminate\Queue\Console\WorkCommand->runWorker()
#17 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#18 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#19 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#20 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#21 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#22 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#23 /var/www/invoiceninja/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#24 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\Component\Console\Command\Command->run()
#25 /var/www/invoiceninja/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()
#26 /var/www/invoiceninja/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#27 /var/www/invoiceninja/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#28 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#29 /var/www/invoiceninja/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#30 {main}
“}
[2024-08-07 22:13:41] production.ERROR: Call to undefined method Illuminate\Console\View\Components\Task::runTimeForHumans() {“userId”:1,“exception”:”[object] (Error(code: 0): Call to undefined method Illuminate\Console\View\Components\Task::runTimeForHumans() at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:45)
[stacktrace]
#0 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(736): Illuminate\Console\View\Components\Task->render()
#1 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(212): Illuminate\Database\Migrations\Migrator->write()
#2 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(179): Illuminate\Database\Migrations\Migrator->runUp()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(122): Illuminate\Database\Migrations\Migrator->runPending()
#4 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(118): Illuminate\Database\Migrations\Migrator->run()
#5 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(615): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}()
#6 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(130): Illuminate\Database\Migrations\Migrator->usingConnection()
#7 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(88): Illuminate\Database\Console\Migrations\MigrateCommand->runMigrations()
#8 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle()
#9 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#10 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#11 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#12 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#13 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#14 /var/www/invoiceninja/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#15 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\Component\Console\Command\Command->run()
#16 /var/www/invoiceninja/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()
#17 /var/www/invoiceninja/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#18 /var/www/invoiceninja/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#19 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/Application.php(163): Symfony\Component\Console\Application->run()
#20 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(426): Illuminate\Console

Can you please share the most recent information from the log? It will be found at the very bottom of the log. That indicates the information you shared is one week old. It is more helpful to have the logs from when you were trying to do this.

This indicates that potentially more than one database user was trying to access the same field at the same time to perform the same action and this error is a result.

*Can you please share what your apache config file looks like?

When you share it, please start a new line and select the </> button in the editor and place the information below the back ticks that look like this ```. Make sure there are also back ticks on the final line of the code to close it (they should automatically show up). This makes it much easier to read, when sharing code.

That log is the last entry, even after rebooting this is what shows up.

apache2.txt (7.1 KB)