Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud 27 - psr/Log issue #21

Closed
dico-hubnc opened this issue Aug 11, 2023 · 3 comments
Closed

Nextcloud 27 - psr/Log issue #21

dico-hubnc opened this issue Aug 11, 2023 · 3 comments
Assignees

Comments

@dico-hubnc
Copy link

Hello,

I've got a new Debian 12 with fresh Nextcloud 27.0.2 installed on a VPS (PHP 8.2 as default).
When I put the 'auto prepend' in my apache VirtualHost file, I get HTTP 500 Error on each http request.

In /var/log/apache2/nextcloud.error.log :
[php:error] [pid 14186] [client IPxxxxx:53046] PHP Fatal error: Declaration of OC\Log\PsrLoggerAdapter::alert($message, array $context = []) must be compatible with Psr\Log\LoggerInterface::alert(Stringable|string $message, array $context = []): void in /var/www/nextcloud/lib/private/Log/PsrLoggerAdapter.php on line 87

Is there an incompatibility between Nextcloud and this bouncer ?
Is there a workaround to have this working ?

Many thanks,
Dicohub

@julienloizelet
Copy link
Collaborator

Thanks @dico-hubnc for reporting this issue.

I will try to test it asap.

@julienloizelet
Copy link
Collaborator

Hi @dico-hubnc,
I was able to reproduce the bug.

Nextcloud sources includes a 1.1.4 version of the psr/log package (https://github.com/nextcloud/3rdparty/blob/7293b4ffe86c0b48c3172bd8f180a12e0907fd60/composer.lock#L3412)

The standalone bouncer depends on psr/log too. But, during installation, composer picks up the highest compatible version available. With php 8.2, it is 3.0.0.

As we are using the auto_prepend_file mechanism, it ends with the incompatibility issue you reported (because there are 2 different and incompatible versions of the same package that are loaded together).

For the standalone bouncer to work here, we have to downgrade its version of psr/log.

If you followed the installation guide, it can be done by running the following command from the source folder of the bouncer (/path/to/the/crowdsec-standalone-bouncer in the installation guide):

composer update --with psr/log:1.1.4

Please let me know if it solves your problem.

Thanks

@dico-hubnc
Copy link
Author

Hello,

Many thanks, it's working now.

Have a nice day,
Regards,
Dicohub

@julienloizelet julienloizelet pinned this issue Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants