8000 Service "security.command.debug_firewall" not found error · Issue #41769 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Service "security.command.debug_firewall" not found error #41769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
psdesse opened this issue Jun 21, 2021 · 1 comment
Closed

Service "security.command.debug_firewall" not found error #41769

psdesse opened this issue Jun 21, 2021 · 1 comment

Comments

@psdesse
Copy link
psdesse commented Jun 21, 2021

Symfony version(s) affected: 5.3.0

Description
A application that do not depends on symfony/console fails with the error You have requested a non-existent service "security.command.debug_firewall". This only happens with the new Authenticator-based Security.

How to reproduce
Create an application that do not depends on symfony/console. If you use a new authentication security with a custom authenticator, you should get this error.

Possible Solution
In the security-bundle, in SecurityExtension.php, the command is loaded conditionnaly:

        if (class_exists(Application::class)) {
            $loader->load('debug_console.php');
            $debugCommand = $container->getDefinition('security.command.debug_firewall');
            $debugCommand->replaceArgument(4, $this->authenticatorManagerEnabled);
        }

However, in the function createFirewall, this condition is not present:

            // Add authenticators to the debug:firewall command
            $debugCommand = $container->getDefinition('security.command.debug_firewall');
            $debugCommand->replaceArgument(3, array_merge($debugCommand->getArgument(3), [$id => $authenticators]));

This leads to the error Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "security.command.debug_firewall".

Additional context
A workaround is to add the dependency to symfony/console.

@xabbuh
Copy link
Member
xabbuh commented Jul 2, 2021

looks like this has been solved in the meantime by #41747 and updating to 5.3.3 should help

@xabbuh xabbuh closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0