Symfony 4.2 in Laravel Homestead error: Impossible to access an attribute ("nb_errors") on a string variable

I need to modify a Symfony 4.2.8 application. To achieve this, I downloaded the project folder to my local development environment in Laravel homestead.

When trying to log in, nothing happens, or simply browsing the login form I get the following error:

Impossible to access an attribute ("nb_errors") on a string variable
("O:39:"SymfonyComponentVarDumperClonerData":7:{s:45:"SymfonyComponentVarDumperClonerDatadata";a:2:{i:0;a:1:{i:0;a:1:{i:1;i:1;}}i:1;a:3:{s:5:"forms";a:0:{}s:13:"forms_by_hash";a:0:{}s:9:"nb_errors";i:0;}}s:49:"SymfonyComponentVarDumperClonerDataposition";i:0;s:44:"SymfonyComponentVarDumperClonerDatakey";i:0;s:49:"SymfonyComponentVarDumperClonerDatamaxDepth";i:20;s:57:"SymfonyComponentVarDumperClonerDatamaxItemsPerDepth";i:-1;s:54:"SymfonyComponentVarDumperClonerDatauseRefHandles";i:-1;s:48:"SymfonyComponentVarDumperClonerDatacontext";a:0:{}}").

This error is not happening in the prod server. The prod app is working well.

The .env file looks like:

APP_ENV=dev
APP_SECRET=SETeudgygeywdigeyddgydgw...etc
TRUSTED_PROXIES=127.0.0.1,127.0.0.2
TRUSTED_HOSTS='^symfony4.local$'
DATABASE_URL=mysql://homestead:[email protected]:3306/symfony4appdb

The security.yaml file looks like:

security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    encoders:
        AppEntityUser:
            algorithm: bcrypt
    providers:
        #in_memory: { memory: ~ }
        app_user_provider:
            entity:
                class: AppEntityUser
                property: username    
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: true
            guard:
                authenticators:
                    - AppSecurityLoginFormAuthenticator
            logout:
                path: app_logout
                target: /path/to/login

            # activate different ways to authenticate

            # http_basic: true
            # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

            # form_login: true
            # https://symfony.com/doc/current/security/form_login_setup.html

    # Easy way to control access for large sections of your site
    # Note: Only the *first* access control that matches will be used
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/master, roles: ROLE_USER }

What am I missing?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *