mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-26 16:15:50 +03:00
[GH-ISSUE #278] Permission Denied .secret_key_store #220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EmbeddedAndroid on GitHub (Apr 11, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/278
I just deployed the HEAD of master onto my server and am getting this error:
WARNING:root:No local_settings file found.
Traceback (most recent call last):
File "/var/www/webvirtmgr/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 263, in fetch_command
app_name = get_commands()[subcommand]
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 109, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/django/conf/init.py", line 53, in getattr
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/init.py", line 48, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/init.py", line 132, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/var/www/webvirtmgr/webvirtmgr/settings.py", line 194, in
'.secret_key_store'))
File "/var/www/webvirtmgr/webvirtmgr/utils/secret_key.py", line 56, in generate_or_read_from_file
with open(key_file, 'w') as f:
IOError: [Errno 13] Permission denied: '/var/www/webvirtmgr/webvirtmgr/local/.secret_key_store'
tyler@virt-manager:/etc/supervisor/conf.d$ cd /var/www/webvirtmgr/webvirtmgr/local/
tyler@virt-manager:/var/www/webvirtmgr/webvirtmgr/local$ ls
init.py local_settings.py.example
tyler@virt-manager:/var/www/webvirtmgr/webvirtmgr/local$ ls -al
total 12
drwxr-xr-x 2 root root 4096 Apr 11 12:54 .
drwxrwxr-x 5 www-data www-data 4096 Apr 11 12:56 ..
-rw-r--r-- 1 root root 0 Apr 11 12:54 init.py
-rw-r--r-- 1 root root 3800 Apr 11 12:54 local_settings.py.example
tyler@virt-manager:/var/www/webvirtmgr/webvirtmgr/local$ cd ..
tyler@virt-manager:/var/www/webvirtmgr/webvirtmgr$ ls -al
total 60
drwxrwxr-x 5 www-data www-data 4096 Apr 11 12:56 .
drwxr-xr-x 18 www-data www-data 4096 Apr 11 12:54 ..
-rw-rw-r-- 1 www-data www-data 0 Jan 29 21:30 init.py
-rw-rw-r-- 1 www-data www-data 132 Jan 29 21:30 init.pyc
drwxr-xr-x 2 root root 4096 Apr 11 12:54 local
-rw-r--r-- 1 root root 5542 Apr 11 12:54 settings_jenkins.py
-rw-r--r-- 1 root root 7071 Apr 11 12:54 settings.py
-rw-r--r-- 1 www-data www-data 3975 Apr 11 12:56 settings.pyc
drwxr-xr-x 6 root root 4096 Apr 11 12:54 static
-rw-r--r-- 1 root root 1625 Mar 9 04:49 urls.py
-rw-r--r-- 1 www-data www-data 1966 Mar 9 04:51 urls.pyc
drwxr-xr-x 2 root root 4096 Apr 11 12:54 utils
-rw-rw-r-- 1 www-data www-data 1431 Jan 29 21:30 wsgi.py
-rw-r--r-- 1 www-data www-data 1031 Jan 29 21:41 wsgi.pyc
tyler@virt-manager:/var/www/webvirtmgr/webvirtmgr$
What permissions would be correct for this directory?
@schmitch commented on GitHub (Apr 11, 2014):
755 is fine, but when you call manage.py with www-data local needs to have the user www-data like
chown www-data.www-data -R /var/www/webvirtmgr/localCurrently this is not an error or issue you should create, since its related to your server.
i mean you are logged in with tyler, on a directory which is owned by root and / or www-data, you definitly need to fix it or assign chmod 777 to local. but that is not a good solution since you publickey will be in the .secret_key_store file, which will get created for you.
@EmbeddedAndroid commented on GitHub (Apr 11, 2014):
Thanks that worked perfectly.