{"action":"created","issue":{"url":"https://api.github.com/repos/tendenci/tendenci/issues/516","repository_url":"https://api.github.com/repos/tendenci/tendenci","labels_url":"https://api.github.com/repos/tendenci/tendenci/issues/516/labels{/name}","comments_url":"https://api.github.com/repos/tendenci/tendenci/issues/516/comments","events_url":"https://api.github.com/repos/tendenci/tendenci/issues/516/events","html_url":"https://github.com/tendenci/tendenci/issues/516","id":179945218,"number":516,"title":"502 bad gateway and gunicorn missing","user":{"login":"matthewlehew","id":4981740,"avatar_url":"https://avatars.githubusercontent.com/u/4981740?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewlehew","html_url":"https://github.com/matthewlehew","followers_url":"https://api.github.com/users/matthewlehew/followers","following_url":"https://api.github.com/users/matthewlehew/following{/other_user}","gists_url":"https://api.github.com/users/matthewlehew/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewlehew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewlehew/subscriptions","organizations_url":"https://api.github.com/users/matthewlehew/orgs","repos_url":"https://api.github.com/users/matthewlehew/repos","events_url":"https://api.github.com/users/matthewlehew/events{/privacy}","received_events_url":"https://api.github.com/users/matthewlehew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-29T03:36:56Z","updated_at":"2016-09-29T17:06:28Z","closed_at":null,"body":"I'm following the installation instructions in the 7.2.41 documentation on an AWS EC2 instance running Ubuntu 14.04.5. When completing the Testing Installation and converting it to a Scalable Installation, I'm getting 502 Bad Gateway errors when trying to access the site. Everything seems to go well when installing, however. \r\n\r\nThere is one thing I've noticed: the Upstart script provided contains the following line:\r\n\r\n`exec /srv/tendenci/venv/bin/gunicorn -w 2 -b 127.0.0.1:8000 conf.wsgi --max-requests 350`\r\n\r\nBut when looking in the directory, the gunicorn folder is not present. This is after completing the creation of the virtualenv with:\r\n\r\n`sudo virtualenv venv`\r\n\r\n`source venv/bin/activate`\r\n\r\nI confess I don't know a lot about Django or Virtualenv, so is there a step I'm missing to manually install gunicorn? Additionally, I've noticed that when following the instructions to the letter, I still have to use `sudo` even when the virturalenv is activated.\r\n\r\nAny thoughts or troubleshooting tips would be fantastic!"},"comment":{"url":"https://api.github.com/repos/tendenci/tendenci/issues/comments/250529354","html_url":"https://github.com/tendenci/tendenci/issues/516#issuecomment-250529354","issue_url":"https://api.github.com/repos/tendenci/tendenci/issues/516","id":250529354,"user":{"login":"matthewlehew","id":4981740,"avatar_url":"https://avatars.githubusercontent.com/u/4981740?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewlehew","html_url":"https://github.com/matthewlehew","followers_url":"https://api.github.com/users/matthewlehew/followers","following_url":"https://api.github.com/users/matthewlehew/following{/other_user}","gists_url":"https://api.github.com/users/matthewlehew/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewlehew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewlehew/subscriptions","organizations_url":"https://api.github.com/users/matthewlehew/orgs","repos_url":"https://api.github.com/users/matthewlehew/repos","events_url":"https://api.github.com/users/matthewlehew/events{/privacy}","received_events_url":"https://api.github.com/users/matthewlehew/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T17:06:28Z","updated_at":"2016-09-29T17:06:28Z","body":"Thank you for the response! I actually nuked the installation last night to start over, but I'm working through it again. This is the only site on the server.\r\n\r\nHere are the specs for the server environment:\r\n\r\n- Ubuntu 14.04.5 LTS\r\n- Kernel release: 3.13.0-91-generic\r\n- Tendenci version: 7.2\r\n- Python version: 2.7.6\r\n- Following instructions at: http://tendenci.readthedocs.io/en/latest/installation/installation.html\r\n\r\nThe AWS way of provisioning Ubuntu servers involves a rootless method where I connect as a user called \"ubuntu,\" which has sudo privileges. I don't do anything with sudo su, either. \r\n\r\nI've noticed that installing pip via the second method (which I do because my Python version is less than 2.7.9) causes all pip actions to face an InsecurePlatformWarning. Also, the instructions say that doing anything in venv allows me to do not use sudo, but I haven't found that to be the case. On the next step, installing Django in venv, if I don't use sudo I get an exception. Here's the readout from creating venv and trying to install Django:\r\n\r\n```\r\nubuntu@ip-10-0-31-24:/srv/tendenci$ sudo virtualenv venv\r\nNew python executable in /srv/tendenci/venv/bin/python\r\nInstalling setuptools, pip, wheel...done.\r\nubuntu@ip-10-0-31-24:/srv/tendenci$ source venv/bin/activate\r\n(venv) ubuntu@ip-10-0-31-24:/srv/tendenci$ pip install \"Django>=1.8,<1.9\"\r\nCollecting Django<1.9,>=1.8\r\n/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.\r\n  SNIMissingWarning\r\n/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\r\n  InsecurePlatformWarning\r\n  Downloading Django-1.8.15-py2.py3-none-any.whl (6.2MB)\r\n    100% |████████████████████████████████| 6.2MB 234kB/s\r\nInstalling collected packages: Django\r\nException:\r\nTraceback (most recent call last):\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/basecommand.py\", line 215, in main\r\n    status = self.run(options, args)\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/commands/install.py\", line 317, in run\r\n    prefix=options.prefix_path,\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/req/req_set.py\", line 742, in install\r\n    **kwargs\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/req/req_install.py\", line 831, in install\r\n    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/req/req_install.py\", line 1032, in move_wheel_files\r\n    isolated=self.isolated,\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/wheel.py\", line 346, in move_wheel_files\r\n    clobber(source, lib_dir, True)\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/wheel.py\", line 317, in clobber\r\n    ensure_dir(destdir)\r\n  File \"/srv/tendenci/venv/local/lib/python2.7/site-packages/pip/utils/__init__.py\", line 83, in ensure_dir\r\n    os.makedirs(path)\r\n  File \"/srv/tendenci/venv/lib/python2.7/os.py\", line 157, in makedirs\r\n    mkdir(name, mode)\r\nOSError: [Errno 13] Permission denied: '/srv/tendenci/venv/lib/python2.7/site-packages/django'\r\n```\r\n\r\nIt looks like creating venv with sudo is making all of the folders associated with it to be owned by root. Is that desired behavior?\r\n\r\nI also read elsewhere that invoking sudo in an active venv passes in a lot of system settings and destinations as opposed to the environment settings, although I don't know enough to know if that's true. If it is, however, that may explain the missing gunicorn and my 502. "}}
{"actor":{"display_login":"matthewlehew"}}