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

Fatal error: Declaration of Symfony\Bridge\Monolog\Logger::getLogs() must be compatible with .... #839

Open
dmitriim opened this issue Oct 8, 2023 · 4 comments · Fixed by #845
Labels
bug Something isn't working

Comments

@dmitriim
Copy link
Member

dmitriim commented Oct 8, 2023

Running PHPunit in Moodle 4.1.6 causing:

Fatal error: Declaration of Symfony\Bridge\Monolog\Logger::getLogs() must be compatible with Symfony\Component\HttpKernel\Log\DebugLoggerInterface::getLogs(?Symfony\Component\HttpFoundation\Request $request = NULL) in /var/www/site/admin/tool/dataflows/vendor/symfony/monolog-bridge/Logger.php on line 27
PHP Fatal error:  Declaration of Symfony\Bridge\Monolog\Logger::getLogs() must be compatible with Symfony\Component\HttpKernel\Log\DebugLoggerInterface::getLogs(?Symfony\Component\HttpFoundation\Request $request = NULL) in /var/www/site/admin/tool/dataflows/vendor/symfony/monolog-bridge/Logger.php on line 27
@dmitriim dmitriim added the bug Something isn't working label Oct 8, 2023
@dmitriim
Copy link
Member Author

dmitriim commented Oct 10, 2023

Seems like the issue is in auth_saml2 installed to the same instance and the recent upgrade of its dependencies catalyst/moodle-auth_saml2#774

 vendor/bin/phpunit --testsuite auth_saml2_testsuite,tool_dataflows_testsuite
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-(
Moodle 4.1.6 (Build: 20231009), 41caba2acebe6b50bafd44ff21c91c96a283d2ca
Php: 7.4.30, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.2.0-33-generic x86_64
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

...............................................................  63 / 458 ( 13%)
......SSS.....SSSSS....SSSSSSS.......S......................... 126 / 458 ( 27%)
.....PHP Fatal error:  Declaration of Symfony\Bridge\Monolog\Logger::getLogs() must be compatible with Symfony\Component\HttpKernel\Log\DebugLoggerInterface::getLogs(?Symfony\Component\HttpFoundation\Request $request = NULL) in /var/www/moodle/admin/tool/dataflows/vendor/symfony/monolog-bridge/Logger.php on line 27

Fatal error: Declaration of Symfony\Bridge\Monolog\Logger::getLogs() must be compatible with Symfony\Component\HttpKernel\Log\DebugLoggerInterface::getLogs(?Symfony\Component\HttpFoundation\Request $request = NULL) in /var/www/moodle/admin/tool/dataflows/vendor/symfony/monolog-bridge/Logger.php on line 27

@andrewnormore
Copy link

Hey I've just run into this issue, looking at it now. I've seen the auth saml stuff bouncing around some chats will get it figured out soon.

@gbarat87
Copy link
Contributor

gbarat87 commented Oct 13, 2023

I have investigated some parts here :
the plugin dataflows is using the php version 7.1 and so has a monolog version older than the one in saml2/simplesamlphp.
The plugins have then a conflict as the 2 version doesn't match.

I have updated php to 7.4 in dataflows. It fixed the conflict but raised other issues :
The class mtrace_handler.php needs to be updated. It extends AbstractHandler to use setFormatter().
(AbstractHandler doesn't hold the setFormatter() method anymore )

@gbarat87
Copy link
Contributor

If I replace AbstractHandler by AbstractProcessingHandler, all the test are green again. But we need to make sure that it's actually working nicely.

This was linked to pull requests Oct 13, 2023
gbarat87 added a commit that referenced this issue Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants