Bug 47610 - Wrong permissions on http_api.log prevents start of ucs-school-import-http-api.service
Wrong permissions on http_api.log prevents start of ucs-school-import-http-ap...
Status: CLOSED DUPLICATE of bug 47514
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
UCS@school 4.3
Other other
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Jürn Brodersen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-17 15:06 CEST by Michael Grandjean
Modified: 2023-03-25 06:44 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2018-08-17 15:06:48 CEST
root@ucs01:~# univention-app info
UCS: 4.3-1 errata202
Installed: nagios=4.3 ucsschool=4.3 v4
Upgradable:

ucs-school-import-http-api: 16.0.2-22A~4.3.0.20180704084

root@ucs01:~# ls -la /var/log/univention/ucs-school-import/http_api.log
-rw-r--r-- 1 root root 0 Aug 17 14:57 /var/log/univention/ucs-school-import/http_api.log

root@ucs01:~# systemctl status ucs-school-import-http-api.service
● ucs-school-import-http-api.service - gunicorn-ucsschool-import
   Loaded: loaded (/lib/systemd/system/ucs-school-import-http-api.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-08-17 14:59:24 CEST; 5min ago
  Process: 4722 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=1/FAILURE)
  Process: 4712 ExecStart=/usr/bin/gunicorn --config /etc/gunicorn.d/ucs-school-import ucsschool.http_api.app.wsgi:application (code=exited, status=1/FAILURE)
 Main PID: 4712 (code=exited, status=1/FAILURE)
      CPU: 1.546s

-> /var/log/univention/ucs-school-import/gunicorn_error.log
[...]
[2018-08-17 14:59:24 +0000] [4718] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
    worker.init_process()
  File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
    self.load_wsgi()
  File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 384, in import_app
    __import__(module)
  File "/usr/lib/pymodules/python2.7/ucsschool/http_api/app/wsgi.py", line 42, in <module>
    _application = get_wsgi_application()
  File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/pymodules/python2.7/ucsschool/http_api/import_api/models.py", line 44, in <module>
    from ucsschool.http_api.import_api.import_logging import logger
  File "/usr/lib/pymodules/python2.7/ucsschool/http_api/import_api/import_logging.py", line 53, in <module>
    _file_handler = logging.FileHandler(settings.UCSSCHOOL_IMPORT['logging']['api_logfile'])
  File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: u'/var/log/univention/ucs-school-import/http_api.log'
[...]


Workaround:

root@ucs01:~# chown uas-import:uas-import /var/log/univention/ucs-school-import/http_api.log
Comment 1 Daniel Tröder univentionstaff 2018-08-17 15:19:31 CEST

*** This bug has been marked as a duplicate of bug 47514 ***