Symfony FOSUserBundle versions: v2.0.2
Symfony version: 3.4
Symfony Flex: yes
Description of the problem including expected versus actual behavior:
Users cannot login when using correct credentials. The login form will give following error: "Authentication request could not be processed due to a system problem.". Cannot find any errors in the command prompt of the server. Also the log files are empty.
Steps to reproduce:
The config/packages/fos_user.yaml file looks like:
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: App\Entity\User
from_email: # Use this node only if you don't want the global email address for the confirmation email
address: [email protected]
sender_name: Webmaster JimmyD
registration:
confirmation:
from_email: # Use this node only if you don't want the global email address for the confirmation email
address: [email protected]
sender_name: Webmaster
enabled: true # change to true for required email confirmation
template: FOSUserBundle:Registration:email.txt.twig
The config/routes.yaml looks like:
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
And the config/packages/security.yaml looks like:
security:
providers:
in_memory: { memory: ~ }
fos_userbundle:
id: fos_user.user_provider.username_email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
# activate different ways to authenticate
pattern: ^/
form_login:
check_path: /login_check
login_path: /login
provider: fos_userbundle
always_use_default_target_path: true
default_target_path: /user/home
logout:
path: /logout
target: /login
anonymous: true
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_USER: ROLE_USER
ROLE_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }
- { path: ^/user/, role: ROLE_USER }
- { path: ^/profile/, role: ROLE_USER }
- { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }
I have the same issue with Fosuserbundle in a Symfony Flex environment. Tried everything and I'm getting the same not explaning error. Also my logs are empty.
After debugging and checking the Fos errors in debug I found the issue. My User entity was not correct.
Symfony FOSUserBundle versions: v2.1
Symfony version: 4.1
Symfony Flex: yes
I have same issue, and no log too...
Do not forget to check your /var/log/dev.log to check for errors since this error is a very generic one. The dev.log will provide you more details
check your connectionstring, your user privileges for your database, password, etc
Maybe it can still help to somebody:
After a long time debugging I found the issue in my case. When using nginx and php-fpm owner of /var/lib/php/session folder was after installation root:apache, so session couldn't be created. Note that I haven't installed apache. (this is centos thing)
This could also be that your app is not connecting to the database.
One other possible reason, the linked repository to your entity doesn't reference the correct entity. Can happen when you copy/paster the code too quickly.
One other possible reason, the linked repository to your entity doesn't reference the correct entity. Can happen when you copy/paster the code too quickly.
What shall we do in this case ?
I get the same error message. This happened after an update
clearing the cache solved it for me.
Most helpful comment
This could also be that your app is not connecting to the database.