Error 500 Internal Server Error

GET https://moonprint-kuba.cod3lab.eu/media/cache/resolve/product_square/product/263/263-82-b-w1920-69b80c7d11c6a.jpg

Exceptions

Failed to create "/application/public/media/cache/product_square/product/263": mkdir(): Permission denied

Exception

Symfony\Component\Filesystem\Exception\ IOException

Show exception properties
Symfony\Component\Filesystem\Exception\IOException {#630
  -path: "/application/public/media/cache/product_square/product/263"
}
  1. if (is_dir($dir)) {
  2. continue;
  3. }
  4. if (!self::box('mkdir', $dir, $mode, true) && !is_dir($dir)) {
  5. throw new IOException(\sprintf('Failed to create "%s": ', $dir).self::$lastError, 0, null, $dir);
  6. }
  7. }
  8. }
  9. /**
  1. return;
  2. }
  3. if (!is_dir($dir)) {
  4. $this->mkdir($dir);
  5. }
  6. // Will create a temp file with 0600 access rights
  7. // when the filesystem supports chmod.
  8. $tmpFile = $this->tempnam($dir, basename($filename));
  1. return is_file($this->getFilePath($path, $filter));
  2. }
  3. public function store(BinaryInterface $binary, $path, $filter)
  4. {
  5. $this->filesystem->dumpFile(
  6. $this->getFilePath($path, $filter),
  7. $binary->getContent()
  8. );
  9. }
  1. * @param string $filter
  2. * @param string $resolver
  3. */
  4. public function store(BinaryInterface $binary, $path, $filter, $resolver = null)
  5. {
  6. $this->getResolver($filter, $resolver)->store($binary, $path, $filter);
  7. }
  8. /**
  9. * @param string|string[]|null $paths
  10. * @param string|string[]|null $filters
  1. string $filter,
  2. ?string $resolver = null,
  3. bool $forced = false
  4. ): bool {
  5. if ($forced || !$this->cacheManager->isStored($filterPathContainer->getTarget(), $filter, $resolver)) {
  6. $this->cacheManager->store(
  7. $this->createFilteredBinary($filterPathContainer, $filter),
  8. $filterPathContainer->getTarget(),
  9. $filter,
  10. $resolver
  11. );
in vendor/liip/imagine-bundle/Service/FilterService.php -> warmUpCacheFilterPathContainer (line 123)
  1. * @return string
  2. */
  3. public function getUrlOfFilteredImage($path, $filter, $resolver = null, bool $webpSupported = false)
  4. {
  5. foreach ($this->buildFilterPathContainers($path) as $filterPathContainer) {
  6. $this->warmUpCacheFilterPathContainer($filterPathContainer, $filter, $resolver);
  7. }
  8. return $this->resolveFilterPathContainer(new FilterPathContainer($path), $filter, $resolver, $webpSupported);
  9. }
  1. $path = PathHelper::urlPathToFilePath($path);
  2. // TODO once we limit `symfony/http-foundation` to 6.4 or newer, use `$request->query->getString()`
  3. $resolver = $request->query->has('resolver') ? (string) $request->query->get('resolver') : null;
  4. return $this->createRedirectResponse(function () use ($path, $filter, $resolver, $request) {
  5. return $this->filterService->getUrlOfFilteredImage(
  6. $path,
  7. $filter,
  8. $resolver,
  9. $this->isWebpSupported($request)
  10. );
in vendor/liip/imagine-bundle/Controller/ImagineController.php -> {closure:Liip\ImagineBundle\Controller\ImagineController::filterAction():90} (line 152)
  1. }
  2. private function createRedirectResponse(\Closure $url, string $path, string $filter, ?string $hash = null): RedirectResponse
  3. {
  4. try {
  5. return new RedirectResponse($url(), $this->controllerConfig->getRedirectResponseCode());
  6. } catch (NotLoadableException $exception) {
  7. if (null !== $this->dataManager->getDefaultImageUrl($filter)) {
  8. return new RedirectResponse($this->dataManager->getDefaultImageUrl($filter));
  9. }
  1. {
  2. $path = PathHelper::urlPathToFilePath($path);
  3. // TODO once we limit `symfony/http-foundation` to 6.4 or newer, use `$request->query->getString()`
  4. $resolver = $request->query->has('resolver') ? (string) $request->query->get('resolver') : null;
  5. return $this->createRedirectResponse(function () use ($path, $filter, $resolver, $request) {
  6. return $this->filterService->getUrlOfFilteredImage(
  7. $path,
  8. $filter,
  9. $resolver,
  10. $this->isWebpSupported($request)
in vendor/symfony/http-kernel/HttpKernel.php -> filterAction (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. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  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('/application/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Channel Message
INFO 23:05:22 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "6a2484"
    },
    "request_uri": "https://moonprint-kuba.cod3lab.eu/_profiler/6a2484",
    "method": "GET"
}

Stack Trace

IOException
Symfony\Component\Filesystem\Exception\IOException:
Failed to create "/application/public/media/cache/product_square/product/263": mkdir(): Permission denied

  at vendor/symfony/filesystem/Filesystem.php:98
  at Symfony\Component\Filesystem\Filesystem->mkdir()
     (vendor/symfony/filesystem/Filesystem.php:662)
  at Symfony\Component\Filesystem\Filesystem->dumpFile()
     (vendor/liip/imagine-bundle/Imagine/Cache/Resolver/WebPathResolver.php:79)
  at Liip\ImagineBundle\Imagine\Cache\Resolver\WebPathResolver->store()
     (vendor/liip/imagine-bundle/Imagine/Cache/CacheManager.php:222)
  at Liip\ImagineBundle\Imagine\Cache\CacheManager->store()
     (vendor/liip/imagine-bundle/Service/FilterService.php:204)
  at Liip\ImagineBundle\Service\FilterService->warmUpCacheFilterPathContainer()
     (vendor/liip/imagine-bundle/Service/FilterService.php:123)
  at Liip\ImagineBundle\Service\FilterService->getUrlOfFilteredImage()
     (vendor/liip/imagine-bundle/Controller/ImagineController.php:91)
  at Liip\ImagineBundle\Controller\ImagineController->{closure:Liip\ImagineBundle\Controller\ImagineController::filterAction():90}()
     (vendor/liip/imagine-bundle/Controller/ImagineController.php:152)
  at Liip\ImagineBundle\Controller\ImagineController->createRedirectResponse()
     (vendor/liip/imagine-bundle/Controller/ImagineController.php:90)
  at Liip\ImagineBundle\Controller\ImagineController->filterAction()
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:191)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/application/vendor/autoload_runtime.php')
     (public/index.php:5)