recognize
recognize copied to clipboard
Recognize spams the logs with "Implicitly marking parameter $factory as nullable is deprecated, the explicit nullable"
Which version of recognize are you using?
9.0.0
Enabled Modes
Object recognition
TensorFlow mode
Normal mode
Downstream App
Files App
Which Nextcloud version do you have installed?
31.0.0 RC4
Which Operating system do you have installed?
Ubuntu 24.04
Which database are you running Nextcloud on?
Postgres 17
Which Docker container are you using to run Nextcloud? (if applicable)
How much RAM does your server have?
64GB
What processor Architecture does your CPU have?
x86_64
Describe the Bug
After installing Recognize 9.0.0, Nextcloud spams the logs with:
OCA\Recognize\Vendor\Amp\Parallel\Worker\factory(): Implicitly marking parameter $factory as nullable is deprecated, the explicit nullable type must be used instead at /var/www/html/nextcloud/apps/recognize/vendor/amphp/parallel/lib/Worker/functions.php#84
This runs every 5 minutes like the cronjob. I use PHP8.4
Expected Behavior
No errors in the logs :)
To Reproduce
Debug log
No response
Hi Marcel 👋
I will look into it, thank you for the feedback!
Any news on this?
This is an issue with a dependency of recognize, so fingers crossed an update will fix this.
Fingers crossed :D
I upgraded to 9.0.1 but I still get errors 😅
Latest version
Deleted the log file, restarted Apache and PHP FPM
Damn :/
same problem here
I also have the issue.
Looks like it's a known PHP 8.4 deprecation, noted here >> (https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated)
This looks like it was fixed in the dependency via https://github.com/amphp/parallel/commit/014bd5d5108cb7fb96ced1c0e228386b5112cd52 in >= v2.0.0.
However, we're on 1.4.x:
https://github.com/nextcloud/recognize/blob/37139575bbf5a4ba67edaffcd731c8c9ff397b20/composer.json#L7
Bumping >=v2.x may require some work:
https://github.com/amphp/parallel/releases/tag/v2.0.0
My logs are getting spammed by a different error message now:
OCA\Recognize\Vendor\voku\helper\UTF8::reduce_string_array(): Implicitly marking parameter $remove_short_values as nullable is deprecated, the explicit nullable type must be used instead at /var/www/nextcloud/apps/recognize/vendor/voku/portable-utf8/src/voku/helper/UTF8.php#10690
Recognize: 9.0.3 Nextcloud: 31.0.6
PHP 8.2+ is stricter with type hints: if a function argument can be null, it must be declared as ?type $name instead of just having a default null value.
based on my logs I had to patch six functions (might be more) in apps/recognize/vendor/voku/portable-utf8/src/voku/helper/UTF8.php:
- in
function reduce_string_arrayfromint $remove_short_values = nullto
?int $remove_short_values = null
- in
function wordwrap_per_lineto
?string $delimiter = null
- and in
function ucfirstto
?string $lang = null
- and in
function trimto
?string $chars = null
- and in
function titlecaseto
?string $lang = null
- and in
function substr_in_byteto
?int $length = null
I hope this can be fixed in next release.
Hi @marcelklehr I just wanted to tell you, since v10.0.4 this error does not occur anymore. Resolved for me, you can close this issue if you want :)
Will this change be backported to Nextcloud version 31? Because we are still on 9.0.7, at the time I am writing this.
Will this change be backported to Nextcloud version 31?
Ah, yes. I'm on it.
v9.0.8 is out now