I am configuring tmda on debian 8. I am running tmda-filter.py as root.
This script reads a key file. that it insists be CHMOD 400 or 600. The script executes from /package/tmda-fork/tmda/bin/tmda-filter belonging to
ROOT:ROOT
The key is in /vpopmail/domains/.tmda/crypt_key owned by ROOT:ROOT
Traceback (most recent call last):
File "/package/tmda-fork/tmda/bin/tmda-filter", line 50, in <module>
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/package/tmda-fork/tmda/bin/tmda-rfilter", line 164, in <module>
from TMDA import Defaults
File "/package/tmda-fork/tmda/TMDA/Defaults.py", line 1753, in <module>
CRYPT_KEY = binascii.unhexlify(open(CRYPT_KEY_FILE).read().strip())
IOError: [Errno 13] Permission denied: '/home/vpopmail/domains/mydomain.com/.tmda/crypt_key'
Change owners on key file to directory owners and it executed.
chown vpopmail:vchkpw
Related
I am creating a virtual environment using mkvirtualenv, and I get this error, where have I gone wrong?
$ mkvirtualenv data
New python executable in /home/usman/.virtualenvs/data/bin/python
Installing setuptools, pip, wheel...
Complete output from command /home/usman/.virtualenvs/data/bin/python - setuptools pip wheel:
Collecting setuptools
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 386, in find_all_candidates
self.find_links, expand_dir=True)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 236, in _sort_locations
sort_path(os.path.join(path, item))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 217, in sort_path
if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
File "/usr/lib/python2.7/mimetypes.py", line 293, in guess_type
init()
File "/usr/lib/python2.7/mimetypes.py", line 358, in init
db.read(file)
File "/usr/lib/python2.7/mimetypes.py", line 202, in read
with open(filename) as fp:
IOError: [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'
sudo chmod a+r /usr/local/lib/netscape/mime.types
This is probably because your file "mime.types" has not the sufficient permission status.
Use the chmod command as mentioned earlier.
I'm running tensorflow in Ubuntu (in VirtualEnv).
I want to create training model ...( using retrain.py to train the model )..
Github code link ==> https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/image_retraining/retrain.py
I tried to use command to run in terminal
python image_retraining/retrain.py \
--bottleneck_dir= /tf_files/bottlenecks \
--how_many_training_steps 100 \
--model_dir= /tf_files/inception \
--output_graph= /tf_files/retrained_graph.pb \
--output_labels= /tf_files/retrained_labels.txt \
--image_dir = /Image_Processing/theory/Green
I'm getting error. How to read that error and how to resolve it..
Traceback (most recent call last):
File "image_retraining/retrain.py", line 1061, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/Image_Processing/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "image_retraining/retrain.py", line 777, in main
maybe_download_and_extract()
File "image_retraining/retrain.py", line 288, in maybe_download_and_extract
os.makedirs(dest_directory)
File "/Image_Processing/tensorflow/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''
Note :- I'm new in tensorflow and just started to use it..
while running retrain.py, you do not have to specify all the parameters.
Just specify
python /path_to_file/retrain.py --img_dir /dir_containing_subfolders_of_images
while running the code and it will use default paths for remaining arguments. eg. /tmp/some_dir_or_file for most cases.
If you want to specify custom locations create the desired directories and specify those paths.
eg.
python /path_to_file/retrain.py
--img_dir /dir_containing_subfolders_of_images
--how_many_training_steps number_of_steps
--output_graph /dirPath_to_store_output_graph/file_name.pb
--output_labels /dirPath_to_store_output_labels/file_name.txt
All of a sudden When I try to add python3 to virtualenv like this
virtualenv -p python3 env
I get the following error
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv-13.1.2.dist-info/DESCRIPTION.rst'
This just started happening out of nowhere a few hours ago because I have been using it tonite. Can anyone tell me what's going on with this? thanks
Here is some software information
Django 1.8.1
Apache2
Fedora 21
error_log output
mod_wsgi (pid=8272): Target WSGI script '/var/www/anime/anime/wsgi.py' cannot be loaded as Python module.
mod_wsgi (pid=8272): Exception occurred processing WSGI script '/var/www/anime/anime/wsgi.py'.
Traceback (most recent call last):
File "/usr/lib64/python3.4/logging/config.py", line 557, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib64/python3.4/logging/config.py", line 725, in configure_handler
result = factory(**kwargs)
File "/usr/lib64/python3.4/logging/__init__.py", line 999, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib64/python3.4/logging/__init__.py", line 1023, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/var/www/anime/log/info.log'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/anime/anime/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
django.setup()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/utils/log.py", line 86, in configure_logging
logging_config_func(logging_settings)
File "/usr/lib64/python3.4/logging/config.py", line 789, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib64/python3.4/logging/config.py", line 565, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/var/www/anime/log/info.log'
Here is the permission mask on the file
drwxrwxrwx. 2 apache apache 21 May 28 15:22 .
drwxr-xr-x. 6 apache apache 90 May 28 14:53 ..
-rwxrwxrwx. 1 apache apache 0 May 28 15:22 info.log
I have already searched SOF on all the possible solutions and none of them works. Therefore I suspect that it has something to do with SELinux setting? If it is, can someone tell me which flag do i need to set to true?
After reading up on SELinux, I have figured out the solution for this permission error. And I hope that it will help the others who have encountered similar situation when deploying on production server under RHEL linux.
Basically running the command ls -Z shows the following
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 log
the folder is labelled with httpd_sys_content_t which does not allow httpd to have write access the the folder. Therefore we need to change this label to httpd_sys_rw_content_t
Firstly, we need to add an entry to the fcontext to inform SELinux what is the default label for files, that will be created, in this folder.
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/directory(/.*)?"
This will add an entry to the fcontext file (/etc/selinux/targeted/contexts/files/file_contexts.local)
Next we need to update all the labels of the files in the folder using restorecon.
sudo restorecon -R -v /path/to/directory
And now the permission error related to the django logging will be gone from the httpd error_log =)
Doing a "pip install dj-database-url" gave the following errors:
Downloading/unpacking dj-database-url Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 942, in prepare_files
location = req_to_install.build_location(self.build_dir, not self.is_download) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 144, in build_location
_make_build_dir(build_dir) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1185, in
_make_build_dir
os.makedirs(build_dir) File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode) OSError: [Errno 13] Permission denied: '/vagrant/django_projects/microblog/build'
Storing complete log in /var/lib/postgresql/.pip/pip.log
I don't know what i'm doing wrong. Please help.
Setup virtualenv and start it up.
pip install Django psycopg2 south dj-database-url
Use virtualenv or run your command using sudo.