ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/var/log/mysite/mysite.log'









up vote
0
down vote

favorite












The production server is running right now and I just run the python manage.py shell in the VPS terminal but it says :



Traceback (most recent call last):
File "/usr/lib/python3.5/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.5/logging/config.py", line 731, in
configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.5/logging/handlers.py", line 150, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding,
delay)
File "/usr/lib/python3.5/logging/handlers.py", line 57, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python3.5/logging/__init__.py", line 1008, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied:
'/var/log/mysite/mysite.log'


what can I do?










share|improve this question





















  • Adapt the permissions to that file so your process can write to it.
    – Klaus D.
    Nov 11 at 12:31






  • 1




    change your config and log path, or make a directory and log file in /var/log/ and check permissions
    – RaminNietzsche
    Nov 11 at 12:40














up vote
0
down vote

favorite












The production server is running right now and I just run the python manage.py shell in the VPS terminal but it says :



Traceback (most recent call last):
File "/usr/lib/python3.5/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.5/logging/config.py", line 731, in
configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.5/logging/handlers.py", line 150, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding,
delay)
File "/usr/lib/python3.5/logging/handlers.py", line 57, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python3.5/logging/__init__.py", line 1008, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied:
'/var/log/mysite/mysite.log'


what can I do?










share|improve this question





















  • Adapt the permissions to that file so your process can write to it.
    – Klaus D.
    Nov 11 at 12:31






  • 1




    change your config and log path, or make a directory and log file in /var/log/ and check permissions
    – RaminNietzsche
    Nov 11 at 12:40












up vote
0
down vote

favorite









up vote
0
down vote

favorite











The production server is running right now and I just run the python manage.py shell in the VPS terminal but it says :



Traceback (most recent call last):
File "/usr/lib/python3.5/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.5/logging/config.py", line 731, in
configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.5/logging/handlers.py", line 150, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding,
delay)
File "/usr/lib/python3.5/logging/handlers.py", line 57, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python3.5/logging/__init__.py", line 1008, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied:
'/var/log/mysite/mysite.log'


what can I do?










share|improve this question













The production server is running right now and I just run the python manage.py shell in the VPS terminal but it says :



Traceback (most recent call last):
File "/usr/lib/python3.5/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.5/logging/config.py", line 731, in
configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.5/logging/handlers.py", line 150, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding,
delay)
File "/usr/lib/python3.5/logging/handlers.py", line 57, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "/usr/lib/python3.5/logging/__init__.py", line 1008, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied:
'/var/log/mysite/mysite.log'


what can I do?







python django






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 12:25









Majid Rajabi

159




159











  • Adapt the permissions to that file so your process can write to it.
    – Klaus D.
    Nov 11 at 12:31






  • 1




    change your config and log path, or make a directory and log file in /var/log/ and check permissions
    – RaminNietzsche
    Nov 11 at 12:40
















  • Adapt the permissions to that file so your process can write to it.
    – Klaus D.
    Nov 11 at 12:31






  • 1




    change your config and log path, or make a directory and log file in /var/log/ and check permissions
    – RaminNietzsche
    Nov 11 at 12:40















Adapt the permissions to that file so your process can write to it.
– Klaus D.
Nov 11 at 12:31




Adapt the permissions to that file so your process can write to it.
– Klaus D.
Nov 11 at 12:31




1




1




change your config and log path, or make a directory and log file in /var/log/ and check permissions
– RaminNietzsche
Nov 11 at 12:40




change your config and log path, or make a directory and log file in /var/log/ and check permissions
– RaminNietzsche
Nov 11 at 12:40












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










you have 2 options:
1 - change the permissions of the file /var/log/mysite/mysite.log so other users can write to it. like chmod 666 /var/log/mysite/mysite.log



2 - run your shell script from root or the user that own /var/log/mysite/mysite.log






share|improve this answer






















  • what is the role of 644? Is there any other options?
    – Majid Rajabi
    Nov 11 at 13:09










  • when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
    – Majid Rajabi
    Nov 11 at 13:36










  • Should I do it by sudo?
    – Majid Rajabi
    Nov 11 at 13:37










  • just leave your answer and go!
    – Majid Rajabi
    Nov 12 at 7:14










  • you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
    – ddor254
    Nov 12 at 9:33











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248742%2fvalueerror-unable-to-configure-handler-file-errno-13-permission-denied%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










