Gunicorn can't connect to socket error [Running in vagrant]
<p>I'm running my django app with gunicorn and ran into a weird issue.</p>

<p>This command doesn't work -</p>

<pre><code>(venv)-bash-4.1$ gunicorn myapp.wsgi -b unix:/opt/myapp/var/run/app.sock 
[2016-09-15 06:04:12 +0000] [10100] [INFO] Starting gunicorn 19.4.5
[2016-09-15 06:04:12 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:13 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:14 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:15 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:16 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:17 +0000] [10100] [ERROR] Can't connect to /opt/myapp/var/run/app.sock
</code></pre>

<p>This one works</p>

<pre><code>(venv)-bash-4.1$ gunicorn myapp.wsgi -b unix:/tmp/myapp.sock 
    [2016-09-15 06:04:58 +0000] [10105] [INFO] Starting gunicorn 19.4.5
    [2016-09-15 06:04:58 +0000] [10105] [INFO] Listening at: unix:/tmp/myapp.sock (10105)
    [2016-09-15 06:04:58 +0000] [10105] [INFO] Using worker: sync
    [2016-09-15 06:04:58 +0000] [10110] [INFO] Booting worker with pid: 10110
    [2016-09-15 06:05:01 +0000] [10105] [INFO] Handling signal: int
</code></pre>

<p>Provided, I have 777 permissions on /opt/myapp/var/run/ directory. The only difference is the location of socket file.</p>

<p>Update : This app is running in a virtualbox VM started with vagrant and /opt/myapp is mapped using fileshare option. </p>

<p>I just found that socket files can not be created on a virtualbox shared directory.</p>

<p>This link helped me.
<a href="https://github.com/burke/zeus/issues/231" rel="nofollow">https://github.com/burke/zeus/issues/231</a></p>

python django gunicorn django-wsgi