Alex.Barylski
Alex.Barylski

Reputation: 2933

Symfony framework.yaml invalid YAML - but it's not?

I've started getting this error...not sure why or how?

Here is the framework.yaml:

security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        ad_ldap:
            ldap:
                service: Symfony\Component\Ldap\Ldap
                base_dn: dc=mydomain,dc=local
                search_dn: 'appuser'
                search_password: "xxx"
                default_roles: ROLE_USER
                uid_key: 'sAMAccountName'
                filter: '({uid_key}={username})'        
        

Giving me this error:

In FileLoader.php line 180: The file "/vagrant/project/config/packages/security.yaml" does not contain valid YAML: Unexpected characters near "rname})' " at line 12 (near "filter: '({uid_key}={us ername})' ") in /vagrant/project/config/packages/security.yaml (which is loaded in resource "/vagrant/project/config/packages/security.yaml").

In YamlFileLoader.php line 693: The file "/vagrant/project/config/packages/security.yaml" does not contain valid YAML: Unexpected characters near "rname})' " at line 12 (near "filter: '({uid_key}={us ername})' ").

In Parser.php line 760: Unexpected characters near "rname})' " at line 12 (near "filter: '({uid_key}={username})' ").

Upvotes: 1

Views: 738

Answers (2)

craigh
craigh

Reputation: 2291

The problem is a vendor issue with symfony and is corrected already but not released as of this writing.

https://github.com/symfony/symfony/issues/39229

Upvotes: 2

domis86
domis86

Reputation: 1357

See: https://symfony.com/doc/current/components/yaml/yaml_format.html#strings

the part:

Strings containing any of the following characters must be quoted. Although you can use double quotes, for these characters it is more convenient to use single quotes, which avoids having to escape any backslash :

    :, {, }, [, ], ,, &, *, #, ?, |, -, <, >, =, !, %, @, `

Can you try quoting all strings there? (using single quotes)

Also, which Symfony version?

Upvotes: 0

Related Questions