you have 2 options:
1 - change the permissions of the file /var/log/mysite/mysite.log so other users can write to it. like chmod 666 /var/log/mysite/mysite.log



2 - run your shell script from root or the user that own /var/log/mysite/mysite.log






share|improve this answer






















  • what is the role of 644? Is there any other options?
    – Majid Rajabi
    Nov 11 at 13:09










  • when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
    – Majid Rajabi
    Nov 11 at 13:36










  • Should I do it by sudo?
    – Majid Rajabi
    Nov 11 at 13:37










  • just leave your answer and go!
    – Majid Rajabi
    Nov 12 at 7:14










  • you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
    – ddor254
    Nov 12 at 9:33















up vote
0
down vote



accepted










you have 2 options:
1 - change the permissions of the file /var/log/mysite/mysite.log so other users can write to it. like chmod 666 /var/log/mysite/mysite.log



2 - run your shell script from root or the user that own /var/log/mysite/mysite.log






share|improve this answer






















  • what is the role of 644? Is there any other options?
    – Majid Rajabi
    Nov 11 at 13:09










  • when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
    – Majid Rajabi
    Nov 11 at 13:36










  • Should I do it by sudo?
    – Majid Rajabi
    Nov 11 at 13:37










  • just leave your answer and go!
    – Majid Rajabi
    Nov 12 at 7:14










  • you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
    – ddor254
    Nov 12 at 9:33













up vote
0
down vote



accepted







up vote
0
down vote



accepted






you have 2 options:
1 - change the permissions of the file /var/log/mysite/mysite.log so other users can write to it. like chmod 666 /var/log/mysite/mysite.log



2 - run your shell script from root or the user that own /var/log/mysite/mysite.log






share|improve this answer














you have 2 options:
1 - change the permissions of the file /var/log/mysite/mysite.log so other users can write to it. like chmod 666 /var/log/mysite/mysite.log



2 - run your shell script from root or the user that own /var/log/mysite/mysite.log







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 9:33

























answered Nov 11 at 12:40









ddor254

735418




735418











  • what is the role of 644? Is there any other options?
    – Majid Rajabi
    Nov 11 at 13:09










  • when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
    – Majid Rajabi
    Nov 11 at 13:36










  • Should I do it by sudo?
    – Majid Rajabi
    Nov 11 at 13:37










  • just leave your answer and go!
    – Majid Rajabi
    Nov 12 at 7:14










  • you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
    – ddor254
    Nov 12 at 9:33

















  • what is the role of 644? Is there any other options?
    – Majid Rajabi
    Nov 11 at 13:09










  • when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
    – Majid Rajabi
    Nov 11 at 13:36










  • Should I do it by sudo?
    – Majid Rajabi
    Nov 11 at 13:37










  • just leave your answer and go!
    – Majid Rajabi
    Nov 12 at 7:14










  • you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
    – ddor254
    Nov 12 at 9:33
















what is the role of 644? Is there any other options?
– Majid Rajabi
Nov 11 at 13:09




what is the role of 644? Is there any other options?
– Majid Rajabi
Nov 11 at 13:09












when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
– Majid Rajabi
Nov 11 at 13:36




when I do chmod 644 /var/log/mysite/mysite.log it says : Operation not permitted
– Majid Rajabi
Nov 11 at 13:36












Should I do it by sudo?
– Majid Rajabi
Nov 11 at 13:37




Should I do it by sudo?
– Majid Rajabi
Nov 11 at 13:37












just leave your answer and go!
– Majid Rajabi
Nov 12 at 7:14




just leave your answer and go!
– Majid Rajabi
Nov 12 at 7:14












you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
– ddor254
Nov 12 at 9:33





you should change permissions with sudo . and change the permissions of the file to 666 , if you want to know about what each permission number represent - google : linux permissions.
– ddor254
Nov 12 at 9:33


















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248742%2fvalueerror-unable-to-configure-handler-file-errno-13-permission-denied%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線