Docker login from cmd line yields i/o timeouts - macos

I'm trying to login to docker from the Docker Quickstart Terminal but it doesn't work.
I always get an error saying: "Error response from daemon: Server Error: Post https://index.docker.io/v1/users/: dial tcp: i/o timeout"
I have been working with docker the last few days and was always able to login and push/pull stuff. The only thing different I can think of is that I'm currently on a different Wifi.
Any help is greatly appreciated, thanks.
Karsten

This is a known issue, and is probably related to VirtualBox; after switching networks, boot2docker/VirtualBox sometimes looses connectivity or uses incorrect DNS settings.
DNS confused when switching WiFi networks
Container connectivity lost after switching wireless networks
Manual restart required everytime network connectivity changes (contains some workarounds)
Docker Machine 0.5.3 adds two new options that may circumvent this;
--virtualbox-dns-proxy
--virtualbox-host-dns-resolver

After restarting the machine it worked again, don't know what caused the problem though...

Related

`ddev get --list` doesn't work (lookup api.github.com: i/o timeout)

I need to add Solr to a DDEV project but am encountering errors when attempting to gather information about available services.
I'm following guidance here:
https://ddev.readthedocs.io/en/stable/users/extend/additional-services/
When I attempt to list all available services: ddev get --list, I receive this response after approx 30 seconds:
Failed to list available add-ons: Unable to get list of available services: Get "https://api.github.com/search/repositories?q=topic:ddev-get+fork:true+org:drud": dial tcp: lookup api.github.com: i/o timeout
I'm not sure what the problem is. If I curl the URL from the error message, ie curl https://api.github.com/search/repositories?q=topic:ddev-get+fork:true+org:drud, I receive a JSON response from Github with information about the repository.
This has happened for over two days now. I may be overlooking something but am not sure what, exactly. I'm able to run DDEV projects using the standard installation (mariadb, nginx, nodejs, mailhog) but continue to run into errors re listing add-ons.
I have ddev v.1.21.4 installed.
I'm using an M1 Mac on macOS 13.1.
Thank you.
Your system is unable to do a DNS lookup of the hostname api.github.com, and this is happening on your macOS host. Are you able to ping api.github.com? Have you tried rebooting?
You may want to temporarily disable firewall, VPN, virus checker to see if that changes things. But you'll want to be able to get to where you can ping api.github.com.
There is an obscure golang problem on macOS affecting situations where people have more than one DNS server, so that could be it if you're in that category. You also might want to consider changing the DNS server for your system to 1.1.1.1, as this can sometimes be a problem with your local DNS server (but of course the fact that you can curl the URL argues against that).

Unable to connect to GitHub for 2 years, irregardless of network - any ideas?

Toku here.
I've been without GitHub for 2 years now, and I'm getting sick of it.
In terms of web connection, I get a basic "This site can't be reached" - ERR_CONNECTION_REFUSED.
Attempting to use the desktop app results in more information
Image of 443 port error - more connection refusals.
Image of curl command result
I'm running Win10 Home build 19044, connected to a private home network with no restrictions. What would be causing this?
Tried reconfiguring DNS, and it simply didn't change anything.
At the suggestion of FiddlingAway, I resynced my system time, to no effect.
For reference, I am living in the US, so there should be no issues connecting due to a countrywide ban. The web interface does not load, even on a VPN.

Unable to connect a server through ssh

I am trying to ssh into a ubuntu machine from my mac
but I am getting
setsockopt SO_KEEPALIVE: Invalid argument
write: Broken pipe
as soon as I type in ssh address
and changing ssh_config including TCPKeepAlive, ServerAliveInterval do not fix my issue.
Does anyone know what might be happening?
Server is running on ubuntu
I found that server and client are on different network
Therefore my machine was unable to find the target server machine of the given ip address.
(ya I know.. such failure should be more descriptive)
I hope this answer helps the other people experiencing similar issue
I saw this when the connection was dropped straight away (a firewall it seems).
Presumably it ends up calling setsockopt() on a socket that just closed.

