django-pipeline
django-pipeline copied to clipboard
Compile permission error
I find a very specific problem related to permissions due to the MR #694
Error:
Error compiling CSS package "bootstrap"
Command:
/usr/bin/sass /home/user/my-project/static/bootstrap.scss /var/www/my-project.com/static/bootstrap.css
Errors:
[Errno 13] Permission denied: '/home/user/my-project/static/tmp75g2esr9'
Related code (pipeline/compilers/__init__.py
):
project_infile = finders.find(input_path)
outfile = compiler.output_path(infile, compiler.output_extension)
outdated = compiler.is_outdated(project_infile, outfile)
compiler.compile_file(project_infile, outfile,
Investigation:
If I run the project as www-data
(uwsgi context) and not as user
, who owner of the repertory /home/user/my-project/
. When permissions 644 are recursivly apply on my user repertory, pipeline (as www-data) try to create a "temporary file" (tmp75g2esr9) and that is not allowed.
Solution:
May be we can generate the temporary file (project_infile
) in /tmp
? which would be more adequate?
Hi, I have this exact problem. Is there any solution to this?
Hi @D-Pavlov,
My monkey solution (for the moment) was to manually rollback to have the old behavior how doesn't generate temporaries files. I will work on a more general fix soon.
Hi @TheBuky,
Thank you for the quick reply!
Turns out I don't get the error if I use 'pipeline.storage.PipelineStorage'
instead of 'pipeline.storage.PipelineCachedStorage'
, so I'll roll with that for the time being.
Maybe this information can be useful to you, maybe not 😄
Anyway, thanks again, cheers!