# "Error: unexpected error - Can't create any SFTP connections!"

**URL:** <https://discuss.dvc.org/t/error-unexpected-error-cant-create-any-sftp-connections/1559>\
**Category:** Questions\
**Created:** [March 12, 2023, 8:45pm UTC](https://discuss.dvc.org/t/error-unexpected-error-cant-create-any-sftp-connections/1559 "2023-03-12T20:45:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnAtl](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/johnatl/32/365_2.png) [@JohnAtl](https://discuss.dvc.org/u/JohnAtl)\
**Post date:** [March 12, 2023, 8:45pm UTC](https://discuss.dvc.org/t/error-unexpected-error-cant-create-any-sftp-connections/1559/1 "2023-03-12T20:45:43Z")

</div>

Not sure where to go with this.  
DVC can’t create an sftp connection, but running the sftp command works.  
Thanks for any suggestions.

```plaintext
x dvc status
data.dvc:                                                                                                                                                                                                       
	changed outs:
		modified: data
logs.dvc:
	changed outs:
		modified: logs
(base) 
Epilepsy on git powertransformec-pca [$!>] took 6s 
> dvc add logs data
100% Adding...|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████|2/2 [00:22, 11.38s/file]
(base) 
Epilepsy on git powertransformec-pca [$!+>] took 26s 
> dvc push
ERROR: unexpected error - Can't create any SFTP connections!                                                                                                                                                   

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
(base) 
Epilepsy on git powertransformec-pca [$!+>] took 8s 
x git st
On branch powertransformec-pca
Your branch is ahead of 'origin/powertransformec-pca' by 3 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified: data.dvc
	modified: logs.dvc

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified: src/train.ipynb

(base) 
Epilepsy on git powertransformec-pca [$!+>] 
> git commit -a -m "dvc modified"
Data and pipelines are up to date.                                                                                                                                                                              
[powertransformec-pca 34a814f] dvc modified
 3 files changed, 15 insertions(+), 41 deletions(-)
(base) 
Epilepsy on git powertransformec-pca [$>] took 8s 
> git push
ERROR: unexpected error - Can't create any SFTP connections!                                                                                                                                                    

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
error: failed to push some refs to 'github.com:JohnAtl/epilepsy.git'
(base) 
Epilepsy on git powertransformec-pca [$>] took 6s 
x dvc status
Data and pipelines are up to date.                                                                                                                                                                              
(base) 
Epilepsy on git powertransformec-pca [$>] took 7s 
> dvc push
ERROR: unexpected error - Can't create any SFTP connections!                                                                                                                                                    

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
(base) 
Epilepsy on git powertransformec-pca [$>] took 5s 
x sftp johns-imac-pro.local
Connected to johns-imac-pro.local.
sftp> exit
(base) 
Epilepsy on git powertransformec-pca [$!>] took 3s
x dvc remote list  
imac	ssh://johns-imac-pro.local:/Volumes/Data/dvc/epilepsy
(base) 
Epilepsy on git powertransformec-pca [$!>] took 3s 
> 

```

---

<div class="post-metadata">

**Author:** ![JohnAtl](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/johnatl/32/365_2.png) [@JohnAtl](https://discuss.dvc.org/u/JohnAtl)\
**Post date:** [March 13, 2023, 1:29am UTC](https://discuss.dvc.org/t/error-unexpected-error-cant-create-any-sftp-connections/1559/2 "2023-03-13T01:29:10Z")

</div>

Seems to be a known issue.

> <https://github.com/iterative/dvc-ssh/issues/16>
>
> \# Bug Report
> 
> I open this issue as a follow up to https://github.com/iterative…/dvc/issues/6138
> 
> \## Description
> 
> \`dvc push\` raises an error when trying to push to an SFTP remote. It used to work with older versions. The SFTP remote I use is a personal Raspberry Pi server. I did not change anything on the server.
> 
> \### Reproduce
> 
> Unfortunately, since I use a private server, I don't know whether it would be easy to reproduce.
> 
> After updating dvc, I tried to run \` dvc push\` and I got these logs:
> 
> \`\`\`
> $ dvc push -v -a
> 2021-10-03 11:59:51,299 DEBUG: Preparing to transfer data from '.dvc/cache' to 'ssh://\<REMOTE URL\>/gcoter/music-generation-v2.dvc'
> 2021-10-03 11:59:51,300 DEBUG: Preparing to collect status from 'ssh://\<REMOTE URL\>/gcoter/music-generation-v2.dvc'
> 2021-10-03 11:59:51,318 DEBUG: Collecting status from 'ssh://\<REMOTE URL\>/gcoter/music-generation-v2.dvc'
> 2021-10-03 11:59:51,918 DEBUG: Querying 38 hashes via object\_exists
> 2021-10-03 12:00:30,881 ERROR: unexpected error - Can't create any SFTP connections!                                                                                         
> \------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/main.py", line 55, in main
> ret = cmd.do\_run()
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/command/base.py", line 45, in do\_run
> return self.run()
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/command/data\_sync.py", line 57, in run
> processed\_files\_count = self.repo.push(
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/repo/\_\_init\_\_.py", line 50, in wrapper
> return f(repo, \*args, \*\*kwargs)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/repo/push.py", line 48, in push
> pushed += self.cloud.push(obj\_ids, jobs, remote=remote, odb=odb)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/data\_cloud.py", line 85, in push
> return transfer(
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/transfer.py", line 221, in transfer
> status = compare\_status(src, dest, obj\_ids, check\_deleted=False, \*\*kwargs)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/status.py", line 160, in compare\_status
> dest\_exists, dest\_missing = status(
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/status.py", line 122, in status
> exists = hashes.intersection(
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/status.py", line 36, in \_indexed\_dir\_hashes
> indexed\_dir\_exists.update(odb.list\_hashes\_exists(indexed\_dirs))
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/db/base.py", line 420, in list\_hashes\_exists
> ret = list(itertools.compress(hashes, in\_remote))
> File "/usr/lib/python3.8/concurrent/futures/\_base.py", line 619, in result\_iterator
> yield fs.pop().result()
> File "/usr/lib/python3.8/concurrent/futures/\_base.py", line 437, in result
> return self.\_\_get\_result()
> File "/usr/lib/python3.8/concurrent/futures/\_base.py", line 389, in \_\_get\_result
> raise self.\_exception
> File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
> result = self.fn(\*self.args, \*\*self.kwargs)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/objects/db/base.py", line 411, in exists\_with\_progress
> ret = self.fs.exists(path\_info)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/dvc/fs/fsspec\_wrapper.py", line 96, in exists
> return self.fs.exists(self.\_with\_bucket(path\_info))
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/fsspec/asyn.py", line 91, in wrapper
> return sync(self.loop, func, \*args, \*\*kwargs)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/fsspec/asyn.py", line 71, in sync
> raise return\_result
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/fsspec/asyn.py", line 25, in \_runner
> result\[0\] = await coro
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/fsspec/asyn.py", line 480, in \_exists
> await self.\_info(path)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/sshfs/utils.py", line 27, in wrapper
> return await func(\*args, \*\*kwargs)
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/sshfs/spec.py", line 135, in \_info
> async with self.\_pool.get() as channel:
> File "/usr/lib/python3.8/contextlib.py", line 171, in \_\_aenter\_\_
> return await self.gen.\_\_anext\_\_()
> File "/home/gcoter/.cache/pypoetry/virtualenvs/music-generation-v2-7Nqe6-3y-py3.8/lib/python3.8/site-packages/sshfs/pools/soft.py", line 38, in get
> raise ValueError("Can't create any SFTP connections!")
> ValueError: Can't create any SFTP connections!
> \------------------------------------------------------------
> 2021-10-03 12:00:31,971 DEBUG: Version info for developers:
> DVC version: 2.7.2 (pip)
> \---------------------------------
> Platform: Python 3.8.10 on Linux-5.4.0-88-generic-x86\_64-with-glibc2.29
> Supports:
> http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
> https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
> ssh (sshfs = 2021.9.0)
> Cache types: hardlink, symlink
> Cache directory: ext4 on /dev/sda5
> Caches: local
> Remotes: ssh
> Workspace directory: ext4 on /dev/sda5
> Repo: dvc, git
> 
> Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
> 2021-10-03 12:00:31,973 DEBUG: Analytics is enabled.
> 2021-10-03 12:00:32,040 DEBUG: Trying to spawn '\['daemon', '-q', 'analytics', '/tmp/tmpkmytybwl'\]'
> 2021-10-03 12:00:32,043 DEBUG: Spawned '\['daemon', '-q', 'analytics', '/tmp/tmpkmytybwl'\]'
> \`\`\`
> 
> \### Expected
> 
> Since I did not change the configuration of my server and it used to work, I would expect \`dvc push\` to work.
> 
> \### Environment information
> 
> \`\`\`console
> $ dvc doctor
> DVC version: 2.7.2 (pip)
> \---------------------------------
> Platform: Python 3.8.10 on Linux-5.4.0-89-generic-x86\_64-with-glibc2.29
> Supports:
> http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
> https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
> ssh (sshfs = 2021.9.0)
> Cache types: hardlink, symlink
> Cache directory: ext4 on /dev/sda5
> Caches: local
> Remotes: ssh
> Workspace directory: ext4 on /dev/sda5
> Repo: dvc, git
> \`\`\`
