Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jms_serializer directory in cache is not writable #640

Closed
jakubmacak opened this issue Mar 7, 2018 · 10 comments
Closed

jms_serializer directory in cache is not writable #640

jakubmacak opened this issue Mar 7, 2018 · 10 comments
Assignees

Comments

@jakubmacak
Copy link

Hi,

on production, I have an issue with jms_serializer directory in cache. According to log, it is not writable, even if it has the same rights as any other directories in cache folder.

Here is an error from log:

[2018-03-07 11:35:17] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/project/releases/2/var/cache/prod/jms_serializer" is not writable." at /var/www/project/releases/2/vendor/jms/metadata/src/Metadata/Cache/FileCache.php line 17 {"exception":"[object] (InvalidArgumentException(code: 0): The directory \"/var/www/project/releases/2/var/cache/prod/jms_serializer\" is not writable. at /var/www/project/releases/2/vendor/jms/metadata/src/Metadata/Cache/FileCache.php:17)"} []

I'm not using JMSSerializerBundle standalone, but it is part of nelmio/api-doc-bundle and friendsofsymfony/rest-bundle.

On my local machine, there is no problem.

@goetas
Copy link
Collaborator

goetas commented Mar 7, 2018

This is mot probably related to your deploy process and server configs. Closing as is not relevant to the bundle

@goetas goetas closed this as completed Mar 7, 2018
@wamania
Copy link

wamania commented Sep 3, 2018

Same here, no pb on local.
Prod ok since 1 year.

Now :
[2018-02-01 16:26:26] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/xxx/var/cache/prod/jms_serializer" is not writable." at /var/www/xxx/vendor/jms/metadata/src/Metadata/Cache/FileCache.php line 17 {"exception":"[object] (InvalidArgumentException(code: 0): The directory "/var/www/xxx/var/cache/prod/jms_serializer" is not writable. at /var/www/xxxo/vendor/jms/metadata/src/Metadata/Cache/FileCache.php:17)"} []

Whatever i do :
setfacl
bin/console ca:c
rm cache * -R
chmod 777
etc

always this error

@goetas
Copy link
Collaborator

goetas commented Sep 10, 2018

solved in schmittjoh/metadata#72 (not yet released), will be part of the 2.0 serializer release

@goetas
Copy link
Collaborator

goetas commented Sep 10, 2018

backport to v1 is welcome

@wiejakp
Copy link

wiejakp commented Oct 17, 2018

Same issue, are there plans to fix this? Symfony 4 cache directory should be read only.

@joseortega
Copy link

I have the same problem, some solution

@goetas goetas reopened this Oct 25, 2018
@goetas goetas self-assigned this Oct 25, 2018
@goetas
Copy link
Collaborator

goetas commented Oct 25, 2018

Will try to find some time to backport it to 1.x

@joseortega
Copy link

Temporary solution:
In centos: assigning the permissions

setfacl -R -m u:"apache":rwX -m u:apache:rwX var/cache/prod/jms_serializer
setfacl -dR -m u:"apache":rwX -m u:apache:rwX var/cache/prod/jms_serializer

¡is working!

@goetas
Copy link
Collaborator

goetas commented Oct 26, 2018

Solved for v1 in schmittjoh/metadata#74

jms/metadata v1.7.0 is the tag

@goetas goetas closed this as completed Oct 26, 2018
@joseortega
Copy link

¡Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants