Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

The "product" has not been found

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.      * @throws NotFoundHttpException
  2.      */
  3.     protected function findOr404(RequestConfiguration $configuration): ResourceInterface
  4.     {
  5.         if (null === $resource $this->singleResourceProvider->get($configuration$this->repository)) {
  6.             throw new NotFoundHttpException(sprintf('The "%s" has not been found'$this->metadata->getHumanizedName()));
  7.         }
  8.         return $resource;
  9.     }
  10. }
  1.     public function showAction(Request $request): Response
  2.     {
  3.         $configuration $this->requestConfigurationFactory->create($this->metadata$request);
  4.         $this->isGrantedOr403($configurationResourceActions::SHOW);
  5.         $resource $this->findOr404($configuration);
  6.         $this->eventDispatcher->dispatch(ResourceActions::SHOW$configuration$resource);
  7.         $view View::create($resource);
in vendor/symfony/http-kernel/HttpKernel.php->showAction (line 158)
  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);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  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.         if ($this->surrogate) {
  2.             $this->surrogate->addSurrogateCapability($request);
  3.         }
  4.         // always a "master" request (as the real master request can be in cache)
  5.         $response SubRequestHandler::handle($this->kernel$requestHttpKernelInterface::MASTER_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.     protected function forward(Request $request$raw falseResponse $entry null)
  2.     {
  3.         $this->getKernel()->boot();
  4.         $this->getKernel()->getContainer()->set('cache'$this);
  5.         return parent::forward($request$raw$entry);
  6.     }
  7.     /**
  8.      * Returns an array of options to customize the Cache configuration.
  9.      *
  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.                 reload the cache by fetching a fresh response and caching it (if possible).
  2.             */
  3.             $this->record($request'reload');
  4.             $response $this->fetch($request$catch);
  5.         } else {
  6.             $response $this->lookup($request$catch);
  7.         }
  8.         $this->restoreResponseBody($request$response);
  9.         if (HttpKernelInterface::MASTER_REQUEST === $type) {
HttpCache->handle(object(Request)) in web/app.php (line 28)
  1. $kernel = new AppCache($kernel);
  2. Request::enableHttpMethodParameterOverride();
  3. $request Request::createFromGlobals();
  4. $response $kernel->handle($request);
  5. $response->send();
  6. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

NotFoundHttpException

Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
The "product" has not been found

  at vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php:558
  at Sylius\Bundle\ResourceBundle\Controller\ResourceController->findOr404(object(RequestConfiguration))
     (vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php:130)
  at Sylius\Bundle\ResourceBundle\Controller\ResourceController->showAction(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:85)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(AppKernel), object(Request), 1, true)
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:477)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null)
     (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:62)
  at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true)
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:450)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true)
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:344)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true)
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:222)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request))
     (web/app.php:28)