ERRO[0044] failed to dial gRPC: cannot connect to the Docker daemon - docker

I'm using Windows 10 Home and I got this error when connecting to docker:
ERRO[0044] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial tcp 192.168.99.101:2376: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
context canceled
Can anybody help? I have seen solutions for Linux and OS, but not for windows

I also use Window 10 Home edition,
On windows, run cmd in adminstrator mode
and run the folowing lines of code
docker-machine start
docker-machine.exe env --shell cmd > e:\servers\docker\setenv.bat
call e:\servers\docker\setenv.bat
del e:\servers\docker\setenv.bat
Continue in the same CMD instance to run your docker client commands
Dont forget to change docker folder path based on your environments.

Adding my answer from ERRO[0043] failed to dial gRPC: unable to upgrade to h2c, received 501:
Following one of the comments in https://github.com/docker-library/docker/issues/71, I enabled Experimental features in Settings->Daemon and the problem went away. I have no idea how or why it fixed it and another commenter there says they fixed it by disabling Experimental features.

Related

Docker Desktop(for Apple chip) not working on Apple M1 Max chip

As I try to launch it, it stacks at starting state, and nothing happens. Reinstalling and installing prev. versions(4.4, 4.5) don't do the trick it is still stacking on starting...
After diagnose check:
/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
and here are fails
[FAIL] DD0031: does the Docker API work? Cannot connect to the Docker daemon at unix://docker.raw.sock. Is the docker daemon running?
[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": dial unix lifecycle-server.sock: connect: no such file or directory
[FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": dial unix diagnosticd.sock: connect: no such file or directory
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: failed to open kmsg.log: open log/vm/kmsg.log: no such file or directory
[FAIL] DD0017: can a VM be started? vm has not started: failed to open kmsg.log: open log/vm/kmsg.log: no such file or directory
[FAIL] DD0003: is the Docker CLI working? exit status 1
[FAIL] DD0012: is the VM networking working? network checks failed: Post "http://ipc/check-network-connectivity": dial unix diagnosticd.sock: connect: no such file or directory
[FAIL] DD0032: do Docker networks overlap with host IPs? Cannot connect to the Docker daemon at unix://docker.raw.sock. Is the docker daemon running?
as a conclusion:
Please investigate the following 1 issue:
1 : The test: can a VM be started?
Failed with: vm has not started: failed to open kmsg.log: open log/vm/kmsg.log: no such file or directory
Reset to a factory defaults seems not taking effect.
Rebooting also useless.
Turns out it was because of turned on VPN on network settings. Answer found here

Running a Chainlink Node - Connecting local Docker/DB to Docker/Node issue in MacOS/OSX

Running the Chainlink Node with local docker/postgres in OSX Catalina is quite cumbersome due to failed ORM connection or any others.
Doc used: https://docs.chain.link/docs/running-a-chainlink-node
To check if my local db is indeed working ok. I've ran these commands with successful results:
psql postgresql://suchain:docker#127.0.0.1:5432/chainlink
psql -h localhost -U suchain -d chainlink
What have been tried so far
Adding --network host haven't resolve the connection issue
Error Message: Incorrect Usage. flag provided but not defined: -network
Note: Tried with --network=host - same result
Changing the db_url from 127.0.0.1 to localhost
Error Message: dial error (dial tcp 127.0.0.1:5432: connect: connection refused)
Changing the localhost/127.0.0.1 to docker instance name (like pg-docker)
Error Message: hostname resolving error (lookup pg-docker on 192.168.65.1:53: no such host)
Which other options can be used?
Much thanks in advance
What pages have been checked before filing this one:
Running a Chainlink Node - Can't connect to database
CHAINLINK NODE: How might I approach fixing "unable to lock ORM" errors?
https://youtu.be/jJOjyDpg1aA?t=521
Thanks to Patrick. The root cause is the same as in this link
Replacing the db link from localhost/127.0.0.1 to the private/local IP(192.168.0.x) fixed the issue.
FYI: in mac os to find your IP is ifconfig. You'll need to find the en0

Docker Container Connect to MSSQL: Worked Yesterday

I am new to docker and getting very confused. Yesterday, I set up a MSSQL docker image and it is running. Some output of docker ps -a:
IMAGE: mcr.microsoft.com/mssql/server CREATED: 25 hours ago
STATUS: Up 25 hours PORTS: 0.0.0.0:1433->1433/tcp
I am trying to connect remotely to run a script. Yesterday I was able to
sqlcmd -S <myIP>,1433 -U SA -P "<myPassword>" -i ./sql-scripts/all.sql -o "out.txt"
but today when I run the same exact command I get
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: No connection could be made because the target machine actively refused it.
.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Does anyone know what could change between today and yesterday to make this happen? Using windows 10 enterprise, docker for windows, TSQL. I also tried https://canyouseeme.org/ and confirmed that port 1433 is not open on my IP.
EDIT: I should probably note I'm still able to access sqlcmd repl inside the container with docker exec -it mySecondServer "bash" and then /opt/mssql-tools/bin/sqlcmd -S localhost -U SA inside.
EDIT 2: Today the same error happened and when I tried to restart my docker container (still not the solution I want) I got
Error response from daemon: driver failed programming external connectivity on endpoint mySecondServer (9d...): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:1433:tcp:172.17.0.2:1433: input/output error
Error: failed to start containers: 85...

Docker pull failed with request canceled while waiting for connection

I am trying to pull images to default docker machine. But I always get
docker#default:/etc$ docker run hellow-world
Unable to find image 'hellow-world:latest' locally
docker: 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).
See 'docker run --help'.
docker#default:/etc$
Even if i give --dns option same error
docker#default:/etc$ docker run hellow-world --dns=8.8.8.8
Unable to find image 'hellow-world:latest' locally
docker: 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).
See 'docker run --help'.
docker#default:/etc$
Tried adding DNS to config.json of the default machine
"EngineOptions": {
"Dns": [
"8.8.8.8",
"8.8.4.4"
]
}
resolv.conf has following entry in default machine
docker#default:/etc$
docker#default:/etc$ cat /etc/resolv.conf
search <company name>
nameserver 10.0.2.3
docker#default:/etc$
This machine sits behind the proxy and I am using kitematic for creating default machine
Kitematic is started by a custom script which will set proxies and start kitematic
Recommended and All images are displayed at the start of kitematic. But can not pull any images
Creating new machine also gives warning
PS C:\Program Files\Docker Toolbox\kitematic> docker-machine create -d virtualbox --engine-opt dns=8.8.8.8 test
Running pre-create checks...
(test) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.253.116:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Creating machine...
(test) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.253.116:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Machine created with --dns option also has /etc/resolv.conf not as 8.8.8.8
docker#test:~$
docker#test:~$ cat /etc/resolv.conf
search <company name>
nameserver 10.0.2.3
docker#test:~$
PS:Issue solved after adding HTTP_PROXY to /var/lib/boot2docker/profile
Found solution
Either
add HTTP_PROXY to /var/lib/boot2docker/profile
or
create docker machine with --engine-env HTTP_PROXY=IP:PORT

