Error 500 Internal Server Error

GET http://eshop.glomex.stage.gtsoftware.cz/product?category=0197d574-773c-77f2-ae89-51d89aae885c&page=0

Exceptions

Unknown API exception

Exceptions 2

App\Infrastructure\Exception\ LogicException

  1. }
  2. throw new ApiBadRequest($message['message']);
  3. }
  4. throw new LogicException('Unknown API exception', 0, $exception);
  5. } catch (RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface|MappingError|InvalidSource $exception) {
  6. throw new LogicException($exception->getMessage(), 0, $exception);
  7. }
  8. }
  9. }
  1. #[MapQueryParameter] string|null $search,
  2. #[MapQueryParameter] string|null $sort,
  3. #[MapQueryParameter] int|null $page,
  4. ): Response {
  5. try {
  6. $products = $this->apiClient->request(new ProductListApiRequest(new ProductListApiInput(
  7. $page ?? 1,
  8. 20,
  9. $sort,
  10. $tag,
  11. $category,
  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. $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. while ($request = $worker->waitRequest()) {
  2. $this->sentryHubInterface?->pushScope();
  3. try {
  4. $symfonyRequest = $this->httpFoundationFactory->createRequest($request);
  5. $symfonyResponse = $this->kernel->handle($symfonyRequest);
  6. $content = match (true) {
  7. $symfonyResponse instanceof StreamedJsonResponse => StreamedJsonResponseWrapper::wrap($symfonyResponse),
  8. $symfonyResponse instanceof StreamedResponse => StreamedResponseWrapper::wrap($symfonyResponse),
  9. $symfonyResponse instanceof BinaryFileResponse => BinaryFileResponseWrapper::wrap($symfonyResponse, $symfonyRequest),
  1. error_log(sprintf('Missing RR worker implementation for %s mode', $this->mode));
  2. return 1;
  3. }
  4. $worker->start();
  5. return 0;
  6. }
  7. }
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/app/vendor/autoload_runtime.php') in public/index.php (line 7)
  1. declare(strict_types=1);
  2. use App\Infrastructure\Kernel;
  3. require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
  4. return function (array $context): Kernel {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); // @phpstan-ignore argument.type
  6. };

Symfony\Component\HttpClient\Exception\ ClientException

HTTP/1.1 422 Unprocessable Entity returned for "https://is.stage.glomex.cz/api/v1/product".

  1. if (500 <= $code) {
  2. throw new ServerException($this);
  3. }
  4. if (400 <= $code) {
  5. throw new ClientException($this);
  6. }
  7. if (300 <= $code) {
  8. throw new RedirectionException($this);
  9. }
  1. } finally {
  2. if ($this->event?->isStarted()) {
  3. $this->event->stop();
  4. }
  5. if ($throw) {
  6. $this->checkStatusCode($this->response->getStatusCode());
  7. }
  8. }
  9. }
  10. public function toArray(bool $throw = true): array
TraceableResponse->getContent() in src/Infrastructure/Api/ApiClient.php (line 62)
  1. 'Content-Type' => 'application/json',
  2. 'Authorization' => 'Bearer ' . $account?->getAccessToken()->getValue(),
  3. ],
  4. ]);
  5. return $this->mapper->map($apiEndpoint->getOutputClass(), new JsonSource($response->getContent()));
  6. } catch (ClientExceptionInterface $exception) {
  7. if ($exception->getCode() === Response::HTTP_UNAUTHORIZED) {
  8. throw new UnauthorizedHttpException($exception->getMessage(), previous: $exception);
  9. }
  1. #[MapQueryParameter] string|null $search,
  2. #[MapQueryParameter] string|null $sort,
  3. #[MapQueryParameter] int|null $page,
  4. ): Response {
  5. try {
  6. $products = $this->apiClient->request(new ProductListApiRequest(new ProductListApiInput(
  7. $page ?? 1,
  8. 20,
  9. $sort,
  10. $tag,
  11. $category,
  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. $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. while ($request = $worker->waitRequest()) {
  2. $this->sentryHubInterface?->pushScope();
  3. try {
  4. $symfonyRequest = $this->httpFoundationFactory->createRequest($request);
  5. $symfonyResponse = $this->kernel->handle($symfonyRequest);
  6. $content = match (true) {
  7. $symfonyResponse instanceof StreamedJsonResponse => StreamedJsonResponseWrapper::wrap($symfonyResponse),
  8. $symfonyResponse instanceof StreamedResponse => StreamedResponseWrapper::wrap($symfonyResponse),
  9. $symfonyResponse instanceof BinaryFileResponse => BinaryFileResponseWrapper::wrap($symfonyResponse, $symfonyRequest),
  1. error_log(sprintf('Missing RR worker implementation for %s mode', $this->mode));
  2. return 1;
  3. }
  4. $worker->start();
  5. return 0;
  6. }
  7. }
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/app/vendor/autoload_runtime.php') in public/index.php (line 7)
  1. declare(strict_types=1);
  2. use App\Infrastructure\Kernel;
  3. require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
  4. return function (array $context): Kernel {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); // @phpstan-ignore argument.type
  6. };

Stack Traces 2

[2/2] LogicException
App\Infrastructure\Exception\LogicException:
Unknown API exception

  at src/Infrastructure/Api/ApiClient.php:79
  at App\Infrastructure\Api\ApiClient->request()
     (src/Domain/Product/Action/ProductList/ProductListAction.php:45)
  at App\Domain\Product\Action\ProductList\ProductListAction->__invoke()
     (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:182)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/fluffydiscord/roadrunner-symfony-bundle/src/Worker/HttpWorker.php:76)
  at FluffyDiscord\RoadRunnerBundle\Worker\HttpWorker->start()
     (vendor/fluffydiscord/roadrunner-symfony-bundle/src/Runtime/Runner.php:33)
  at FluffyDiscord\RoadRunnerBundle\Runtime\Runner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/app/vendor/autoload_runtime.php')
     (public/index.php:7)                
[1/2] ClientException
Symfony\Component\HttpClient\Exception\ClientException:
HTTP/1.1 422 Unprocessable Entity returned for "https://is.stage.glomex.cz/api/v1/product".

  at vendor/symfony/http-client/Response/TraceableResponse.php:209
  at Symfony\Component\HttpClient\Response\TraceableResponse->checkStatusCode()
     (vendor/symfony/http-client/Response/TraceableResponse.php:100)
  at Symfony\Component\HttpClient\Response\TraceableResponse->getContent()
     (src/Infrastructure/Api/ApiClient.php:62)
  at App\Infrastructure\Api\ApiClient->request()
     (src/Domain/Product/Action/ProductList/ProductListAction.php:45)
  at App\Domain\Product\Action\ProductList\ProductListAction->__invoke()
     (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:182)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/fluffydiscord/roadrunner-symfony-bundle/src/Worker/HttpWorker.php:76)
  at FluffyDiscord\RoadRunnerBundle\Worker\HttpWorker->start()
     (vendor/fluffydiscord/roadrunner-symfony-bundle/src/Runtime/Runner.php:33)
  at FluffyDiscord\RoadRunnerBundle\Runtime\Runner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/app/vendor/autoload_runtime.php')
     (public/index.php:7)