Report this

What is the reason for this report?

I deployed my Django website on your web server. I am Facing permission errors while my python script is trying to read mp4 files.

Posted on April 30, 2019

Why am I facing permission errors when my python script tries to load MP4 files after downloading them if necessary. Kindly suggest some remedy as soon as possible. I will be really grateful to you.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Greetings!

It is important that the files be readable by the user that is running the application. I can’t tell you exactly how to tell what that user is, but I can give you an idea how to find it. Let’s take the service “syslogd” on my server and find out what user it runs as:

 [root@gateway] ~ # ps faux | grep syslogd | head -1 | awk '{print $1}'
syslog

So in my case, syslogd is run by the user “syslog” on the system. If the syslogd service needed to access a file, the easiest method would be to set ownership of that file. Let’s say that file is “/var/www/html/video.mp4” for my example. I would run this:

chown syslog. /var/www/html/video.mp4

Hopefully that can help to apply the theory to your situation.

Jarland

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.