Whoops, looks like something went wrong.

Get help in the TYPO3 Documentation

If you need help solving this exception, you can have a look at the TYPO3 Documentation. There you can find solutions provided by the TYPO3 community. Once you have found a solution to the problem, help others by contributing to the documentation page.

Find a solution for this exception in the TYPO3 Documentation.

(1/1) #1522826413 InvalidArgumentException

PageContentErrorHandler needs to have a proper link set.

in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php line 66
    public function __construct(int $statusCode, array $configuration)
    {
        $this->statusCode = $statusCode;
        if (empty($configuration['errorContentSource'])) {
            throw new \InvalidArgumentException('PageContentErrorHandler needs to have a proper link set.', 1522826413);
        }
        $this->errorHandlerConfiguration = $configuration;
    }

at TYPO3\CMS\Core\Error\PageErrorHandler\PageContentErrorHandler->__construct()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 3475
            return self::$container->get($className);
        }

        // Create new instance and call constructor with parameters
        $instance = new $finalClassName(...$constructorArguments);
        // Register new singleton instance, but only if it is not a known PSR-11 container service
        if ($instance instanceof SingletonInterface && !(self::$container !== null && self::$container->has($className))) {
            self::$singletonInstances[$finalClassName] = $instance;
        }
at TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Site/Entity/Site.php line 300
        switch ($errorHandlerConfiguration['errorHandler'] ?? null) {
            case self::ERRORHANDLER_TYPE_FLUID:
                return GeneralUtility::makeInstance(FluidPageErrorHandler::class, $statusCode, $errorHandlerConfiguration);
            case self::ERRORHANDLER_TYPE_PAGE:
                return GeneralUtility::makeInstance(PageContentErrorHandler::class, $statusCode, $errorHandlerConfiguration);
            case self::ERRORHANDLER_TYPE_PHP:
                $handler = GeneralUtility::makeInstance($errorHandlerConfiguration['errorPhpClassFQCN'], $statusCode, $errorHandlerConfiguration);
                // Check if the interface is implemented
                if (!($handler instanceof PageErrorHandlerInterface)) {
at TYPO3\CMS\Core\Site\Entity\Site->getErrorHandler()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Controller/ErrorController.php line 152
    {
        $site = $request->getAttribute('site');
        if ($site instanceof Site) {
            try {
                return $site->getErrorHandler($statusCode);
            } catch (PageErrorHandlerNotConfiguredException $e) {
                // No error handler found, so fallback back to the generic TYPO3 error handler.
            }
        }
at TYPO3\CMS\Frontend\Controller\ErrorController->getErrorHandlerFromSite()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Controller/ErrorController.php line 95
     * @throws PageNotFoundException
     */
    public function pageNotFoundAction(ServerRequestInterface $request, string $message, array $reasons = []): ResponseInterface
    {
        $errorHandler = $this->getErrorHandlerFromSite($request, 404);
        if ($errorHandler instanceof PageErrorHandlerInterface) {
            return $errorHandler->handlePageError($request, $message, $reasons);
        }
        try {
at TYPO3\CMS\Frontend\Controller\ErrorController->pageNotFoundAction()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/PageResolver.php line 81
        } catch (RouteNotFoundException $e) {
            return GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
                $request,
                'The requested page does not exist',
                ['code' => PageAccessFailureReasons::PAGE_NOT_FOUND]
            );
        }

        if (!$pageArguments->getPageId()) {
at TYPO3\CMS\Frontend\Middleware\PageResolver->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php line 80

                return new HtmlResponse($content, 200, ['Content-Type' => $contentType]);
            }
        }
        return $handler->handle($request);
    }

    /**
     * Find the proper configuration for the static route in the static route configuration. Mainly:
at TYPO3\CMS\Frontend\Middleware\StaticRouteResolver->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/SiteBaseRedirectResolver.php line 94
                $uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/'));
                return new RedirectResponse($uri, 307);
            }
        }
        return $handler->handle($request);
    }

    /**
     * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
at TYPO3\CMS\Frontend\Middleware\SiteBaseRedirectResolver->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/redirects/Classes/Http/Middleware/RedirectHandler.php line 81
                return $response;
            }
        }

        return $handler->handle($request);
    }

    /**
     * Creates a PSR-7 compatible Response object
at TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelInitiator.php line 55
                MainController::class
            );
            $request = $adminPanelController->initialize($request);
        }
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Adminpanel\Middleware\AdminPanelInitiator->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php line 77
        // Register the frontend user as aspect and within the session
        $this->setFrontendUserAspect($frontendUser);
        $request = $request->withAttribute('frontend.user', $frontendUser);

        $response = $handler->handle($request);

        // Store session data for fe_users if it still exists
        if ($frontendUser instanceof FrontendUserAuthentication) {
            $frontendUser->storeSessionData();
at TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php line 66
            Bootstrap::loadExtTables();
            $this->setBackendUserAspect($GLOBALS['BE_USER']);
        }

        $response = $handler->handle($request);

        // If, when building the response, the user is still available, then ensure that the headers are sent properly
        if ($this->context->getAspect('backend.user')->isLoggedIn()) {
            return $this->applyHeadersToResponse($response);
at TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/MaintenanceMode.php line 55
        ) {
            return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.');
        }
        // Continue the regular stack if no maintenance mode is active
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Frontend\Middleware\MaintenanceMode->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/SiteResolver.php line 65
        $request = $request->withAttribute('routing', $routeResult);
        if ($routeResult->getLanguage() instanceof SiteLanguage) {
            Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage());
        }
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Frontend\Middleware\SiteResolver->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/EidHandler.php line 64
    {
        $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null;

        if ($eID === null) {
            return $handler->handle($request);
        }

        // Remove any output produced until now
        ob_clean();
at TYPO3\CMS\Frontend\Middleware\EidHandler->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php line 45
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request));
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Middleware/TimeTrackerInitialization.php line 58
        $this->timeTracker->setEnabled($timeTrackingEnabled);
        $this->timeTracker->start(microtime(true));
        $this->timeTracker->push('');

        $response = $handler->handle($request);

        // Finish time tracking
        $this->timeTracker->pull();
        $this->timeTracker->finish();
at TYPO3\CMS\Frontend\Middleware\TimeTrackerInitialization->process()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$2c1->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 78
     * @return ResponseInterface
     */
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->tip->handle($request);
    }

    /**
     * Seed the middleware stack with the inner request handler
at TYPO3\CMS\Core\Http\MiddlewareDispatcher->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/AbstractApplication.php line 85
     * @return ResponseInterface
     */
    protected function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->requestHandler->handle($request);
    }

    /**
     * Set up the application and shut it down afterwards
at TYPO3\CMS\Core\Http\AbstractApplication->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/frontend/Classes/Http/Application.php line 69
        // Create new request object having applicationType "I am a frontend request" attribute.
        $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE);

        $this->initializeContext();
        return parent::handle($request);
    }

    /**
     * Check if LocalConfiguration.php and PackageStates.php exist
at TYPO3\CMS\Frontend\Http\Application->handle()
in /var/www/default/htdocs/typo3_src-10.4.20/typo3/sysext/core/Classes/Http/AbstractApplication.php line 97
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /var/www/default/htdocs/typo3_src-10.4.20/index.php line 25
// Set up the application for the frontend
call_user_func(function () {
    $classLoader = require __DIR__.'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run();
});
at {closure}()
in /var/www/default/htdocs/typo3_src-10.4.20/index.php line 26
call_user_func(function () {
    $classLoader = require __DIR__.'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run();
});