Skip to content

VarnishPurger error on v3.1.* (3.1.0 & 3.1.1) #5382

@audain-dg

Description

@audain-dg

API Platform version(s) affected: 3.1.* (3.1.0 to 3.1.1)

Description

when i want to upgrade api-platfrom 3.0.11 to 3.1.1 i have this error

Too few arguments to function ApiPlatform\HttpCache\VarnishPurger::__construct(), 0 passed in /srv/api/var/cache/dev/ContainerFQGSIEN/App_KernelDevDebugContainer.php on line 1420 and at least 1 expected

How to reproduce

Just add a valid varnish URL like example here:

    api_platform:
    enable_docs: true
    http_cache:
        invalidation:
            enabled: true
            varnish_urls: [ '%env(resolve:VARNISH_URL_1)%','%env(resolve:VARNISH_URL_2)%' ]
        public: true
    defaults:
        cache_headers:
            max_age: 0
            shared_max_age: 3600
            vary: [ 'Content-Type', 'Authorization', 'Origin' ]

Possible Solution

If you have the same problem has me just downgrade to 3.0.11

Additional Context

i use symfony "6.2.*"
Screenshot_1

Thank you in advance for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions