So, I was working on the security layer of an app, as usual, then I started testing the code, when this weird errors message popped out of nowhere :

Authentication request could not be processed due to a system problem.

Naturally, one would head to the debug bar and the profiler, and that’s what I did, no errors whatsoever.

Checking the logs was the next natural thing to do, and the mistake I made was not paying attention to the “info” messages, it turns our that the error was there :

security.INFO: Authentication request failed. {"exception":"[object] (Symfony\\Component\\Security\\Core\\Exception\\AuthenticationServiceException(code: 0): The \"App\\Entity\\User\" entity has a repositoryClass set to \"App\\Entity\\UserRepository\", but this is not a valid class. Check your class naming.

In my case, the error was simply the repository class I have specified on the entity was mistaken (wrong namespace, as I was putting repository classes in a separate repository folder).

For this specific error, I think that this line is the one you should first look for :

security.INFO: Authentication request failed.