LexikMaintenanceBundle icon indicating copy to clipboard operation
LexikMaintenanceBundle copied to clipboard

Lock, no such file or directory

Open Cypaubr opened this issue 8 years ago • 5 comments

When executing the lock command, Symfony throws a ContextErrorException : Warning: fopen(/var/www/1day-symfony/app/var/cache/lock): failed to open stream: No such file or directory

How can I fix this?

Cypaubr avatar Sep 26 '16 23:09 Cypaubr

Hi, what is your Symfony version ?

sdieunidou avatar Sep 27 '16 09:09 sdieunidou

The last release, Symfony3. I fixed this issue but now when I execute the command to lock the site, nothing changes.

Cypaubr avatar Sep 27 '16 13:09 Cypaubr

Hi, Current configuration:

class: '\Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver'
options: {file_path: %kernel.root_dir%/cache/lock}

Working configuration:

class: '\Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver'
options: {file_path: /var/www/1day-symfony/var/cache/lock}

gizmo-rt avatar Jan 18 '17 14:01 gizmo-rt

Hi @Cypaubr @gizmo-rt Do you remember which exactly symfony3 version did you use?

This issues could be caused by https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory

But %kernel.root_dir%/cache/lock for symfony3 points to the directory with AppKernel.php file. So, it's weird to see AppKernel.php in /app/var/

aivus avatar Dec 07 '17 09:12 aivus

@aivus I don't remember, but not the 3.3 for sure it was older.

Cypaubr avatar Dec 07 '17 10:12 Cypaubr