{"action":"closed","issue":{"url":"https://api.github.com/repos/pyeve/eve/issues/1113","repository_url":"https://api.github.com/repos/pyeve/eve","labels_url":"https://api.github.com/repos/pyeve/eve/issues/1113/labels{/name}","comments_url":"https://api.github.com/repos/pyeve/eve/issues/1113/comments","events_url":"https://api.github.com/repos/pyeve/eve/issues/1113/events","html_url":"https://github.com/pyeve/eve/issues/1113","id":297815453,"node_id":"MDU6SXNzdWUyOTc4MTU0NTM=","number":1113,"title":"Eve with uWSGI must be started with root level privileges","user":{"login":"mohierf","id":2932687,"node_id":"MDQ6VXNlcjI5MzI2ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/2932687?v=4","gravatar_id":"","url":"https://api.github.com/users/mohierf","html_url":"https://github.com/mohierf","followers_url":"https://api.github.com/users/mohierf/followers","following_url":"https://api.github.com/users/mohierf/following{/other_user}","gists_url":"https://api.github.com/users/mohierf/gists{/gist_id}","starred_url":"https://api.github.com/users/mohierf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohierf/subscriptions","organizations_url":"https://api.github.com/users/mohierf/orgs","repos_url":"https://api.github.com/users/mohierf/repos","events_url":"https://api.github.com/users/mohierf/events{/privacy}","received_events_url":"https://api.github.com/users/mohierf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T15:08:15Z","updated_at":"2018-06-25T13:40:12Z","closed_at":"2018-06-25T13:40:12Z","author_association":"NONE","body":"Running Eve with uWSGI and a non-root user account raises an error that breaks the application.\r\n```\r\nAlignak backend uWSGI configuration file: /root/git/Smoove/smoove/etc/alignak-backend/uwsgi.ini\r\nAlignak backend configuration file: /root/git/Smoove/smoove/etc/alignak-backend/settings.json\r\n[uWSGI] getting INI configuration from /root/git/Smoove/smoove/etc/alignak-backend/uwsgi.ini\r\n*** Starting uWSGI 2.0.16 (64bit) on [Fri Feb 16 16:04:25 2018] ***\r\ncompiled with version: 4.2.1 Compatible FreeBSD Clang 4.0.0 (tags/RELEASE_400/final 297347) on 16 February 2018 12:59:22\r\nos: FreeBSD-11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 #0: Wed Aug  9 11:55:48 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC\r\nnodename: alignak_new\r\nmachine: amd64\r\nclock source: unix\r\npcre jit disabled\r\ndetected number of CPU cores: 4\r\ncurrent working directory: /root/git/alignak-backend\r\nwriting pidfile to /tmp/alignak-backend.pid\r\ndetected binary path: /usr/local/bin/uwsgi\r\ndropping root privileges as early as possible\r\nsetuid() to 1001\r\nyour processes number limit is 234770\r\nyour memory page size is 4096 bytes\r\ndetected max file descriptor number: 469539\r\nlock engine: POSIX semaphores\r\nthunder lock: disabled (you can enable it with --thunder-lock)\r\nuwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 3\r\ndropping root privileges after socket binding\r\nPython version: 2.7.14 (default, Feb 13 2018, 15:26:49)  [GCC 4.2.1 Compatible FreeBSD Clang 4.0.0 (tags/RELEASE_400/final 297347)]\r\nPython main interpreter initialized at 0x803c7d000\r\ndropping root privileges after plugin initialization\r\npython threads support enabled\r\nyour server socket listen backlog is limited to 100 connections\r\nyour mercy for graceful operations on workers is 60 seconds\r\nmapped 914184 bytes (892 KB) for 8 cores\r\n*** Operational MODE: preforking ***\r\nTraceback (most recent call last):\r\n  File \"./alignak_backend/app.py\", line 32, in <module>\r\n    from eve import Eve\r\n  File \"/usr/local/lib/python2.7/site-packages/Eve-0.7.8-py2.7.egg/eve/__init__.py\", line 87, in <module>\r\n    from eve.flaskapp import Eve  # noqa\r\n  File \"/usr/local/lib/python2.7/site-packages/Eve-0.7.8-py2.7.egg/eve/flaskapp.py\", line 24, in <module>\r\n    from eve.endpoints import collections_endpoint, item_endpoint, home_endpoint, \\\r\n  File \"/usr/local/lib/python2.7/site-packages/Eve-0.7.8-py2.7.egg/eve/endpoints.py\", line 14, in <module>\r\n    from bson import tz_util\r\n  File \"build/bdist.freebsd-11.1-RELEASE-p1-amd64/egg/bson/__init__.py\", line 107, in <module>\r\n  File \"build/bdist.freebsd-11.1-RELEASE-p1-amd64/egg/bson/_cbson.py\", line 7, in <module>\r\n  File \"build/bdist.freebsd-11.1-RELEASE-p1-amd64/egg/bson/_cbson.py\", line 4, in __bootstrap__\r\n  File \"/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1226, in resource_filename\r\n    self, resource_name\r\n  File \"/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1729, in get_resource_filename\r\n    self._extract_resource(manager, self._eager_to_zip(name))\r\n  File \"/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1759, in _extract_resource\r\n    self.egg_name, self._parts(zip_path)\r\n  File \"/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1293, in get_cache_path\r\n    self.extraction_error()\r\n  File \"/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1273, in extraction_error\r\n    raise err\r\npkg_resources.ExtractionError: Can't extract file(s) to egg cache\r\n\r\nThe following error occurred while trying to extract file(s)\r\nto the Python egg cache:\r\n\r\n  [Errno 13] Permission denied: '/root/.cache/Python-Eggs'\r\n\r\nThe Python egg cache directory is currently set to:\r\n\r\n  /root/.cache/Python-Eggs\r\n\r\nPerhaps your account does not have write access to this directory?\r\nYou can change the cache directory by setting the PYTHON_EGG_CACHE\r\nenvironment variable to point to an accessible directory.\r\n\r\nunable to load app 0 (mountpoint='') (callable not found or import error)\r\n*** no app loaded. going in full dynamic mode ***\r\ndropping root privileges after application loading\r\n*** uWSGI is running in multiple interpreter mode ***\r\nspawned uWSGI master process (pid: 58709)\r\nspawned uWSGI worker 1 (pid: 58714, cores: 1)\r\nspawned uWSGI worker 2 (pid: 58715, cores: 1)\r\nspawned uWSGI worker 3 (pid: 58716, cores: 1)\r\nspawned uWSGI worker 4 (pid: 58717, cores: 1)\r\nspawned uWSGI worker 5 (pid: 58718, cores: 1)\r\nspawned uWSGI worker 6 (pid: 58719, cores: 1)\r\nspawned uWSGI worker 7 (pid: 58720, cores: 1)\r\nspawned uWSGI worker 8 (pid: 58721, cores: 1)\r\n```\r\n\r\nMy uWSGI configuration file:\r\n```\r\n[uwsgi]\r\nhttp-socket = 0.0.0.0:5000\r\n\r\n# Uncomment if you installed from distribution packaging\r\n# plugin = python\r\n# Uncomment if you installed from distribution packaging\r\n# plugin = logfile\r\n\r\n# Python module\r\nmodule = alignak_backend.app:app\r\n\r\nenable-threads = true\r\nprocesses = 8\r\n\r\n# Log requests activity (disable by default because too verbose)\r\n# req-logger = file:/usr/local/var/log/alignak-backend/backend-access.log\r\n# Log information, errors...\r\n;logger = file:/usr/var/log/alignak-backend/backend-error.log\r\n\r\n# Report memory activity to the stats\r\nmemory-report = true\r\n\r\n# Define specific uid/gid if uWSGI started as root\r\nuid = alignak\r\nguid = alignak\r\n\r\n# Default buffer size for HTTP header is very low (4096)\r\nbuffer-size = 32768\r\n\r\n# uWSGI master process: use a master process and store its pid\r\nmaster = true\r\npidfile = /tmp/alignak-backend.pid\r\n\r\n# ---\r\n# Statistics part\r\n# Uncomment this line to activate statistics sending to carbon/graphite\r\n# carbon =  127.0.0.1:2003\r\n# defaults to uwsgi\r\ncarbon-root = alignak-backend\r\n# replace dots in hostnames\r\ncarbon-hostname-dots = -\r\n```\r\n\r\nThe application starts correctly if I comment the `user` and `group` variables ... but then my application runs with root level privileges :/\r\n\r\n**note** that with former Eve versions I did not have this problem"}}
{"actor":{"display_login":"nicolaiarocci"}}