Closed stephaneerard closed 2 years ago
Hitting the same issue on Ubuntu/WSL when using docker context set to a ssh:// host which has the port rotated and set in .ssh/config.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
Description of the issue
Docker-compose does not read the Port information from the $HOME/.ssh/config.
Context information (for bug reports)
I have reported the issue in the forums here : https://forums.docker.com/t/docker-compose-ssh-configuration-and-port-information-retrieval-and-use/107077
Output of
docker-compose version
Output of
docker version
Output of
docker-compose config
(Make sure to add the relevant-f
and other flags)Steps to reproduce the issue
Vagrant ssh-config output : This output is put in $HOME/.ssh/config
docker context use c0
PS C:\tmp> docker-compose ps", line 3, in raise_from
File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "C:\Python39\lib\http\client.py", line 1347, in getresponse
self.close()
File "C:\Python39\lib\http\client.py", line 933, in close
sock.close() # close it manually... there may be other refs
File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\transport\sshconn.py", line 102, in close
self.proc.stdin.flush()
OSError: [Errno 22] Invalid argument
Traceback (most recent call last): File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request six.raise_from(e, None) File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python39\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen retries = retries.increment( File "C:\Python39\lib\site-packages\urllib3\util\retry.py", line 410, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Python39\lib\site-packages\urllib3\packages\six.py", line 734, in reraise raise value.with_traceback(tb) File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request six.raise_from(e, None) File "", line 3, in raise_from
File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "C:\Python39\lib\http\client.py", line 1347, in getresponse
self.close()
File "C:\Python39\lib\http\client.py", line 933, in close
sock.close() # close it manually... there may be other refs
File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\transport\sshconn.py", line 102, in close
self.proc.stdin.flush()
urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError(22, 'Invalid argument'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\api\client.py", line 215, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\api\daemon.py", line 183, in version return self._result(self._get(url), json=True) File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\utils\decorators.py", line 46, in inner return f(self, *args, kwargs) File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\api\client.py", line 238, in _get return self.get(url, self._set_request_timeout(kwargs)) File "C:\Python39\lib\site-packages\requests\sessions.py", line 543, in get return self.request('GET', url, kwargs) File "C:\Python39\lib\site-packages\requests\sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "C:\Python39\lib\site-packages\requests\sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "C:\Python39\lib\site-packages\requests\adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', OSError(22, 'Invalid argument'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python39\Scripts\docker-compose-script.py", line 33, in
sys.exit(load_entry_point('docker-compose', 'console_scripts', 'docker-compose')())
File "c:\code\docker_compose_i1\compose\cli\main.py", line 81, in main
command_func()
File "c:\code\docker_compose_i1\compose\cli\main.py", line 198, in perform_command
project = project_from_options('.', options)
File "c:\code\docker_compose_i1\compose\cli\command.py", line 60, in project_from_options
return get_project(
File "c:\code\docker_compose_i1\compose\cli\command.py", line 152, in get_project
client = get_client(
File "c:\code\docker_compose_i1\compose\cli\docker_client.py", line 41, in get_client
client = docker_client(
File "c:\code\docker_compose_i1\compose\cli\docker_client.py", line 170, in docker_client
client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\api\client.py", line 198, in init
self._version = self._retrieve_server_version()
File "C:\Python39\lib\site-packages\docker-4.4.4-py3.9.egg\docker\api\client.py", line 222, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', OSError(22, 'Invalid argument'))
docker context update --docker "host=ssh://vagrant@vdi-00-control-00:2222" --default-stack-orchestrator swarm c0
Name Command State Ports
Exception ignored in: <function Popen.del at 0x0000023EF2165DC0> Traceback (most recent call last): File "C:\Python39\lib\subprocess.py", line 1055, in del self._internal_poll(_deadstate=_maxsize) File "C:\Python39\lib\subprocess.py", line 1457, in _internal_poll if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0: OSError: [WinError 6] Descripteur non valide
dumped before