Skip to content

Symfony 4.4.3 cache:clear doesn't work on Vagrant with NFS mount #35421

@sjadema

Description

@sjadema

Symfony version(s) affected: 4.4.3

Description
After updating to Symfony 4.4.3 it's impossible to run composer install or bin/console cache:clear from inside a Vagrant box with NFS mounted folders. The error message is:

Symfony\Component\ErrorHandler\Error\UndefinedMethodError^ {
  #message: "Attempted to call an undefined method named "release" of class "Symfony\Component\Config\ConfigCache"."
  #code: 0
  #file: "./vendor/symfony/http-kernel/Kernel.php"
  #line: 637
  trace: {
    ./vendor/symfony/http-kernel/Kernel.php:637 { …}
    ./vendor/symfony/http-kernel/Kernel.php:136 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:169 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:75 { …}
    ./vendor/symfony/console/Application.php:148 { …}
    ./bin/console:42 {
      › $application = new Application($kernel);
      › $application->run($input);
      › 
      arguments: {
        $input: Symfony\Component\Console\Input\ArgvInput {#1 …}
      }
    }
  }
}
2020-01-21T15:30:21+00:00 [critical] Uncaught Error: Call to undefined method Symfony\Component\Config\ConfigCache::release()

How to reproduce

  • Deploy a Symfony 4.4.3 project inside a Vagrant guest with NFS mounted folders.
  • Try either the composer install or bin/console cache:clear commands.

Possible Solution
It looks like the check @ https://github.com/symfony/http-kernel/blob/v4.4.3/Kernel.php#L537-L574 returns true for a Vagrant environment. As per this previous issue, Vagrant has trouble with with the LOCK_EX which might trigger that condition to return true. On https://github.com/symfony/http-kernel/blob/v4.4.3/Kernel.php#L637, the $cache->release() method is called but the dynamic $cache class is never created and the method doesn't exist in the parent class.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions