Whoops, looks like something went wrong.

Get help in the TYPO3 Wiki

If you need help solving this exception, you can have a look at the TYPO3 Wiki. 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 wiki page.

Find a solution for this exception in the TYPO3 wiki.

(1/1) #1588095935 TYPO3\CMS\Core\Http\Security\MissingReferrerException

Missing referrer for /main

in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/Security/ReferrerEnforcer.php line 81
        }
        $subject = $options['subject'] ?? '';
        if ($referrer === '') {
            // still empty referrer or invalid referrer, deny route invocation
            throw new MissingReferrerException(
                sprintf('Missing referrer%s', $subject !== '' ? ' for ' . $subject : ''),
                1588095935
            );
        }
at TYPO3\CMS\Core\Http\Security\ReferrerEnforcer->handle(array('flags' => array('required', 'refresh-empty'), 'subject' => '/main'))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Http/RouteDispatcher.php line 131
        /** @var ReferrerEnforcer $referrerEnforcer */
        $referrerEnforcer = GeneralUtility::makeInstance(ReferrerEnforcer::class, $request);
        return $referrerEnforcer->handle([
            'flags' => $referrerFlags,
            'subject' => $route->getPath(),
        ]);
    }

    /**
at TYPO3\CMS\Backend\Http\RouteDispatcher->enforceReferrer(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Http/RouteDispatcher.php line 52
        $route = $router->matchRequest($request);
        $request = $request->withAttribute('route', $route);
        $request = $request->withAttribute('target', $route->getOption('target'));

        $enforceReferrerResponse = $this->enforceReferrer($request);
        if ($enforceReferrerResponse instanceof ResponseInterface) {
            return $enforceReferrerResponse;
        }
        if (!$this->isValidRequest($request)) {
at TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(object(TYPO3\CMS\Core\Http\ServerRequest), object(TYPO3\CMS\Core\Http\Response))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Http/RequestHandler.php line 73
        }
        try {
            // Check if the router has the available route and dispatch.
            $dispatcher = GeneralUtility::makeInstance(RouteDispatcher::class);
            return $dispatcher->dispatch($request, $response);
        } catch (InvalidRequestTokenException $e) {
            // When token was invalid redirect to login
            $url = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir;
            return new RedirectResponse($url);
at TYPO3\CMS\Backend\Http\RequestHandler->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/SiteResolver.php line 59
            $site = GeneralUtility::makeInstance(SiteMatcher::class)->matchByPageId($pageId, $rootLine);
            $request = $request->withAttribute('site', $site);
            $GLOBALS['TYPO3_REQUEST'] = $request;
        }
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\SiteResolver->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(TYPO3\CMS\Backend\Http\RequestHandler))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/AdditionalResponseHeaders.php line 39
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);
        foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'] ?? [] as $header) {
            [$headerName, $value] = explode(':', $header, 2);
            $response = $response->withAddedHeader($headerName, trim($value));
        }
at TYPO3\CMS\Backend\Middleware\AdditionalResponseHeaders->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/OutputCompression.php line 45
        ob_clean();
        // Initialize output compression if configured
        $this->initializeOutputCompression();

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

    /**
     * Initialize output compression if configured
at TYPO3\CMS\Backend\Middleware\OutputCompression->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/LegacyBackendTemplateInitialization.php line 42
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $GLOBALS['TBE_TEMPLATE'] = GeneralUtility::makeInstance(DocumentTemplate::class);
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\LegacyBackendTemplateInitialization->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php line 70
        Bootstrap::initializeLanguageObject();
        // Register the backend user as aspect
        $this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), $GLOBALS['BE_USER']);

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

    /**
     * Check if the user is required for the request
at TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/BackendRouteInitialization.php line 73

        // Add the route path to the request
        $request = $request->withAttribute('routePath', $pathToRoute);

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\BackendRouteInitialization->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/ForcedHttpsBackendRedirector.php line 53
            list($server, $address) = explode('/', $url, 2);
            return new RedirectResponse('https://' . $server . $sslPortSuffix . '/' . $address);
        }

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\ForcedHttpsBackendRedirector->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Middleware/LockedBackendGuard.php line 71
            $request->getAttribute('normalizedParams')->getRemoteAddress(),
            trim((string)$GLOBALS['TYPO3_CONF_VARS']['BE']['IPmaskList'])
        );

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

    /**
     * Check adminOnly configuration variable and redirects to an URL in file typo3conf/LOCK_BACKEND
at TYPO3\CMS\Backend\Middleware\LockedBackendGuard->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php line 58
        // refactored to have ServerRequest object available where it is needed. This global will be
        // deprecated then and removed.
        $GLOBALS['TYPO3_REQUEST'] = $request;

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                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/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f757ec6c056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 67
     * @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(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/AbstractApplication.php line 108
    {
        $requestHandler = GeneralUtility::makeInstance($this->requestHandler);
        $dispatcher = $this->createMiddlewareDispatcher($requestHandler);

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

    /**
     * Set up the application and shut it down afterwards
at TYPO3\CMS\Core\Http\AbstractApplication->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/backend/Classes/Http/Application.php line 68
            return $this->installToolRedirect();
        }
        // Set up the initial context
        $this->initializeContext();
        return parent::handle($request);
    }

    /**
     * Check if LocalConfiguration.php and PackageStates.php exist
at TYPO3\CMS\Backend\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Http/AbstractApplication.php line 120
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /var/www/typo3/typo3_src-9.5.17/typo3/index.php line 24
// Set up the application for the backend
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});
at {closure}()
in /var/www/typo3/typo3_src-9.5.17/typo3/index.php line 25
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});