Symfony Exception

ProductNotFoundException

HTTP 404 Not Found

Product for id 01898945089673f1a23007b878c9581d not found.

Exception

Shopware\Core\Content\Product\Exception\ ProductNotFoundException

Show exception properties
Shopware\Core\Content\Product\Exception\ProductNotFoundException {#5554
  -statusCode: 404
  -headers: []
  #parameters: array:1 [
    "productId" => "01898945089673f1a23007b878c9581d"
  ]
}
  1.             $product $this->productRepository
  2.                 ->search($criteria$context)
  3.                 ->first();
  4.             if (!($product instanceof SalesChannelProductEntity)) {
  5.                 throw new ProductNotFoundException($productId);
  6.             }
  7.             $product->setSeoCategory(
  8.                 $this->breadcrumbBuilder->getProductSeoCategory($product$context)
  9.             );
in vendor/shopware/core/Profiling/Profiler.php -> Shopware\Core\Content\Product\SalesChannel\Detail\{closure} (line 67)
  1.         try {
  2.             foreach (self::$profilers as $profiler) {
  3.                 $profiler->start($name$category$tags);
  4.             }
  5.             $result $closure();
  6.         } finally {
  7.             foreach (self::$profilers as $profiler) {
  8.                 $profiler->stop($name);
  9.             }
  10.         }
  1.     }
  2.     #[Route(path'/store-api/product/{productId}'name'store-api.product.detail'methods: ['POST'], defaults: ['_entity' => 'product'])]
  3.     public function load(string $productIdRequest $requestSalesChannelContext $contextCriteria $criteria): ProductDetailRouteResponse
  4.     {
  5.         return Profiler::trace('product-detail-route', function () use ($productId$request$context$criteria) {
  6.             $mainVariantId $this->checkVariantListingConfig($productId$context);
  7.             $productId $mainVariantId ?? $this->findBestVariant($productId$context);
  8.             $this->addFilters($context$criteria);
  1.         }
  2.         $value $this->cache->get($key, function (ItemInterface $item) use ($productId$request$context$criteria) {
  3.             $name self::buildName($productId);
  4.             $response $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId$request$context$criteria));
  5.             $item->tag($this->generateTags($productId$request$response$context$criteria));
  6.             return CacheValueCompressor::compress($response);
  7.         });
