- π«π·France floown
Hello,
Since I have made my site in production, I have seen a lot the error500 appear in Seolyzer and Google Search Console.
Here is my Drupal logs:
TypeError : Symfony\Component\HttpFoundation\RedirectResponse::__construct(): Argument #2 ($status) must be of type int, null given, called in /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php on line 26 dans Symfony\Component\HttpFoundation\RedirectResponse->__construct() (/home/myuser/web/mysite/public_html/vendor/symfony/http-foundation/RedirectResponse.php ligne 35) #0 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php(26): Symfony\Component\HttpFoundation\RedirectResponse->__construct() #1 /home/myuser/web/mysite/public_html/web/modules/contrib/redirect/src/EventSubscriber/RedirectRequestSubscriber.php(166): Drupal\Core\Routing\TrustedRedirectResponse->__construct() #2 [internal function]: Drupal\redirect\EventSubscriber\RedirectRequestSubscriber->onKernelRequestCheckRedirect() #3 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func() #4 /home/myuser/web/mysite/public_html/vendor/symfony/http-kernel/HttpKernel.php(145): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() #5 /home/myuser/web/mysite/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #6 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle() #7 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #8 /home/myuser/web/mysite/public_html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #9 /home/myuser/web/mysite/public_html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch() #10 /home/myuser/web/mysite/public_html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup() #11 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #12 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #13 /home/myuser/web/mysite/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #14 /home/myuser/web/mysite/public_html/web/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle() #15 /home/myuser/web/mysite/public_html/web/index.php(19): Drupal\Core\DrupalKernel->handle() #16 {main}
So the patch integrated in the other issue pointed by #7 is not good for my problem.
Iβm not a developer, just a user. So I can't help more.
- Status changed to Active
almost 2 years ago 5:55am 20 February 2023 - Status changed to Fixed
over 1 year ago 1:40pm 6 August 2023 - Status changed to Postponed: needs info
over 1 year ago 8:57am 9 August 2023 - πΊπΈUnited States Kristen Pol Santa Cruz, CA, USA
@floown I'm not sure why you have marked this fixed. Several people have had the same issue. Did you find something that fixed this issue for you?
- π«π·France floown
Hi Kristen,
In fact, I have edit manually all the redirection that haven't switched to 301 code by default.
I have report to the 301 I had manually add in my .htaccess for respons quickly to error 500 I had.
My problem seems to be solved.
- πΊπΈUnited States Rick Hood
I have this issue, also from long ago Drupal 7 to 8 migration. Nobody ever reported any kind of issue, but I can see lots of errors in the logs.
Running this on my local database, then clearing cache seems to fix it:UPDATE redirect SET status_code = 301 WHERE status_code IS NULL;
There are 3024 NULL status codes that the above changes to 301.
My question: is this safe? I virtually never run commands in the database so it scares me a bit.
;-)
Thanks,
Rick