contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
83 stars 33 forks source link

500 Internal Server Error | Check DB Migration #798

Closed katgirl closed 4 months ago

katgirl commented 4 months ago
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.115791+00:00] request.INFO: Matched route "contao_managerapi_server_database__invoke". {"route":"contao_managerapi_server_database__invoke","route_parameters":{"_controller":"Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction","path":"/api/server/database","permanent":true,"scheme":null,"httpPort":80,"httpsPort":443,"_route":"contao_managerapi_server_database__invoke"},"request_uri":"https://wild-boar.eu/contao-manager.phar.php/api/server/database/","method":"GET"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.120249+00:00] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"api","authenticators":4} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121165+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\LoginAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121199+00:00] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\LoginAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121350+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\PasswordlessAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121367+00:00] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\PasswordlessAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121370+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\JwtAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121377+00:00] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\JwtAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121553+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.121584+00:00] security.DEBUG: Calling getCredentials() on guard authenticator. {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.122025+00:00] security.DEBUG: Passing guard token information to the GuardAuthenticationProvider {"firewall_key":"api","authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.123505+00:00] security.INFO: Guard authentication successful! {"token":{"_ContaoManager\\Symfony\\Component\\Security\\Guard\\Token\\PostAuthenticationGuardToken":"PostAuthenticationGuardToken(user=\"kirsten_admin\", authenticated=true, roles=\"ROLE_ADMIN\")"},"authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.123614+00:00] security.DEBUG: Guard authenticator set no success response: request continues. {"authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.123619+00:00] security.DEBUG: Remember me skipped: it is not configured for the firewall. {"authenticator":"_ContaoManager\\Contao\\ManagerApi\\Security\\TokenAuthenticator"} []
[20-Feb-2024 14:32:22 UTC] [2024-02-20T14:32:22.127219+00:00] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The controller for URI "/api/server/database/" is not callable: Controller "Symfony\Bundle\FrameworkBundle\Controller\RedirectController" does neither exist as service nor as class." at phar:///var/customers/webs/XXX/public/contao-manager.phar.php/vendor/symfony/http-kernel/Controller/ControllerResolver.php line 75 {"exception":"[object] (InvalidArgumentException(code: 0): The controller for URI \"/api/server/database/\" is not callable: Controller \"Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController\" does neither exist as service nor as class. at phar:///var/customers/webs/XXX/public/contao-manager.phar.php/vendor/symfony/http-kernel/Controller/ControllerResolver.php:75)\n[previous exception] [object] (InvalidArgumentException(code: 0): Controller \"Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController\" does neither exist as service nor as class. at phar:///var/customers/webs/XXX/public/contao-manager.phar.php/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:55)\n[previous exception] [object] (Error(code: 0): Class \"Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController\" not found at phar:///var/customers/webs/XXX/public/contao-manager.phar.php/vendor/symfony/http-kernel/Controller/ControllerResolver.php:123)"} []
aschempp commented 4 months ago

Ich kann das Lokal nicht reproduzieren. Ich kann mir zwar das Problem grundsätzlich erklären (im neuen Contao Manager nutzen wir den PHPScoper (https://github.com/humbug/php-scoper). Der Contao Manager macht selber aber keine entsprechenden Redirects, ich weiss nur das Symfony das manchmal macht wenn z.B. von http zu https gewechselt wird 🤔

katgirl commented 4 months ago

Ich habe den Fehler gefunden.

https://contao.github.io/contao-manager/api/index.html#tag/Server-Configuration/paths/~1api~1server~1database/post

Am Ende darf kein / stehen, das war bei meiner Logik leider nicht der Fall, dadurch kam es zu einem Redirect.

aschempp commented 4 months ago

Verstehe ich richtig dass du die API selber genutzt hast, der Fehler kam nicht über das UI? Ist ja trotzdem ein Bug den ich gern fixen würde 😉

katgirl commented 4 months ago

Ja, wir haben ein eigenes Plugin für Icinga. Den Aufschlag hatten wir 2022 gemacht. Seit dem haben wir dort immer mehr drin gemacht. Inzwischen haben wir fast alle API-GET-Calls darin aufgenommen. image

aschempp commented 4 months ago

Should be fixed with 40cbcf1768f85fc6162b14af0a55d64993959d54 (in the next version then).