Error 500 Internal Server Error

POST https://skylineit.de/api/v1/auth/login

Forwarded to ErrorController (b577ad)

Exceptions

An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)

Exceptions 2

Lexik\Bundle\JWTAuthenticationBundle\Exception\ JWTEncodeFailureException

Show exception properties
Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException {#1131
  -reason: "invalid_config"
  -payload: array:2 [
    "roles" => array:2 [
      0 => "ROLE_ADMIN"
      1 => "ROLE_USER"
    ]
    "username" => "info@offlinesys.de"
  ]
}
  1. public function encode(array $payload, array $header = [])
  2. {
  3. try {
  4. $jws = $this->jwsProvider->create($payload, $header);
  5. } catch (\InvalidArgumentException $e) {
  6. throw new JWTEncodeFailureException(JWTEncodeFailureException::INVALID_CONFIG, 'An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)', $e, $payload);
  7. }
  8. if (!$jws->isSigned()) {
  9. throw new JWTEncodeFailureException(JWTEncodeFailureException::UNSIGNED_TOKEN, 'Unable to create a signed JWT from the given configuration.', null, $payload);
  10. }
  1. {
  2. $jwtCreatedEvent = new JWTCreatedEvent($payload, $user);
  3. $this->dispatcher->dispatch($jwtCreatedEvent, Events::JWT_CREATED);
  4. if ($this->jwtEncoder instanceof HeaderAwareJWTEncoderInterface) {
  5. $jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData(), $jwtCreatedEvent->getHeader());
  6. } else {
  7. $jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData());
  8. }
  9. $jwtEncodedEvent = new JWTEncodedEvent($jwtString);
in vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php -> generateJwtStringAndDispatchEvents (line 53)
  1. $payload = ['roles' => $user->getRoles()];
  2. $this->addUserIdentityToPayload($user, $payload);
  3. $this->payloadEnrichment->enrich($user, $payload);
  4. return $this->generateJwtStringAndDispatchEvents($user, $payload);
  5. }
  6. /**
  7. * @return string The JWT token
  8. *
JWTManager->create(object(User)) in src/Controller/Api/ApiAuthController.php (line 196)
  1. }
  2. $this->loginThrottleService->registerSuccess($ip, $user);
  3. $this->loginAttemptService->log($request, $user, $email, true);
  4. $accessToken = $this->jwtManager->create($user);
  5. $refresh = $this->refreshTokenService->create($user, $deviceId, (string) $ip, $request->headers->get('User-Agent'));
  6. return $this->data([
  7. 'access_token' => $accessToken,
  8. 'refresh_token' => $refresh['token'],
  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('/var/www/website/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. };

Lcobucci\JWT\Signer\ InvalidKeyProvided

It was not possible to parse your key, reason: * error:1E08010C:DECODER routines::unsupported

  1. final class InvalidKeyProvided extends InvalidArgumentException implements Exception
  2. {
  3. public static function cannotBeParsed(string $details): self
  4. {
  5. return new self('It was not possible to parse your key, reason:' . $details);
  6. }
  7. /**
  8. * @param non-empty-string $expectedType
  9. * @param non-empty-string $actualType
in vendor/lcobucci/jwt/src/Signer/OpenSSL.php :: cannotBeParsed (line 97)
  1. * @throws InvalidKeyProvided
  2. */
  3. private function validateKey(OpenSSLAsymmetricKey|bool $key): OpenSSLAsymmetricKey
  4. {
  5. if (is_bool($key)) {
  6. throw InvalidKeyProvided::cannotBeParsed($this->fullOpenSSLErrorString());
  7. }
  8. $details = openssl_pkey_get_details($key);
  9. assert(is_array($details));
  1. #[SensitiveParameter]
  2. string $pem,
  3. #[SensitiveParameter]
  4. string $passphrase,
  5. ): OpenSSLAsymmetricKey {
  6. return $this->validateKey(openssl_pkey_get_private($pem, $passphrase));
  7. }
  8. /** @throws InvalidKeyProvided */
  9. final protected function verifySignature(
  10. string $expected,
in vendor/lcobucci/jwt/src/Signer/OpenSSL.php -> getPrivateKey (line 50)
  1. string $pem,
  2. #[SensitiveParameter]
  3. string $passphrase,
  4. string $payload,
  5. ): string {
  6. $key = $this->getPrivateKey($pem, $passphrase);
  7. $signature = '';
  8. if (! openssl_sign($payload, $signature, $key, $this->algorithm())) {
  9. throw CannotSignPayload::errorHappened($this->fullOpenSSLErrorString());
in vendor/lcobucci/jwt/src/Signer/Rsa.php -> createSignature (line 14)
  1. {
  2. private const MINIMUM_KEY_LENGTH = 2048;
  3. final public function sign(string $payload, Key $key): string
  4. {
  5. return $this->createSignature($key->contents(), $key->passphrase(), $payload);
  6. }
  7. final public function verify(string $expected, string $payload, Key $key): bool
  8. {
  9. return $this->verifySignature($expected, $payload, $key->contents());
  1. $headers['alg'] = $signer->algorithmId();
  2. $encodedHeaders = $this->encode($headers);
  3. $encodedClaims = $this->encode($this->claimFormatter->formatClaims($this->claims));
  4. $signature = $signer->sign($encodedHeaders . '.' . $encodedClaims, $key);
  5. $encodedSignature = $this->encoder->base64UrlEncode($signature);
  6. return new Plain(
  7. new DataSet($headers, $encodedHeaders),
  8. new DataSet($this->claims, $encodedClaims),
  1. private function getSignedToken(Builder $jws): string
  2. {
  3. $key = InMemory::plainText($this->keyLoader->loadKey(KeyLoaderInterface::TYPE_PRIVATE), $this->signer instanceof Hmac ? '' : (string) $this->keyLoader->getPassphrase());
  4. $token = $jws->getToken($this->signer, $key);
  5. return $token->toString();
  6. }
  7. private function verify(Token $jwt): bool
  1. foreach ($payload as $name => $value) {
  2. $jws = $jws->withClaim($name, $value);
  3. }
  4. $token = $this->getSignedToken($jws);
  5. return new CreatedJWS((string) $token, true);
  6. }
  7. /**
  1. * {@inheritdoc}
  2. */
  3. public function encode(array $payload, array $header = [])
  4. {
  5. try {
  6. $jws = $this->jwsProvider->create($payload, $header);
  7. } catch (\InvalidArgumentException $e) {
  8. throw new JWTEncodeFailureException(JWTEncodeFailureException::INVALID_CONFIG, 'An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)', $e, $payload);
  9. }
  10. if (!$jws->isSigned()) {
  1. {
  2. $jwtCreatedEvent = new JWTCreatedEvent($payload, $user);
  3. $this->dispatcher->dispatch($jwtCreatedEvent, Events::JWT_CREATED);
  4. if ($this->jwtEncoder instanceof HeaderAwareJWTEncoderInterface) {
  5. $jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData(), $jwtCreatedEvent->getHeader());
  6. } else {
  7. $jwtString = $this->jwtEncoder->encode($jwtCreatedEvent->getData());
  8. }
  9. $jwtEncodedEvent = new JWTEncodedEvent($jwtString);
in vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php -> generateJwtStringAndDispatchEvents (line 53)
  1. $payload = ['roles' => $user->getRoles()];
  2. $this->addUserIdentityToPayload($user, $payload);
  3. $this->payloadEnrichment->enrich($user, $payload);
  4. return $this->generateJwtStringAndDispatchEvents($user, $payload);
  5. }
  6. /**
  7. * @return string The JWT token
  8. *
JWTManager->create(object(User)) in src/Controller/Api/ApiAuthController.php (line 196)
  1. }
  2. $this->loginThrottleService->registerSuccess($ip, $user);
  3. $this->loginAttemptService->log($request, $user, $email, true);
  4. $accessToken = $this->jwtManager->create($user);
  5. $refresh = $this->refreshTokenService->create($user, $deviceId, (string) $ip, $request->headers->get('User-Agent'));
  6. return $this->data([
  7. 'access_token' => $accessToken,
  8. 'refresh_token' => $refresh['token'],
  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('/var/www/website/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 21:18:33 deprecation User Deprecated: Class "Doctrine\ORM\Proxy\Autoloader" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm)
{
    "exception": {}
}
INFO 21:18:33 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "497a52"
    },
    "request_uri": "https://skylineit.de/_profiler/497a52",
    "method": "GET"
}

Stack Traces 2

[2/2] JWTEncodeFailureException
Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException:
An error occurred while trying to encode the JWT token. Please verify your configuration (private key/passphrase)

  at vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php:31
  at Lexik\Bundle\JWTAuthenticationBundle\Encoder\LcobucciJWTEncoder->encode(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
     (vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:82)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->generateJwtStringAndDispatchEvents(object(User), array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'))
     (vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:53)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->create(object(User))
     (src/Controller/Api/ApiAuthController.php:196)
  at App\Controller\Api\ApiAuthController->login(object(Request), object(UserPasswordHasher))
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/var/www/website/vendor/autoload_runtime.php')
     (public/index.php:5)                
[1/2] InvalidKeyProvided
Lcobucci\JWT\Signer\InvalidKeyProvided:
It was not possible to parse your key, reason:
* error:1E08010C:DECODER routines::unsupported

  at vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php:13
  at Lcobucci\JWT\Signer\InvalidKeyProvided::cannotBeParsed('* error:1E08010C:DECODER routines::unsupported')
     (vendor/lcobucci/jwt/src/Signer/OpenSSL.php:97)
  at Lcobucci\JWT\Signer\OpenSSL->validateKey(false)
     (vendor/lcobucci/jwt/src/Signer/OpenSSL.php:68)
  at Lcobucci\JWT\Signer\OpenSSL->getPrivateKey(object(SensitiveParameterValue), object(SensitiveParameterValue))
     (vendor/lcobucci/jwt/src/Signer/OpenSSL.php:50)
  at Lcobucci\JWT\Signer\OpenSSL->createSignature(object(SensitiveParameterValue), object(SensitiveParameterValue), 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NzU0MTY2NzgsImV4cCI6MTc3NTQxNzU3OCwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfVVNFUiJdLCJ1c2VybmFtZSI6ImluZm9Ab2ZmbGluZXN5cy5kZSJ9')
     (vendor/lcobucci/jwt/src/Signer/Rsa.php:14)
  at Lcobucci\JWT\Signer\Rsa->sign('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NzU0MTY2NzgsImV4cCI6MTc3NTQxNzU3OCwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfVVNFUiJdLCJ1c2VybmFtZSI6ImluZm9Ab2ZmbGluZXN5cy5kZSJ9', object(InMemory))
     (vendor/lcobucci/jwt/src/Token/Builder.php:158)
  at Lcobucci\JWT\Token\Builder->getToken(object(Sha256), object(InMemory))
     (vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php:159)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWSProvider\LcobucciJWSProvider->getSignedToken(object(Builder))
     (vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php:99)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWSProvider\LcobucciJWSProvider->create(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
     (vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php:29)
  at Lexik\Bundle\JWTAuthenticationBundle\Encoder\LcobucciJWTEncoder->encode(array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'), array())
     (vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:82)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->generateJwtStringAndDispatchEvents(object(User), array('roles' => array('ROLE_ADMIN', 'ROLE_USER'), 'username' => 'info@offlinesys.de'))
     (vendor/lexik/jwt-authentication-bundle/Services/JWTManager.php:53)
  at Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager->create(object(User))
     (src/Controller/Api/ApiAuthController.php:196)
  at App\Controller\Api\ApiAuthController->login(object(Request), object(UserPasswordHasher))
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/var/www/website/vendor/autoload_runtime.php')
     (public/index.php:5)