Today we had some issue with LinOTP EE 2.6.1.
We don't use the appliance.
In LinOTP there is some function to do a rotation of linotp logs.
configuration is in /etc/linotp/linotp.ini:
[handler_file]
class = handlers.RotatingFileHandler
# Make the logfiles 10 MB
# and rotate 4 files
args = ('/var/log/linotp/linotp.log','a', 10000000, 4)
level = INFO
formatter = generic
The error message we had in apache error logs:
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] mod_wsgi (pid=8911): Target WSGI script '/etc/linotp2/linotpapp.wsgi' cannot be loaded as Python module.
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] mod_wsgi (pid=8911): Exception occurred processing WSGI script '/etc/linotp2/linotpapp.wsgi'.
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] Traceback (most recent call last):
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/etc/linotp2/linotpapp.wsgi", line 11, in <module>
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] fileConfig( INIFILE )
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/opt/linotp/lib/python2.7/site-packages/paste/script/util/logging_config.py", line 85, in fileConfig
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] handlers = _install_handlers(cp, formatters)
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/opt/linotp/lib/python2.7/site-packages/paste/script/util/logging_config.py", line 158, in _install_handlers
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] h = apply(klass, args)
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/usr/lib/python2.7/logging/handlers.py", line 117, in __init__
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/usr/lib/python2.7/logging/handlers.py", line 64, in __init__
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] logging.FileHandler.__init__(self, filename, mode, encoding, delay)
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/usr/lib/python2.7/logging/__init__.py", line 901, in __init__
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] StreamHandler.__init__(self, self._open())
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] File "/usr/lib/python2.7/logging/__init__.py", line 924, in _open
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] stream = open(self.baseFilename, self.mode)
[Mon May 12 10:36:33 2014] [error] [client 172.31.1.99] IOError: [Errno 13] Permission denied: '/var/log/linotp/linotp.log'
By checking the different logs permission:
/var/log/apache2# ll /var/log/linotp/
total 34008
-rw-r--r-- 1 root root 2830119 May 12 10:39 linotp.log -> incorrect permissions
-rw-r--r-- 1 root root 9999921 May 12 04:14 linotp.log.1 -> incorrect permissions
-rw-r--r-- 1 linotp www-data 9999794 May 11 05:28 linotp.log.2 -> OK
-rw-r--r-- 1 root root 1926765 May 10 07:58 linotp.log.3 -> incorrect permissions
-rw-r--r-- 1 linotp www-data 9999958 May 10 03:36 linotp.log.4 -> OK
After changing :
-rw-r--r-- 1 linotp www-data 344388 May 12 10:49 linotp.log -> changed from root:root to linotp:www-data => OK
All works again.
When not OK: could not connect to linotp backoffice, request OTP, etc...
have you ever faced such issue?
any ideas what caused the wrong permission?
thank you.