Why does Docker fail with VSCode running - docker

My docker service (epst) fails to start if I'm also running VSCode. The error is:
ERROR: for epst Cannot start service epst: driver failed programming external connectivity on endpoint epst (long-hash): Error starting userland proxy: Bind for 0.0.0.0:5123 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.
If I shut down VSCode and re-launch docker-compose, then everything comes up fine.
So my question is how do I identify what is binding to port 5123 in VSCode?

I believe you might be looking for lsof -i :5123?
See man page for lsof.
This would the return a list of processes running on the port you entered (5123).
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
appName 5123 yourUser -- ---- -------------------------
You could then kill 5123 to free up the desired port.

Related

Flink 1.14.3 - [issue] failed to bind to /0.0.0.0:6123

We are using 1.14.3 version of flink and when we try to run Job manager, we are getting below exception.
I tried entering
akka.remote.netty.tcp.hostname = "127.0.0.1" in flink-conf.yml file and even updated IP with hostname. But didnt help.
[flink-akka.actor.default-dispatcher-5]
ERROR akka.remote.transport.netty.NettyTransport - failed to bind to /0.0.0.0:6123, shutting down Netty transport
ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint - Could not start cluster entrypoint StandaloneSessionClusterEntrypoint.
org.apache.flink.runtime.entrypoint.ClusterEntrypointException: Failed to initialize the cluster entrypoint StandaloneSessionClusterEntrypoint
Caused by: java.net.BindException: Could not start actor system on any port in port range 6123```
Can you check if you have an application already running on port 6123?

The Proxy server error occures when starting dotdocker

The following error occurs when I start the dotdocker sudo dotdocker start for my project. There was no error before and it was working successfully. However, this error appeared without any changing on the project code. The version of docker-compose and dotdocker are 1.21.2 and 1.4.2 respectively. I tried several things to solve the problem but nothing is working such as::
1 - sudo dotstart stop
2 - sudo systemctl restart NetworkManager
3 - sudo service docker restart
❯ Start dotdocker containers
❯ Start proxy
↓ Pulling codekitchen/dinghy-http-proxy:latest [skipped]
→ Image already exists
↓ Creating dotdocker-proxy [skipped]
→ Container already created
✖ Starting dotdocker-proxy
→ (HTTP code 500) server error - driver failed programming external conn
…
✔ Start dnsmasq
Setting up DNS
(node:4314) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error - driver failed programming external connectivity on endpoint dotdocker-proxy (4e8078f31f05224f8041e65026e179114701636bbd13eb71a67382ccae860db9): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
at /usr/local/lib/node_modules/dotdocker/node_modules/docker-modem/lib/modem.js:257:17
at getCause (/usr/local/lib/node_modules/dotdocker/node_modules/docker-modem/lib/modem.js:287:7)
at Modem.buildPayload (/usr/local/lib/node_modules/dotdocker/node_modules/docker-modem/lib/modem.js:256:5)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/dotdocker/node_modules/docker-modem/lib/modem.js:232:14)
at IncomingMessage.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1244:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4314) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4314) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I haven't used the dotdocker but from what I see from the error and specifically this part:
tcp 0.0.0.0:80: bind: address already in use
Something in your system is already using port 80 that your program wants to use.
In order to see what is using port 80 you can try:
lsof -P -S 2 -i "tcp:80" | grep "\(:80->.*:\|:80 (LISTEN)$\)"
This will give you the info and the process id in the second column.
For example:
apache2 1914 root 4u IPv6 11920 0t0 TCP *:80 (LISTEN)
You can then kill this process that occupying the port you want to use by:
kill -KILL 1914

Permission error when starting workspace on Laradock Docker on Windows 10

Each time when starting docker-compose up on Laradock, receives Permission error for workspace laradock on Windows 10. I have tried restarting but not working.
PS D:\projects\sites\laradock> docker-compose up -d nginx mysql phpmyadmin redis workspace
laradock_redis_1 is up-to-date
laradock_mysql_1 is up-to-date
laradock_docker-in-docker_1 is up-to-date
laradock_phpmyadmin_1 is up-to-date
Starting laradock_workspace_1 ... error
ERROR: for laradock_workspace_1 Cannot start service workspace: driver failed programming external connectivity on endpoint laradock_workspace_1 (cc289cd2758bb1c99d3f8aab7243220a94078e19b2a1f4a08e4b0b01fbba64a3): Error starting userland proxy: Bind for 0.0.0.0:2222: unexpected error Permission denied
ERROR: for workspace Cannot start service workspace: driver failed programming external connectivity on endpoint laradock_workspace_1 (cc289cd2758bb1c99d3f8aab7243220a94078e19b2a1f4a08e4b0b01fbba64a3): Error starting userland proxy: Bind for 0.0.0.0:2222: unexpected error Permission denied
ERROR: Encountered errors while bringing up the project.
I think you can find your answer here .In short you should execute this command netcfg -d this will clean up all networking devices, and requires a reboot

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

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.

composer-rest-server Unhandled 'error' event

When I try composer-rest-server -c acme-admin#test-bna I get this output:
Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at module.exports.promise.then.then (/usr/local/lib/node_modules/composer-rest-server/cli.js:143:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
I am actually doing a udemy course about how to setup a hyperledger multi org network.
The error is showing that the port 3000 is busy.
EADDRINUSE means some process is already running on that port.
You can find the process by using the following command:
sudo ss -lptn 'sport = :3000'
It will return you process id, then you can kill it by:
sudo kill -9 process_id
The problem was that some process was running on the port 3000. This command fixed it.
fuser -n tcp -k 3000

Resources