Push docker image to Google Container Registry failure on Mac

I was trying to upload my image to Google Container Registry, but it return some error and I don't know how to troubleshooting.
$> gcloud docker -- push asia.gcr.io/dtapi-1314/web
The push refers to a repository [asia.gcr.io/dtapi-1314/web]
53ccd4e59f47: Retrying in 1 second
32ca8635750d: Retrying in 1 second
e5363ba7dd4d: Retrying in 1 second
d575d439624a: Retrying in 1 second
5c1cba20b78d: Retrying in 1 second
7198e99c156d: Waiting
6ca37046de16: Waiting
b8f2f07b3eab: Waiting
16681562a534: Waiting
92ea1d98cb79: Waiting
97ca462ad9ee: Waiting
unable to decode token response: read tcp 10.0.2.10:54718->74.125.23.82:443: read: connection reset by peer
I checked permission on my Mac.
$> gsutil acl get gs://asia.artifacts.dtapi-1314.appspot.com
It returned a list of correct permission.
I'd tested push on the cloud console, it works.
Does anyone have clue?
Thanks a lot if anyone could help. :)
Other troubleshooting
gcloud auth login
gcloud docker -- login -p $(gcloud auth print-access-token) -u _token https://asia.gcr.io
gsutil acl get gs://asia.artifacts.{%PROJECT_ID}.appspot.com
Add insecure-registry to dockerd startup command.
--insecure-registry asia.gcr.io
Might be the same cause
gcloud docker -- pull google/python
The error was
Error response from daemon: Get https://registry-1.docker.io/v2/google/python/manifests/latest: read tcp 10.0.2.15:37762->52.45.33.149:443: read: connection reset by peer
docker server log
DEBU[0499] Increasing token expiration to: 60 seconds
ERRO[0500] Error trying v2 registry: Get https://registry-1.docker.io/....../python/manifests/latest: read tcp 10.0.2.15:37762->52.45.33.149:443: read: connection reset by peer
ERRO[0500] Attempting next endpoint for pull after error: Get https://registry-1.docker.io/....../python/manifests/latest: read tcp 10.0.2.15:37762->52.45.33.149:443: read: connection reset by peer
DEBU[0500] Skipping v1 endpoint https://index.docker.io because v2 registry was detected
ERRO[0500] Handler for POST /v1.24/images/create returned error: Get https://registry-1.docker.io/....../python/manifests/latest: read tcp 10.0.2.15:37762->52.45.33.149:443: read: connection reset by peer
Environment
MacOS: 10.11.6
Docker Toolbox (on MAC)
Docker 1.12.3 (Git commit: 6b644ec, Built: Wed Oct 26 23:26:11 2016)
The root cause was stupid, but I'd like to update this for anyone who see this question. I found when I attached my computer to company's WIFI. Then It would work (Still some reset). The cable network of my company is mysterious broken to Google Container Registry. The cable network works for all other services (google/youtube/mobile services) we used but broken to Google Container Registry.
Seems like a permission issue. Try running
gcloud auth login
I remember running into a similar issue and this helped.

Resources