Symfony Exception

ProductNotFoundException

HTTP 404 Not Found

Product for id 0056326499de4c25a132413089d256e4 not found.

Exception

Shopware\Core\Content\Product\Exception\ ProductNotFoundException

  1.         $product $this->repository
  2.             ->search($criteria$context)
  3.             ->first();
  4.         if (!$product instanceof SalesChannelProductEntity) {
  5.             throw new ProductNotFoundException($productId);
  6.         }
  7.         $configurator $this->configuratorLoader->load($product$context);
  8.         return new ProductDetailRouteResponse($product$configurator);
  1.             // @deprecated tag:v6.4.0 - `ProductPageCriteriaEvent` or `MinimalQuickViewPageCriteriaEvent` will be dispatched in corresponding page loader classes
  2.             $instance = new $event($productId$criteria$salesChannelContext);
  3.             $this->eventDispatcher->dispatch($instance);
  4.         }
  5.         $result $this->productRoute->load($productId, new Request(), $salesChannelContext$criteria);
  6.         $result->getProduct()->setConfigurator(
  7.             $result->getConfigurator()
  8.         );
  1.         $productId $request->attributes->get('productId');
  2.         if (!$productId) {
  3.             throw new MissingRequestParameterException('productId''/productId');
  4.         }
  5.         $product $this->productLoader->load($productId$salesChannelContextProductPageCriteriaEvent::class);
  6.         $page->setProduct($product);
  7.         $page->setConfiguratorSettings($product->getConfigurator());
  8.         $request->request->set('parentId'$product->getParentId());
  9.         $reviews $this->productReviewLoader->load($request$salesChannelContext);
  1.      * @HttpCache()
  2.      * @Route("/detail/{productId}", name="frontend.detail.page", methods={"GET"})
  3.      */
  4.     public function index(SalesChannelContext $contextRequest $request): Response
  5.     {
  6.         $page $this->productPageLoader->load($request$context);
  7.         $ratingSuccess $request->get('success');
  8.         return $this->renderStorefront('@Storefront/storefront/page/product-detail/index.html.twig', ['page' => $page'ratingSuccess' => $ratingSuccess]);
  9.     }
  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.         // 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) {
  1.             && $container->getParameter('shopware.http.cache.enabled');
  2.         if ($enabled) {
  3.             $kernel = new HttpCache($kernel$container->get(CacheStore::class), null, ['debug' => $this->debug]);
  4.         }
  5.         $response $kernel->handle($transformed$type$catch);
  6.         // fire event to trigger runtime events like seo url headers
  7.         $event = new BeforeSendResponseEvent($transformed$response);
  8.         $container->get('event_dispatcher')->dispatch($event);
in vendor/shopware/core/HttpKernel.php -> doHandle (line 80)
  1.     }
  2.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true): HttpKernelResult
  3.     {
  4.         try {
  5.             return $this->doHandle($request, (int) $type, (bool) $catch);
  6.         } catch (DBALException $e) {
  7.             $connectionParams self::getConnection()->getParams();
  8.             $message str_replace([$connectionParams['url'], $connectionParams['password'], $connectionParams['user']], '******'$e->getMessage());
HttpKernel->handle(object(Request)) in public/index.php (line 83)
  1. }
  2. $request Request::createFromGlobals();
  3. $kernel = new HttpKernel($appEnv$debug$classLoader);
  4. $result $kernel->handle($request);
  5. $result->getResponse()->send();
  6. $kernel->terminate($result->getRequest(), $result->getResponse());

Logs

No log messages

Stack Trace

ProductNotFoundException

Shopware\Core\Content\Product\Exception\ProductNotFoundException:
Product for id 0056326499de4c25a132413089d256e4 not found.

  at vendor/shopware/core/Content/Product/SalesChannel/Detail/ProductDetailRoute.php:87
  at Shopware\Core\Content\Product\SalesChannel\Detail\ProductDetailRoute->load('0056326499de4c25a132413089d256e4', object(Request), object(SalesChannelContext), object(Criteria))
     (vendor/shopware/storefront/Page/Product/ProductLoader.php:58)
  at Shopware\Storefront\Page\Product\ProductLoader->load('0056326499de4c25a132413089d256e4', object(SalesChannelContext), 'Shopware\\Storefront\\Page\\Product\\ProductPageCriteriaEvent')
     (vendor/shopware/storefront/Page/Product/ProductPageLoader.php:101)
  at Shopware\Storefront\Page\Product\ProductPageLoader->load(object(Request), object(SalesChannelContext))
     (vendor/shopware/storefront/Controller/ProductController.php:88)
  at Shopware\Storefront\Controller\ProductController->index(object(SalesChannelContext), 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(Kernel), object(Request), 1, true)
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:477)
  at Symfony\Component\HttpKernel\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), 1, true)
     (vendor/shopware/core/HttpKernel.php:163)
  at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true)
     (vendor/shopware/core/HttpKernel.php:80)
  at Shopware\Core\HttpKernel->handle(object(Request))
     (public/index.php:83)