fabric/fabric — Issue #575: Low level socket error when trying to upload template
Author: azizmb
Created: 2012-03-07 06:24:17+00:00
State: open

Im trying to deploy a project to webfaction using the scripts [here](https://github.com/ashwoods/webfaction-django-fabfile), and face errors when running a task that installs the application. A previous task that installs supervisor runs fine.

Ive posted this on [stackoverflow](http://stackoverflow.com/questions/9436552/problems-with-fabric-deployment), and on [webfaction](http://community.webfaction.com/questions/7654/problems-deploying-with-fabric), with whom I also followed up on support tickets, but still couldnt resolve the issue.

The stack traces is below:

```python
(project_name)aziz@ynl:~/workspace/project_name$ fab -f webfaction-django-fabfile/fabfile.py deploy --show debug
Using fabfile '/home/aziz/workspace/project_name/webfaction-django-fabfile/fabfile.py'
Commands to run: deploy
Parallel tasks now using pool size of 1
[username.webfactional.com] Executing task 'deploy'
[username.webfactional.com] run: /bin/bash -l -c "test -e \"\$(echo /home/username/webapps/supervisor)\""
[username.webfactional.com] run: /bin/bash -l -c "test -d /home/username/webapps/supervisor/conf.d/project_name.conf"
Timed out trying to connect to username.webfactional.com (attempt 1 of 1), giving up)

Fatal error: Low level socket error connecting to host username.webfactional.com: Connection refused (tried 1 time)

Traceback (most recent call last):
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/tasks.py", line 292, in execute
multiprocessing
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/tasks.py", line 191, in _execute
return task.run(*args, **kwargs)
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/tasks.py", line 113, in run
return self.wrapped(*args, **kwargs)
File "/home/aziz/workspace/project_name/webfaction-django-fabfile/fabfile.py", line 38, in deploy
install_app()
File "/home/aziz/workspace/project_name/webfaction-django-fabfile/fabfile.py", line 63, in install_app
'user': env.user,
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/contrib/files.py", line 85, in upload_template
if func('test -d %s' % destination).succeeded:
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/network.py", line 457, in host_prompting_wrapper
return func(*args, **kwargs)
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/operations.py", line 904, in run
return _run_command(command, shell, pty, combine_stderr)
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/operations.py", line 814, in _run_command
stdout, stderr, status = _execute(default_channel(), wrapped_command, pty,
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/state.py", line 340, in default_channel
chan = connections[env.host_string].get_transport().open_session()
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/network.py", line 84, in __getitem__
self.connect(key)
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/network.py", line 76, in connect
self[key] = connect(user, host, port)
File "/home/aziz/.virtualenvs/project_name/local/lib/python2.7/site-packages/fabric/network.py", line 393, in connect
raise NetworkError(msg, e)
NetworkError: Low level socket error connecting to host username.webfactional.com: Connection refused (tried 1 time)

Aborting.
Disconnecting from username.webfactional.com... done.
```