Error 500 Internal Server Error

GET https://imagohealthsystems.com/sitemap.xml

Exceptions

Manuxi\SuluNewsBundle\Sitemap\NewsSitemapProvider::getLocaleByHost(): Return value must be of type string, null returned

Exception

TypeError

  1.                 if($hostName === $host || $portal->getHost() === $host) {
  2.                     $this->locales[$host] = $portal->getLocale();
  3.                 }
  4.             }
  5.         }
  6.         return $this->locales[$host];
  7.     }
  8.     private function findNews(string $localeint $limit nullint $offset null): array
  9.     {
  10.         return $this->repository->findAllForSitemap($locale$limit$offset);
  1.         return 'news';
  2.     }
  3.     public function getMaxPage($scheme$host): ?float
  4.     {
  5.         $locale $this->getLocaleByHost($host);
  6.         return ceil($this->repository->countForSitemap($locale) / self::PAGE_SIZE);
  7.     }
  8.     private function getLocaleByHost($host): string
  9.     {
  1.         return $result;
  2.     }
  3.     public function createSitemap($scheme$host): Sitemap
  4.     {
  5.         return new Sitemap($this->getAlias(), $this->getMaxPage($scheme$host));
  6.     }
  7.     public function getAlias(): string
  8.     {
  9.         return 'news';
  1.             return $this->sitemapsPerHost[$key];
  2.         }
  3.         $sitemapsPerHost = [];
  4.         foreach ($this->providers as $alias => $provider) {
  5.             $sitemapsPerHost[] = $provider->createSitemap($scheme$host);
  6.         }
  7.         $this->sitemapsPerHost[$key] = $sitemapsPerHost;
  8.         return $this->sitemapsPerHost[$key];
  1.      * @return bool
  2.      */
  3.     private function needsIndex($scheme$host)
  4.     {
  5.         return \array_reduce(
  6.             $this->sitemapProviderPool->getIndex($scheme$host),
  7.             function($v1Sitemap $v2) {
  8.                 return $v1 $v2->getMaxPage();
  9.             }
  10.         );
  11.     }
  1.         $this->engine $engine;
  2.     }
  3.     public function renderIndex($scheme$host)
  4.     {
  5.         if (!$this->needsIndex($scheme$host)) {
  6.             return null;
  7.         }
  8.         return $this->render(
  9.             '@SuluWebsite/Sitemap/sitemap-index.xml.twig',
  1.     public function indexAction(Request $request)
  2.     {
  3.         $response $this->getDumpedIndexResponse($request);
  4.         if (!$response) {
  5.             $sitemap $this->xmlSitemapRenderer->renderIndex($request->getScheme(), $request->getHost());
  6.             if (!$sitemap) {
  7.                 $sitemapAlias null;
  8.                 foreach ($this->sitemapProviderPool->getProviders() as $sitemapAlias => $provider) {
  9.                     if ($provider->getMaxPage($request->getScheme(), $request->getHost()) > 0) {
in vendor/symfony/http-kernel/HttpKernel.php -> indexAction (line 183)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2.         $this->requestStack->push($request);
  3.         $response null;
  4.         try {
  5.             return $response $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  1.         if (!$this->handlingHttpCache) {
  2.             $this->resetServices true;
  3.         }
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle(object(Request)) in /home/imagohea/public_html/index.php (line 69)
  1. // When using the HttpCache, you need to call the method in your front controller
  2. // instead of relying on the configuration parameter
  3. // https://symfony.com/doc/6.4/reference/configuration/framework.html#http-method-override
  4. Request::enableHttpMethodParameterOverride();
  5. $request Request::createFromGlobals();
  6. $response $kernel->handle($request);
  7. $response->send();
  8. $kernel->terminate($request$response);

Logs

Level Channel Message
INFO 09:23:50 deprecation User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Task\TaskBundle\TaskBundle" now to avoid errors or add an explicit @return annotation to suppress this message.
{
    "exception": {}
}
INFO 09:23:50 deprecation User Deprecated: Method "PHPCR\Query\QueryManagerInterface::createQuery()" might add "QueryInterface" as a native return type declaration in the future. Do the same in implementation "Jackalope\Query\QueryManager" now to avoid errors or add an explicit @return annotation to suppress this message.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Method "IteratorAggregate::getIterator()" might add "\Traversable" as a native return type declaration in the future. Do the same in implementation "Sulu\Component\Webspace\Manager\WebspaceCollection" now to avoid errors or add an explicit @return annotation to suppress this message.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Sulu\Component\Localization\Localization" now to avoid errors or add an explicit @return annotation to suppress this message.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Webspace\Portal::getXDefaultLocalization" method is deprecated on "Sulu\Component\Webspace\Portal" use "getDefaultLocalization" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Webspace\Portal::setXDefaultLocalization" method is deprecated on "Sulu\Component\Webspace\Portal" use "setDefaultLocalization" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 deprecation User Deprecated: Since sulu/sulu 2.3: The "Sulu\Component\Localization\Localization::setXDefault" method is deprecated on "Sulu\Component\Localization\Localization" use "setDefault" instead.
{
    "exception": {}
}
INFO 09:23:51 doctrine Connecting with parameters {params}
{
    "params": {
        "use_savepoints": true,
        "driver": "pdo_mysql",
        "idle_connection_ttl": 600,
        "host": "127.0.0.1",
        "port": 3306,
        "user": "imagohea_chikulo",
        "password": "<redacted>",
        "driverOptions": {
            "1002": "SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))"
        },
        "serverVersion": "8.0.32",
        "defaultTableOptions": [],
        "dbname": "imagohea_imagohealthsystems",
        "charset": "utf8mb4"
    }
}
DEBUG 09:23:51 doctrine Executing statement: SELECT 1 FROM phpcr_workspaces WHERE name = ? (parameters: {params}, types: {types})
{
    "sql": "SELECT 1 FROM phpcr_workspaces WHERE name = ?",
    "params": {
        "1": "default_live"
    },
    "types": {
        "1": 2
    }
}
DEBUG 09:23:51 doctrine Executing query: SELECT prefix, uri FROM phpcr_namespaces
{
    "sql": "SELECT prefix, uri FROM phpcr_namespaces"
}
DEBUG 09:23:51 doctrine Executing statement: SELECT * FROM phpcr_nodes WHERE path = ? AND workspace_name = ? ORDER BY depth, sort_order ASC (parameters: {params}, types: {types})
{
    "sql": "\n              SELECT * FROM phpcr_nodes\n              WHERE path = ?\n                AND workspace_name = ?\n              ORDER BY depth, sort_order ASC",
    "params": {
        "1": "/cmf/website/custom-urls/routes/imagohealthsystems.com/_profiler/f560e5",
        "2": "default_live"
    },
    "types": {
        "1": 2,
        "2": 2
    }
}
INFO 09:23:51 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "f560e5"
    },
    "request_uri": "https://imagohealthsystems.com/_profiler/f560e5",
    "method": "GET"
}
INFO 09:23:51 deprecation User Deprecated: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Sulu\Component\Content\Compat\Property" now to avoid errors or add an explicit @return annotation to suppress this message.
{
    "exception": {}
}
INFO 09:23:51 deprecation Deprecated: Optional parameter $limit declared before required parameter $options is implicitly treated as a required parameter
{
    "exception": {}
}

Stack Trace

TypeError
TypeError:
Manuxi\SuluNewsBundle\Sitemap\NewsSitemapProvider::getLocaleByHost(): Return value must be of type string, null returned

  at vendor/manuxi/sulu-news-bundle/src/Sitemap/NewsSitemapProvider.php:66
  at Manuxi\SuluNewsBundle\Sitemap\NewsSitemapProvider->getLocaleByHost('imagohealthsystems.com')
     (vendor/manuxi/sulu-news-bundle/src/Sitemap/NewsSitemapProvider.php:51)
  at Manuxi\SuluNewsBundle\Sitemap\NewsSitemapProvider->getMaxPage('https', 'imagohealthsystems.com')
     (vendor/manuxi/sulu-news-bundle/src/Sitemap/NewsSitemapProvider.php:41)
  at Manuxi\SuluNewsBundle\Sitemap\NewsSitemapProvider->createSitemap('https', 'imagohealthsystems.com')
     (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Sitemap/SitemapProviderPool.php:71)
  at Sulu\Bundle\WebsiteBundle\Sitemap\SitemapProviderPool->getIndex('https', 'imagohealthsystems.com')
     (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Sitemap/XmlSitemapRenderer.php:95)
  at Sulu\Bundle\WebsiteBundle\Sitemap\XmlSitemapRenderer->needsIndex('https', 'imagohealthsystems.com')
     (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Sitemap/XmlSitemapRenderer.php:41)
  at Sulu\Bundle\WebsiteBundle\Sitemap\XmlSitemapRenderer->renderIndex('https', 'imagohealthsystems.com')
     (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Controller/SitemapController.php:95)
  at Sulu\Bundle\WebsiteBundle\Controller\SitemapController->indexAction(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (/home/imagohea/public_html/index.php:69)