in vendor/shopware/core/System/SystemConfig/SystemConfigService.php -> Shopware\Core\Content\Product\SalesChannel\Detail\{closure} (line 416)
  1.     public function trace(string $key\Closure $param)
  2.     {
  3.         $this->traces[$key] = [];
  4.         $this->keys[$key] = true;
  5.         $result $param();
  6.         unset($this->keys[$key]);
  7.         return $result;
  8.     }
  1.         throw new DecorationPatternException(self::class);
  2.     }
  3.     public function trace(string $key\Closure $param)
  4.     {
  5.         return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key$param)));
  6.     }
  7.     public function get(string $key): array
  8.     {
  9.         return array_merge(
in vendor/shopware/core/Framework/Adapter/Translation/Translator.php -> Shopware\Core\Framework\Adapter\Cache\{closure} (line 96)
  1.     public function trace(string $key\Closure $param)
  2.     {
  3.         $this->traces[$key] = [];
  4.         $this->keys[$key] = true;
  5.         $result $param();
  6.         unset($this->keys[$key]);
  7.         return $result;
  8.     }
  1.         throw new DecorationPatternException(self::class);
  2.     }
  3.     public function trace(string $key\Closure $param)
  4.     {
  5.         return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key$param)));
  6.     }
  7.     public function get(string $key): array
  8.     {
  9.         return array_merge(
in vendor/shopware/core/Framework/Adapter/Cache/CacheTagCollection.php -> Shopware\Core\Framework\Adapter\Cache\{closure} (line 56)
  1.     public function trace(string $key\Closure $param)
  2.     {
  3.         $this->traces[$key] = [];
  4.         $this->keys[$key] = true;
  5.         $result $param();
  6.         unset($this->keys[$key]);
  7.         return $result;
  8.     }
  1.         throw new DecorationPatternException(self::class);
  2.     }
  3.     public function trace(string $key\Closure $param)
  4.     {
  5.         return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key$param)));
  6.     }
  7.     public function get(string $key): array
  8.     {
  9.         return array_merge(
  1.         return $this->decorated;
  2.     }
  3.     public function trace(string $key\Closure $param)
  4.     {
  5.         return $this->themeConfigAccessor->trace($key, fn () => $this->getDecorated()->trace($key$param));
  6.     }
  7.     public function get(string $key): array
  8.     {
  9.         return array_unique(array_merge(
in vendor/shopware/storefront/Theme/ThemeConfigValueAccessor.php -> Shopware\Storefront\Framework\Cache\{closure} (line 76)
  1.     public function trace(string $key\Closure $param)
  2.     {
  3.         $this->traces[$key] = [];
  4.         $this->keys[$key] = true;
  5.         $result $param();
  6.         unset($this->keys[$key]);
  7.         return $result;
  8.     }
  1.         return $this->decorated;
  2.     }
  3.     public function trace(string $key\Closure $param)
  4.     {
  5.         return $this->themeConfigAccessor->trace($key, fn () => $this->getDecorated()->trace($key$param));
  6.     }
  7.     public function get(string $key): array
  8.     {
  9.         return array_unique(array_merge(
  1.         }
  2.         $value $this->cache->get($key, function (ItemInterface $item) use ($productId$request$context$criteria) {
  3.             $name self::buildName($productId);
  4.             $response $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId$request$context$criteria));
  5.             $item->tag($this->generateTags($productId$request$response$context$criteria));
  6.             return CacheValueCompressor::compress($response);
  7.         });
in vendor/symfony/cache-contracts/CacheTrait.php -> Shopware\Core\Content\Product\SalesChannel\Detail\{closure} (line 70)
  1.             }
  2.         }
  3.         if ($recompute) {
  4.             $save true;
  5.             $item->set($callback($item$save));
  6.             if ($save) {
  7.                 $pool->save($item);
  8.             }
  9.         }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function get(string $key, callable $callbackfloat $beta null, array &$metadata null): mixed
  5.     {
  6.         return $this->doGet($this$key$callback$beta$metadata);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  1.         if ($key === null) {
  2.             return $this->getDecorated()->load($productId$request$context$criteria);
  3.         }
  4.         $value $this->cache->get($key, function (ItemInterface $item) use ($productId$request$context$criteria) {
  5.             $name self::buildName($productId);
  6.             $response $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId$request$context$criteria));
  7.             $item->tag($this->generateTags($productId$request$response$context$criteria));
  1.             ->addAssociation('mainCategories.category')
  2.             ->addAssociation('media');
  3.         $this->eventDispatcher->dispatch(new ProductPageCriteriaEvent($productId$criteria$context));
  4.         $result $this->productDetailRoute->load($productId$request$context$criteria);
  5.         $product $result->getProduct();
  6.         if ($product->getMedia()) {
  7.             $product->getMedia()->sort(fn (ProductMediaEntity $aProductMediaEntity $b) => $a->getPosition() <=> $b->getPosition());
  8.         }
  1.     }
  2.     #[Route(path'/detail/{productId}'name'frontend.detail.page'defaults: ['_httpCache' => true], methods: ['GET'])]
  3.     public function index(SalesChannelContext $contextRequest $request): Response
  4.     {
  5.         $page $this->productPageLoader->load($request$context);
  6.         $this->hook(new ProductPageLoadedHook($page$context));
  7.         $ratingSuccess $request->get('success');
  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$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::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.     }
  2.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true): Response
  3.     {
  4.         if (!KernelFactory::$active) {
  5.             return parent::handle($request$type$catch);
  6.         }
  7.         if ($request->attributes->get('exception') !== null) {
  8.             return parent::handle($request$type$catch);
  9.         }
  1.     }
  2.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true): Response
  3.     {
  4.         if (!KernelFactory::$active) {
  5.             return $this->getKernel()->handle($request$type$catch);
  6.         }
  7.         /**
  8.          * When we have an external reverse proxy which is ESI capable, we can't use the internal HttpCache, as it will resolve the ESI tags
  9.          */
in vendor/shopware/core/Kernel.php -> handle (line 157)
  1.     {
  2.         if (!$this->booted) {
  3.             $this->boot();
  4.         }
  5.         return $this->getHttpKernel()->handle($request$type$catch);
  6.     }
  7.     public function boot(): void
  8.     {
  9.         if ($this->booted === true) {
  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 $requestbool $catch false, ?Response $entry null)
  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$requestHttpKernelInterface::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.                 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::MAIN_REQUEST === $type) {
  1.             && $container->getParameter('shopware.http.cache.enabled');
  2.         if ($enabled && $container->has(CacheStore::class)) {
  3.             $kernel = new static::$httpCacheClass($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 67)
  1.     }
  2.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true): HttpKernelResult
  3.     {
  4.         try {
  5.             return $this->doHandle($request$type$catch);
  6.         } catch (Exception $e) {
  7.             /** @var Params|array{url?: string} $connectionParams */
  8.             $connectionParams self::getConnection()->getParams();
  9.             $message str_replace([$connectionParams['url'] ?? null$connectionParams['password'] ?? null$connectionParams['user'] ?? null], '******'$e->getMessage());
HttpKernel->handle() in public/index.php (line 71)
  1.             $this->httpKernel $httpKernel;
  2.         }
  3.         public function handle(Request $requestint $type self::MAIN_REQUESTbool $catch true): Response
  4.         {
  5.             return $this->httpKernel->handle($request$type$catch)->getResponse();
  6.         }
  7.         public function terminate(Request $requestResponse $response): void
  8.         {
  9.             $this->httpKernel->terminate($request$response);
  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 29)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/kunden/83226_94327/ShopPTMoeller2023/vendor/autoload_runtime.php') in public/index.php (line 14)
  1. use Symfony\Component\HttpKernel\HttpKernelInterface;
  2. use Symfony\Component\HttpKernel\TerminableInterface;
  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. }

Logs

No log messages

Stack Trace

ProductNotFoundException
Shopware\Core\Content\Product\Exception\ProductNotFoundException:
Product for id 01898945089673f1a23007b878c9581d not found.

  at vendor/shopware/core/Content/Product/SalesChannel/Detail/ProductDetailRoute.php:69
  at Shopware\Core\Content\Product\SalesChannel\Detail\ProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}()
     (vendor/shopware/core/Profiling/Profiler.php:67)
  at Shopware\Core\Profiling\Profiler::trace()
     (vendor/shopware/core/Content/Product/SalesChannel/Detail/ProductDetailRoute.php:54)
  at Shopware\Core\Content\Product\SalesChannel\Detail\ProductDetailRoute->load()
     (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:62)
  at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}()
     (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:416)
  at Shopware\Core\System\SystemConfig\SystemConfigService->trace()
     (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33)
  at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}()
     (vendor/shopware/core/Framework/Adapter/Translation/Translator.php:96)
  at Shopware\Core\Framework\Adapter\Translation\Translator->trace()
     (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33)
  at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}()
     (vendor/shopware/core/Framework/Adapter/Cache/CacheTagCollection.php:56)
  at Shopware\Core\Framework\Adapter\Cache\CacheTagCollection->trace()
     (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33)
  at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace()
     (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:35)
  at Shopware\Storefront\Framework\Cache\CacheTracer->Shopware\Storefront\Framework\Cache\{closure}()
     (vendor/shopware/storefront/Theme/ThemeConfigValueAccessor.php:76)
  at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace()
     (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:35)
  at Shopware\Storefront\Framework\Cache\CacheTracer->trace()
     (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:62)
  at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}()
     (vendor/symfony/cache-contracts/CacheTrait.php:70)
  at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->doGet()
     (vendor/symfony/cache-contracts/CacheTrait.php:33)
  at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->get()
     (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:59)
  at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->load()
     (vendor/shopware/storefront/Page/Product/ProductPageLoader.php:65)
  at Shopware\Storefront\Page\Product\ProductPageLoader->load()
     (vendor/shopware/storefront/Controller/ProductController.php:54)
  at Shopware\Storefront\Controller\ProductController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/shopware/core/Framework/Adapter/Kernel/HttpKernel.php:44)
  at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->handle()
     (vendor/shopware/core/Framework/Adapter/Kernel/HttpCacheKernel.php:50)
  at Shopware\Core\Framework\Adapter\Kernel\HttpCacheKernel->handle()
     (vendor/shopware/core/Kernel.php:157)
  at Shopware\Core\Kernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:473)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:448)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:221)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/shopware/core/HttpKernel.php:146)
  at Shopware\Core\HttpKernel->doHandle()
     (vendor/shopware/core/HttpKernel.php:67)
  at Shopware\Core\HttpKernel->handle()
     (public/index.php:71)
  at Symfony\Component\HttpKernel\HttpKernelInterface@anonymous/kunden/83226_94327/ShopPTMoeller2023/public/index.php:61$0->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/kunden/83226_94327/ShopPTMoeller2023/vendor/autoload_runtime.php')
     (public/index.php:14)