Failed user login on production server using Symfony framework (Authentication request could not be processed due to…)

后端 未结 11 1683
温柔的废话
温柔的废话 2021-01-07 21:35

I\'am using Symfony for a project and I have been trying to get the login to work on production server with no success for the past 2 days. I keep getting the error

相关标签:
11条回答
  • 2021-01-07 22:16

    Currently there is a bug in Symfony and on production IF during authentication system error occurs (missing table, missing column or any other exception) - it's logged as INFO instead of ERROR and with default error logging options it's not logged at all.

    https://github.com/symfony/symfony/pull/28462

    I think there are two options right now - temporary log everything (including INFO) on production until you find the real error.

    Second option: use this patch or debug directly on production.

    0 讨论(0)
  • 2021-01-07 22:17

    You probably used the template given by Symfony docs here :

    {% if error %}
        <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
    {% endif %}
    

    Which actually gives you this error message. The most simple and reliable way to fix this issue is to replace this line by the following :

    <div class="alert alert-danger">{{ error }}</div>
    

    Which will give you the full stack-trace for your error and (hopefully) help you debug your application. Don't forget to revert this before going to production!

    0 讨论(0)
  • 2021-01-07 22:20

    It looks like that the error:

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

    is too generic and does not tell anything about where the problem is (there is an issue opened about this matter here).

    I solved my issue by checking the logs and see what happened (in var/logs/dev.log), hoping this helps someone.

    In my specific case, there was a wrong parameter in parameters.yml about database connection. But, again, the error is too generic and does not necessarily imply that the problem is related with database connection.

    0 讨论(0)
  • 2021-01-07 22:21

    I'm sure that this error is too generic. In my case, The follow is incorrect:

    class: App/Entity/User;
    

    Correction:

    class: App\Entity\User;
    
    0 讨论(0)
  • 2021-01-07 22:22

    This problem can be fixed running command: php bin/console cache:clear --env=prod --no-debug

    0 讨论(0)
提交回复
热议问题