Error 500 Internal Server Error

GET https://bienestar-web-staging.kuantum.cl/agreements-pdf-file/SCOTIABANK_%20%281%29_merged%20%281%29-1.pdf

Exceptions

The file "/var/www/html/BienestarScotiabankWeb/public/uploads/agreement/SCOTIABANK_ (1)_merged (1)-1.pdf" does not exist

Exception

Symfony\Component\HttpFoundation\File\Exception\ FileNotFoundException

  1. * @throws FileNotFoundException If the given path is not a file
  2. */
  3. public function __construct(string $path, bool $checkPath = true)
  4. {
  5. if ($checkPath && !is_file($path)) {
  6. throw new FileNotFoundException($path);
  7. }
  8. parent::__construct($path);
  9. }
  1. if (!$file instanceof File) {
  2. if ($file instanceof \SplFileInfo) {
  3. $file = new File($file->getPathname(), !$isTemporaryFile);
  4. } else {
  5. $file = new File($file);
  6. }
  7. }
  8. if (!$file->isReadable() && !$isTemporaryFile) {
  9. throw new FileException('File must be readable.');
  1. */
  2. public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true)
  3. {
  4. parent::__construct(null, $status, $headers);
  5. $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified);
  6. if ($public) {
  7. $this->setPublic();
  8. }
  9. }
BinaryFileResponse->__construct() in src/Controller/DefaultController.php (line 2460)
  1. $em = $this->entityManager;
  2. $agreement_file = $em->getRepository(\App\Entity\Agreement::class)->findOneBy(['pdf' => $pdf]);
  3. $fileName = $agreement_file->getPdf();
  4. $file_with_path = $this->getParameter('kernel.project_dir') . "/public/uploads/agreement/" . $fileName;
  5. $response = new BinaryFileResponse($file_with_path);
  6. $response->headers->set('Content-Type', 'application/pdf');
  7. return $response;
  8. }
  9. //TODO ELIMINAR
in vendor/symfony/http-kernel/HttpKernel.php -> agreementsPdfFile (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. }
Kernel->handle() in public/index.php (line 31)
  1. if(isset($_COOKIE["PHPSESSID"])){
  2. #header('Set-Cookie: PHPSESSID2='.$_COOKIE["PHPSESSID"].'; secure; HttpOnly SameSite=None');
  3. //setcookie('PHPSESSID', $_COOKIE["PHPSESSID"], 0, '/; secure; HttpOnly; samesite=none');
  4. }
  5. $response = $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request, $response);

Logs

Level Channel Message
INFO 18:35:17 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "ecef8c"
    },
    "request_uri": "https://bienestar-web-staging.kuantum.cl/_profiler/ecef8c",
    "method": "GET"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bridge\\Doctrine\\Middleware\\IdleConnection\\Listener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\SessionListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::setDefaultLocale".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::setDefaultLocale"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleAwareListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleAwareListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::configureLogoutUrlGenerator".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::configureLogoutUrlGenerator"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.request" to listener "Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Knp\\Bundle\\PaginatorBundle\\Subscriber\\SlidingPaginationSubscriber::onKernelRequest"
}
DEBUG 18:35:17 event Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector::onKernelController"
}
DEBUG 18:35:17 event Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector::onKernelController"
}
DEBUG 18:35:17 event Notified event "kernel.controller" to listener "Sonata\AdminBundle\EventListener\ConfigureCRUDControllerListener::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Sonata\\AdminBundle\\EventListener\\ConfigureCRUDControllerListener::onKernelController"
}
INFO 18:35:17 php User Deprecated: In ORM 3.0, the AttributeDriver will report fields for the classes where they are declared. This may uncover invalid mapping configurations. To opt into the new mode today, set the "reportFieldsWhereDeclared" constructor parameter to true. (AttributeDriver.php:77 called by App_KernelDevDebugContainer.php:2114, https://github.com/doctrine/orm/pull/10455, package doctrine/orm)
{
    "exception": {}
}
INFO 18:35:17 php User Deprecated: Not enabling lazy ghost objects is deprecated and will not be supported in Doctrine ORM 3.0. Ensure Doctrine\ORM\Configuration::setLazyGhostObjectEnabled(true) is called to enable them. (ProxyFactory.php:166 called by EntityManager.php:177, https://github.com/doctrine/orm/pull/10837/, package doctrine/orm)
{
    "exception": {}
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\IsSignatureValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\IsSignatureValidAttributeListener::onKernelControllerArguments"
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsCsrfTokenValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsCsrfTokenValidAttributeListener::onKernelControllerArguments"
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsGrantedAttributeListener::onKernelControllerArguments"
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\CacheAttributeListener::onKernelControllerArguments"
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver::onKernelControllerArguments"
}
DEBUG 18:35:17 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener::onControllerArguments"
}

Stack Trace

FileNotFoundException
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException:
The file "/var/www/html/BienestarScotiabankWeb/public/uploads/agreement/SCOTIABANK_ (1)_merged (1)-1.pdf" does not exist

  at vendor/symfony/http-foundation/File/File.php:36
  at Symfony\Component\HttpFoundation\File\File->__construct()
     (vendor/symfony/http-foundation/BinaryFileResponse.php:73)
  at Symfony\Component\HttpFoundation\BinaryFileResponse->setFile()
     (vendor/symfony/http-foundation/BinaryFileResponse.php:50)
  at Symfony\Component\HttpFoundation\BinaryFileResponse->__construct()
     (src/Controller/DefaultController.php:2460)
  at App\Controller\DefaultController->agreementsPdfFile()
     (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:193)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:31)