Can't SSH into EC2 from my mac but can from other devices

I am trying to connect into an EC2 instance (i am using a mac) which has a Security Group allowing all inbound traffic over ssh (port 22) but i'm unable to access. I'm having a little delay before getting an Operation timed out.
I already tried it over other devices such a raspberry pi and another macbook and the connection was successful.
I got access to the raspberry pi over ssh and tried the connection to my EC2 from the terminal; thought my ssh client or the port status could be the issue but after doing this i'm not really sure if this is the case.
This is the message i get when trying to connect:
ssh: connect to host x.x.x.x port 22: Operation timed out
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
Things already verified:
Security Group allowing traffic over port 22.
Instance rebooted/recreated.
DNS and Public IP address changed after instance reboot.
SSH connection successful over other devices.
SSH connection to other devices from this mac successful.
Firewall turned off.
DNS flushed.
Ping performed with success.
Any help is really appreciated it.
-- UPDATE --
This issue rose in my work machine. Got a different laptop due to other issues and problem fixed, looks like it might have been something related to ports or some sort of configuration. Thought it was a problem with AWS but now it's working fine. Sadly I couldn't debug enough to know what the exact issue was. Thanks to everyone who helped out!
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.

Docker Toolbox Tutorial Client.Timeout exceeded while awaiting headers

I'm following the guide at https://docs.docker.com/get-started/part2/#publish-the-image
Throughout the guide I've had trouble with this error sometimes coming up and sometimes when I rerun the commands they will work.
docker push %username%/%repository%:%tag%
I will get a response of Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I'm using Windows Home with Docker Toolbox.
Please let me know if any additional information is needed.
Simply go to the Docker's Settings > Network and change DNS Server radio button to Fixed
Unfortunately answers above didn't help in my case, but restarting Docker did.
For anyone else who's looking I found the answer here which led me to here
Specifically for me these steps were helpful. In case the links break in the future.
This worked for Windows 10 Home/Docker Toolbox
Right click on wifi icon on bottom right of the screen and open network and sharing center.
Right click on the connection at "connections:"
Click on Properties
Uncheck IPv6
Check IPv4
Click properties
Select radio button Use the following DNS addresses
For preferred use 8.8.8.8
Restart the computer and try again.
In case someone runs his own docker repo.
I had a similar "Client.Timeout exceeded while awaiting headers" when running
docker login myownrepo.com:5000
It happened to be that i had port forwarding only for port 5000, and forgotten to add for port 5001.
The issue was resolved by adding port 5001 (on my router) pointing to the same docker-repo-host.
Do not add proxy unless it is required to access registry. In my case behind corporate network, I had added proxy which resulted in timeout error, after removing the proxy configuration in Docker Desktop, it got resolved. Hope it helps somebody.
"Client.Timeout exceeded while awaiting headers" is a symptom of several possible causes. In my case it was simply a case of the private network firewall blocking the docker client machine from accessing the registry host machine.
To test if that's the case (for whoever may be reading this), first try temporarily disabling the private network firewall.
For instance, if the private docker registry is hosted on Windows 10:
1) open Windows Security
2) click on Firewall & network protection
3) ensure Private Network is "active" and click on it
4) under "Microsoft Defender Wall" switch OFF private firewall
If the IP is suddenly accessible then you need to re-enable the firewall on the host and configure it to allow access to the docker registry.
I had this problem as I was using docker-reg:5000 under WSL2.
Adding it to /etc/hosts did not work.
As docker really works under windows, you need to add it to the WINDOWS hosts file.
C:\Windows\System32\drivers\etc\hosts
In my case having a slow and not stable internet connection was causing the issue. So if it is possible to increase performance of your connection do that, but in my case i retried it multiple times and it worked after a while.

Resources