tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
183 stars 97 forks source link

Uncaught PHP Exeption TypeError "SamlProvider" #416

Closed whoisbarry closed 1 year ago

whoisbarry commented 1 year ago

Hello everyone,

I was using kimai2 on docker for several months now without any issue. To keep up to date I also included the containers into my watchtower routine to update them automatically every week.

Since updating to the latest version I'm now unable to access my kimai2 web interface with the following error.

kimai01

The log of the kimai container throws the following errors.

localhost:8001 127.0.0.1 - - [09/Oct/2022:20:12:12 +0200] "GET / HTTP/1.1" 302 504 "-" "curl/7.64.0"

[Sun Oct 09 20:12:33.508446 2022] [php:notice] [pid 59] [client 127.0.0.1:53964] [2022-10-09 18:12:33] php.CRITICAL: Uncaught Error: App\\Saml\\Provider\\SamlProvider::__construct(): Argument #5 ($configuration) must be of type App\\Configuration\\SamlConfigurationInterface, App\\Configuration\\SystemConfiguration given, called in /opt/kimai/var/cache/prod/Container4FlhW6p/getSecurity_Authentication_Provider_Saml_SecuredAreaService.php on line 14 {"exception":"[object] (TypeError(code: 0): App\\\\Saml\\\\Provider\\\\SamlProvider::__construct(): Argument #5 ($configuration) must be of type App\\\\Configuration\\\\SamlConfigurationInterface, App\\\\Configuration\\\\SystemConfiguration given, called in /opt/kimai/var/cache/prod/Container4FlhW6p/getSecurity_Authentication_Provider_Saml_SecuredAreaService.php on line 14 at /opt/kimai/src/Saml/Provider/SamlProvider.php:32)"} []

[Sun Oct 09 20:12:33.514076 2022] [php:notice] [pid 59] [client 127.0.0.1:53964] [2022-10-09 18:12:33] request.CRITICAL: Uncaught PHP Exception TypeError: "App\\Saml\\Provider\\SamlProvider::__construct(): Argument #5 ($configuration) must be of type App\\Configuration\\SamlConfigurationInterface, App\\Configuration\\SystemConfiguration given, called in /opt/kimai/var/cache/prod/Container4FlhW6p/getSecurity_Authentication_Provider_Saml_SecuredAreaService.php on line 14" at /opt/kimai/src/Saml/Provider/SamlProvider.php line 32 {"exception":"[object] (TypeError(code: 0): App\\\\Saml\\\\Provider\\\\SamlProvider::__construct(): Argument #5 ($configuration) must be of type App\\\\Configuration\\\\SamlConfigurationInterface, App\\\\Configuration\\\\SystemConfiguration given, called in /opt/kimai/var/cache/prod/Container4FlhW6p/getSecurity_Authentication_Provider_Saml_SecuredAreaService.php on line 14 at /opt/kimai/src/Saml/Provider/SamlProvider.php:32)"} []

I did check the getSecurity_Authentication_Provider_Saml_SecuredAreaService.php file but I'm not sure if there were any updates applied to this file.

<?php

use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;

// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
// Returns the private 'security.authentication.provider.saml.secured_area' shared service.

include_once \dirname(__DIR__, 4).'/vendor/symfony/security-core/Authentication/Provider/AuthenticationProviderInterface.php';
include_once \dirname(__DIR__, 4).'/src/Saml/Provider/SamlProvider.php';
include_once \dirname(__DIR__, 4).'/src/Saml/SamlTokenFactory.php';
include_once \dirname(__DIR__, 4).'/src/Saml/User/SamlUserFactory.php';

return $this->privates['security.authentication.provider.saml.secured_area'] = new \App\Saml\Provider\SamlProvider(($this->privates['App\\Repository\\UserRepository'] ?? $this->load('getUserRepositoryService.php')), ($this->privates['security.user.provider.concrete.chain_provider'] ?? $this->load('getSecurity_User_Provider_Concrete_ChainProviderService.php')), new \App\Saml\SamlTokenFactory(), new \App\Saml\User\SamlUserFactory(($this->privates['App\\Configuration\\SamlConfiguration'] ?? $this->load('getSamlConfigurationService.php'))), ($this->privates['App\\Configuration\\SystemConfiguration'] ?? $this->load('getSystemConfigurationService.php')));

Any ideas how to get kimai2 installation back to work?

Thank you very much in advance!

kevinpapst commented 1 year ago

Cache reload will solve the issue. Search discussion and/or closed issues, I think that exact error was discussed before.