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?
python django
add a comment |
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?
python django
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
add a comment |
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?
python django
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
python django
asked Nov 11 at 12:25
Majid Rajabi
2610
2610
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
add a comment |
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
add a comment |
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
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 withsudo
. and change the permissions of the file to 666 , if you want to know about what each permissionnumber
represent - google : linux permissions.
– ddor254
Nov 12 at 9:33
add a comment |
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
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 withsudo
. and change the permissions of the file to 666 , if you want to know about what each permissionnumber
represent - google : linux permissions.
– ddor254
Nov 12 at 9:33
add a comment |
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
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 withsudo
. and change the permissions of the file to 666 , if you want to know about what each permissionnumber
represent - google : linux permissions.
– ddor254
Nov 12 at 9:33
add a comment |
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
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
edited Nov 12 at 9:33
answered Nov 11 at 12:40
ddor254
770418
770418
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 withsudo
. and change the permissions of the file to 666 , if you want to know about what each permissionnumber
represent - google : linux permissions.
– ddor254
Nov 12 at 9:33
add a comment |
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 withsudo
. and change the permissions of the file to 666 , if you want to know about what each permissionnumber
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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