- Issue created by @promes
- 🇩🇪Germany jurgenhaas Gottmadingen
Thanks @PROMES for reporting this. Unfortunately, I can't reproduce this and from your stack trace it looks like for some reason, Drupal core doesn't receive the current request in
\Drupal\Core\Routing\RequestContext::fromRequestStack
:public function fromRequestStack(RequestStack $request_stack) { $this->fromRequest($request_stack->getCurrentRequest()); }
The only thing that looks strange to me, is in line 20 of the stack trace:
# In the example above: index.php(19): Drupal\Core\DrupalKernel->handle() # In other cases, that I susually see: index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
That looks as if normally, calling
Kernal->handle
gets a request object handed over. But in the case above, nothing is being handed over. As if the index.php file is broken or something else is preventing that file from receivingRequest::createFromGlobals()
in line 18 of that file. Could you probably debug that?Also, is that an installation that's being done with or without composer?
- 🇳🇱Netherlands promes
@jurgenhaas. Thanks for your quick reply. I use composer to install my sites and modules.
As far as I can see, all TypeErrors occur when a bot(?) comes from an IP-address which is on a blacklist. Most of these IP-addesses are allready banned. I don't know how to debug such an event. But all blacklisted IPs give this error. -
jurgenhaas →
committed 36dd72d2 on 1.0.x
Issue #3379438 by PROMES, jurgenhaas: PHP TypeErrors
-
jurgenhaas →
committed 36dd72d2 on 1.0.x
- Status changed to Needs review
over 1 year ago 8:38am 8 August 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
comes from an IP-address which is on a blacklist
That's an interesting detail. It helped me to find out, that our logging mechanism is called too early where some of the service are not always available yet. I could have lowered the priority of the CrowdSec middleware to check for blocked IPs later, but that would be less secure. So, I decided to change to logging content so that we don't require those missing services.
Please give the latest dev release a try, if that fixes the issue for you as well.
- 🇳🇱Netherlands promes
Thanks. Now I get in 1 site 'Blocked' messages. I will continue to monitor the log messages and report later this week if any TypeError messages occur.
- 🇳🇱Netherlands promes
No more TypeErrors found. The blocking is now reported in the log, but the IPs are not banned.
- Status changed to Fixed
over 1 year ago 11:56am 11 October 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Marking as fixed. If the last comment indicates an additional problem, please start a new issue with instructions on how to reproduce the issue.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 8:02am 14 November 2023 - 🇩🇪Germany Martin Mayer Germany and Philippines
I tried the current dev version as suggested in #5, because I got the same error.
Whenever I use a drush command like drus cr or drush updb I get this error message:PHP Fatal error: Declaration of Consolidation\Log\Logger::log($level, Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::log($level, $message, array $context = []) in /home/deploy/famplus-2023/vendor/consolidation/log/src/Logger.php on line 146
- 🇩🇪Germany jurgenhaas Gottmadingen
Hi @Martin Mayer as this is a closed issue, it's not a good idea to ask additional questions here. Also, it doesn't seem to be related to this issue at all, so that would always require a new on.
But from what you're posting, I don't see how this is related to the CrowdSec module. It says that the declaration
log($level, Stringable|string $message, array $context = []): void
is not compatible, but that declaration doesn't exist in this module. Or am I missing something? If so, please provide all the necessary details in a new issue.