string(3) "hey" (404 Not Found)

Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

Show exception properties
Symfony\Component\HttpKernel\Exception\NotFoundHttpException {#2793 -statusCode: 404 -headers: [] } 
  1. {
  2. var_dump('hey');
  3. if (str_contains($baseDir, '..') || str_contains($no, '..') || str_contains($filename, '..')) {
  4. throw new NotFoundHttpException();
  5. } elseif (Path::join('/', $baseDir) !== $this->baseDir) {
  6. throw new NotFoundHttpException();
  7. }
  8. $serverBaseDir = $this->baseDir;
  9. $relativePath = Path::join($baseDir, $no, 'pictures', $filename);
  10. $fileToServe = Path::join($serverBaseDir, $no, 'pictures', $filename);
in vendor/symfony/http-kernel/HttpKernel.php -> serveImageFile (line 183)
  1. $this->dispatcher->dispatch($event, KernelEvents::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($event, KernelEvents::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. $this->dispatcher->dispatch($event);
  2. return $event->getResponse();
  3. }
  4. return parent::handle($request, $type, $catch);
  5. }
  6. }
  1. if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
  2. Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3. }
  4. try {
  5. return $kernel->handle($request, $type, $catch);
  6. } finally {
  7. // restore global state
  8. Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
  9. }
  10. }
  1. protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response
  2. {
  3. $this->surrogate?->addSurrogateCapability($request);
  4. // always a "master" request (as the real master request can be in cache)
  5. $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
  6. /*
  7. * Support stale-if-error given on Responses or as a config option.
  8. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9. * Cache-Control directives) that
  1. // avoid that the backend sends no content
  2. $subRequest->headers->remove('If-Modified-Since');
  3. $subRequest->headers->remove('If-None-Match');
  4. $response = $this->forward($subRequest, $catch);
  5. if ($response->isCacheable()) {
  6. $this->store($request, $response);
  7. }
  1. }
  2. if (null === $entry) {
  3. $this->record($request, 'miss');
  4. return $this->fetch($request, $catch);
  5. }
  6. if (!$this->isFreshEnough($request, $entry)) {
  7. $this->record($request, 'stale');
  1. $response = $this->fetch($request, $catch);
  2. } else {
  3. $response = null;
  4. do {
  5. try {
  6. $response = $this->lookup($request, $catch);
  7. } catch (CacheWasLockedException) {
  8. }
  9. } while (null === $response);
  10. }
  1. // only handle main request inside http cache, because ESI tags are also interpreted as main request.
  2. // sub requests are requests, which are forwarded to the kernel inside the php stack
  3. // https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894
  4. if ($type === HttpKernelInterface::MAIN_REQUEST) {
  5. $response = parent::handle($request, $type, $catch);
  6. } elseif ($request->attributes->has('_sw_esi')) {
  7. $response = parent::handle($request, $type, $catch);
  8. } else {
  9. $response = $this->getKernel()->handle($request, $type, $catch);
  10. }
in vendor/shopware/core/Kernel.php -> handle (line 129)
  1. public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
  2. {
  3. $this->boot();
  4. return $this->getHttpKernel()->handle($request, $type, $catch);
  5. }
  6. public function boot(): void
  7. {
  8. if (!$this->booted) {
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/html/vendor/autoload_runtime.php') in public/index.php (line 10)
  1. use Shopware\Core\Installer\InstallerKernel;
  2. use Shopware\Core\Framework\Adapter\Kernel\KernelFactory;
  3. $_SERVER['SCRIPT_FILENAME'] = __FILE__;
  4. require_once __DIR__ . '/../vendor/autoload_runtime.php';
  5. if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
  6. $_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
  7. }

Stack Trace

NotFoundHttpException
 Symfony\Component\HttpKernel\Exception\NotFoundHttpException: at custom/plugins/erplugin/src/Features/Pim/PimServeController.php:112 at ErPlugin\Features\Pim\PimServeController->serveImageFile('pim', '0404011032', '2.jpg') (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/shopware/core/Framework/Adapter/Kernel/HttpKernel.php:72) at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(HttpKernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:466) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:443) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:341) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:216) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request), 1, true) (vendor/shopware/core/Framework/Adapter/Kernel/HttpCacheKernel.php:61) at Shopware\Core\Framework\Adapter\Kernel\HttpCacheKernel->handle(object(Request), 1, true) (vendor/shopware/core/Kernel.php:129) at Shopware\Core\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:32) at require_once('/var/www/html/vendor/autoload_runtime.php') (public/index.php:10)