Shopware\Core\Content\Product\Exception\ProductNotFoundException {#4990 -statusCode: 404 -headers: [] #parameters: array:1 [ "productId" => "09ac167d72eb42d0be68e1f70c5c7557" ] }
$product = $this->productRepository
->search($criteria, $context)
->first();
if (!($product instanceof SalesChannelProductEntity)) {
throw new ProductNotFoundException($productId);
}
$product->setSeoCategory(
$this->breadcrumbBuilder->getProductSeoCategory($product, $context)
);
try {
foreach (self::$profilers as $profiler) {
$profiler->start($name, $category, $tags);
}
$result = $closure();
} finally {
foreach (self::$profilers as $profiler) {
$profiler->stop($name);
}
}
}
#[Route(path: '/store-api/product/{productId}', name: 'store-api.product.detail', methods: ['POST'], defaults: ['_entity' => 'product'])]
public function load(string $productId, Request $request, SalesChannelContext $context, Criteria $criteria): ProductDetailRouteResponse
{
return Profiler::trace('product-detail-route', function () use ($productId, $request, $context, $criteria) {
$mainVariantId = $this->checkVariantListingConfig($productId, $context);
$productId = $mainVariantId ?? $this->findBestVariant($productId, $context);
$this->addFilters($context, $criteria);
}
$value = $this->cache->get($key, function (ItemInterface $item) use ($productId, $request, $context, $criteria) {
$name = self::buildName($productId);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId, $request, $context, $criteria));
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
});
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
$this->decoratedSystemConfigService->deleteExtensionConfiguration($extensionName, $config);
}
public function trace(string $key, Closure $param)
{
return $this->decoratedSystemConfigService->trace($key, $param);
}
public function getTrace(string $key): array
{
return $this->decoratedSystemConfigService->getTrace($key);
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
return $this->decorated;
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, fn () => $this->getDecorated()->trace($key, $param));
}
public function get(string $key): array
{
return array_unique(array_merge(
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
return $this->decorated;
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, fn () => $this->getDecorated()->trace($key, $param));
}
public function get(string $key): array
{
return array_unique(array_merge(
}
$value = $this->cache->get($key, function (ItemInterface $item) use ($productId, $request, $context, $criteria) {
$name = self::buildName($productId);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId, $request, $context, $criteria));
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
});
}
}
if ($recompute) {
$save = true;
$item->set($callback($item, $save));
if ($save) {
$pool->save($item);
}
}
/**
* {@inheritdoc}
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
/**
* {@inheritdoc}
*/
if ($key === null) {
return $this->getDecorated()->load($productId, $request, $context, $criteria);
}
$value = $this->cache->get($key, function (ItemInterface $item) use ($productId, $request, $context, $criteria) {
$name = self::buildName($productId);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($productId, $request, $context, $criteria));
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
->addAssociation('mainCategories.category')
->addAssociation('media');
$this->eventDispatcher->dispatch(new ProductPageCriteriaEvent($productId, $criteria, $context));
$result = $this->productDetailRoute->load($productId, $request, $context, $criteria);
$product = $result->getProduct();
if ($product->getMedia()) {
$product->getMedia()->sort(fn (ProductMediaEntity $a, ProductMediaEntity $b) => $a->getPosition() <=> $b->getPosition());
}
}
#[Route(path: '/detail/{productId}', name: 'frontend.detail.page', defaults: ['_httpCache' => true], methods: ['GET'])]
public function index(SalesChannelContext $context, Request $request): Response
{
$page = $this->productPageLoader->load($request, $context);
$this->hook(new ProductPageLoadedHook($page, $context));
$ratingSuccess = $request->get('success');
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
$response = null;
try {
return $response = $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$this->dispatcher->dispatch($event);
return $event->getResponse();
}
return parent::handle($request, $type, $catch);
}
}
if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
}
try {
return $kernel->handle($request, $type, $catch);
} finally {
// restore global state
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
}
}
protected function forward(Request $request, bool $catch = false, ?Response $entry = null)
{
$this->surrogate?->addSurrogateCapability($request);
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
/*
* Support stale-if-error given on Responses or as a config option.
* RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
* Cache-Control directives) that
// avoid that the backend sends no content
$subRequest->headers->remove('If-Modified-Since');
$subRequest->headers->remove('If-None-Match');
$response = $this->forward($subRequest, $catch);
if ($response->isCacheable()) {
$this->store($request, $response);
}
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MAIN_REQUEST === $type) {
// only handle main request inside http cache, because ESI tags are also interpreted as main request.
// sub requests are requests, which are forwarded to the kernel inside the php stack
// https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894
if ($type === HttpKernelInterface::MAIN_REQUEST) {
$response = parent::handle($request, $type, $catch);
} else {
$response = $this->getKernel()->handle($request, $type, $catch);
}
if ($ips = $response->headers->get(self::MAINTENANCE_WHITELIST_HEADER)) {
{
if (!$this->booted) {
$this->boot();
}
return $this->getHttpKernel()->handle($request, $type, $catch);
}
public function boot(): void
{
if ($this->booted === true) {
) {
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
if (Kernel::VERSION_ID >= 60400) {
$response->send(false);
if (\function_exists('fastcgi_finish_request') && !$this->debug) {
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once __DIR__ . '/../vendor/autoload_runtime.php';
if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
$_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
}
No log messages
ProductNotFoundException
|
---|
Shopware\Core\Content\Product\Exception\ProductNotFoundException: Product for id 09ac167d72eb42d0be68e1f70c5c7557 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() (custom/plugins/PickwareDhl/vendor/pickware/shopware-extensions-bundle/src/Mail/SystemConfigServiceDecorator.php:140) at Pickware\ShopwareExtensionsBundle\Mail\SystemConfigServiceDecorator->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:63) at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->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/Framework/Adapter/Kernel/HttpCacheKernel.php:72) at Shopware\Core\Framework\Adapter\Kernel\HttpCacheKernel->handle() (vendor/shopware/core/Kernel.php:157) at Shopware\Core\Kernel->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('/var/www/saniklick/htdocs/shop_deployment/saniklick-elio-systems-io-live-36/vendor/autoload_runtime.php') (public/index.php:15) |