Docker Agent can't use SSH for --base-url
See original GitHub issueDescription
Docker Agent can’t connect to remote Docker daemon with SSH. It results in
Traceback (most recent call last):
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\docker\api\client.py", line 165, in __init__
self._custom_adapter = SSHHTTPAdapter(
NameError: name 'SSHHTTPAdapter' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tfh\Miniconda3\envs\prefect\Scripts\prefect-script.py", line 9, in <module>
sys.exit(cli())
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\click\decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\prefect\cli\agent.py", line 260, in start
docker_interface=not no_docker_interface,
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\prefect\agent\docker\agent.py", line 117, in __init__
self.docker_client = self._get_docker_client()
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\prefect\agent\docker\agent.py", line 142, in _get_docker_client
return docker.APIClient(base_url=self.base_url, version="auto")
File "C:\Users\tfh\Miniconda3\envs\prefect\lib\site-packages\docker\api\client.py", line 170, in __init__
'Install paramiko package to enable ssh:// support'
docker.errors.DockerException: Install paramiko package to enable ssh:// support
Expected Behavior
That I could connect to docker host.
Reproduction
Simply run:
prefect agent start docker --base-url ssh://mydockerhost
Environment
(prefect) λ prefect diagnostics { "config_overrides": { "backend": true, "server": { "endpoint": true, "graphql": { "host": true }, "host": true, "host_port": true, "port": true, "ui": { "endpoint": true, "graphql_url": true, "host": true, "host_port": true, "port": true } } }, "env_vars": [], "system_information": { "platform": "Windows-10-10.0.18362-SP0", "prefect_version": "0.11.5", "python_version": "3.7.0" } }
Issue Analytics
- State:
- Created 3 years ago
- Comments:17
Top Results From Across the Web
git - ssh-add in docker - Could not open a connection to your ...
I believe the issue related to ssh configuration in your container, the default ssh strategy in Ubuntu is to refuse the root remote...
Read more >Installation with Docker - Docs
Mount /home/git/. ssh of the host into the container. This ensures that the authorized_keys file is shared between the host git user and...
Read more >How to Fix “Cannot find a valid baseurl for repo” in CentOS
In this short article, we will show how to fix “cannot find a valid baseurl for repo” error in CentOS Linux distribution.
Read more >How to Install Gitea on Ubuntu Using Docker - DigitalOcean
Because Gitea is running in a Docker container, it cannot accept SSH connections on the default port of 22 , as this will...
Read more >Use SSH keys to communicate with GitLab
Docker · Helm chart · GitLab agent ... Use SSH certificates · Enable encrypted configuration ... Default domains, URLs, and baseurls.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for opening @thomasfrederikhoeck! Will take a look at this. One thing, if you
pip install paramiko
then try running this again does it start working?Glad to see that you got it worked out 🎉 Closing this now that we got it figured out.
To follow up on your questions: on my windows machine, I have
prefect
installed viapip
from pypi, and then also from my local source usingpip
; out of curiosity I also installed it just now in another environment usingconda
instead (and followed the same package manager, respectively, for when I installedparamiko
). I didn’t experience thecryptography
problems from any of the 3 situations.All that being said, it is up to the user whether they install their dependencies using
pip
orconda
.cryptography
is a dependency ofparamiko
, notprefect
(sincedocker
chose not to makeparamiko
a hard dependency). If the speculation in that linked spacy google group is true andcryptography
has issues with the Anaconda distro of python andpip
, then it depends how the user installparamiko
in particular if they will experience this issue withcryptography
; and ultimately it is an upstream problem that is potentially best served by a ticket on thecryptography
repo.