I'm trying to connect a ksqlDB CLI (running on a container using image 0.20.0) but it says the [ksqlDB] Server Status is unknow...
CLI v0.20.0, Server v<unknown> located at http://127.0.0.1:8088
WARNING: Could not identify server version.
Non-matching CLI and server versions may lead to unexpected errors.
Server Status: <unknown>
... which is funny since I'm running the ksqlDB server (version 0.20.0 as well) based on these instructions and I see the startup log
[2021-08-23 12:28:10,795] INFO ksqlDB API server listening on http://0.0.0.0:8088 (io.confluent.ksql.rest.server.KsqlRestApplication:389)
[2021-08-23 12:28:10,796] INFO Server up and running (io.confluent.ksql.rest.server.KsqlServerMain:93)
[2021-08-23 12:28:11,923] INFO Successfully submitted metrics to Confluent via secure endpoint (io.confluent.support.metrics.submitters.ConfluentSubmitter:146)
Also, in Docker Desktop (I'm running this on a Windows) I see it under the Container/Apps tab as running on port 8088 and it allows me to "Open in browser" where I see the response
KsqlServerInfo
version "0.20.0"
kafkaClusterId "lkc-****"
ksqlServiceId "default_"
serverStatus "RUNNING"
Any idea of what's going on?
By default, the container doesn't know how to reach an external server; it will try to connect to itself on 127.0.0.1
You would need to follow some steps like the following
# create a network
docker network create ksql-network
# TODO start Zookeeper and Kafka
# start the server on that network
docker run -d --name=ksql-server --network=ksql-network ... confluentinc/ksql-server:<version>
# Start the CLI to point at the '--name' on the '--network'
docker run --network=ksql-network confluentinc/ksql-cli:<version> http://ksql-server:8088
Or, you should just use Compose
Related
I downloaded Docker using Docker Desktop for Apple M1 chips. I can run containers, the integration with VsCode works okay but I can't integrate it with Intellij IDEA Ultimate. It keeps giving this error.
But I can run my containers and create images from the terminal, I can also see the containers and images in Docker Desktop too. What could be the reason behind this? I also tried to check whether var/run/docker.sock is existing and it really isn't, there is no such file as that.
I also tried the same steps on my second computer and the exact same thing happened. Steps to reproduce: 1- Download Intellij IDEA Ultimate, open a repo that uses docker 2- Download Docker Desktop for Mac M1 3- Try to add Docker service to Intellij
I didn't do anything else because I think Docker Desktop is enough to configure everything on Mac. I am trying to run an FT on intellij and I get the error
[main] ERROR o.t.d.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
[main] ERROR o.t.d.DockerClientProviderStrategy - UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)
[main] ERROR o.t.d.DockerClientProviderStrategy - DockerMachineClientProviderStrategy: failed with exception ShellCommandException (Exception when executing docker-machine status ). Root cause InvalidExitValueException (Unexpected exit value: 1, allowed exit values: [0], executed command [docker-machine, status, ], output was 122 bytes:
Docker machine "" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.)
[main] ERROR o.t.d.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
I've been trying everything for the last 2 days but I can't seem to find a solution.
EDITED 2022-10-31
As per the latest release notes for Docker Desktop (4.13.1), there is no need to create the symlink anymore, citing notes:
Added back the /var/run/docker.sock symlink on Mac by default, to increase compatibility with tooling like tilt and docker-py. Fixes docker/for-mac#6529.
The official fix now is to UPGRADE your Docker Desktop installation.
For the Docker Desktop (4.13.0) version:
By default Docker will not create the /var/run/docker.sock symlink on the host and use the docker-desktop CLI context instead. (see: https://docs.docker.com/desktop/release-notes/)
That will prevent IntelliJ from finding Docker using the default context.
You can see the current contexts in your machine by running docker context ls, which should produce an output like:
NAME TYPE DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default moby Current DOCKER_HOST based configuration unix:///var/run/docker.sock https://kubernetes.docker.internal:6443 (default) swarm
desktop-linux * moby unix:///Users/<USER>/.docker/run/docker.sock
As a workaround that will allow IntelliJ to connect to Docker you can use the TCP Socket checkbox and put in the Engine API URL the value that appears under DOCKER ENDPOINT in the active context.
The case for this example will be: unix:///Users/<USER>/.docker/run/docker.sock
Then IntelliJ will be able to connect to Docker Desktop.
**Hacky option**
Another way to make IntelliJ (and other components that rely on the default config) to find Docker will be to manually create a symlink to the new DOCKER ENDPOINT by running:
sudo ln -svf /Users/<USER>/.docker/run/docker.sock /var/run/docker.sock
In that way all the components looking for Docker under /var/run/docker.sock will find it.
I have an ECS Fargate service running the jetbrains/teamcity-agent image. This is connected to my TeamCity Host which is running on an EC2 instance(windows).
When I check whether the agent is capable of running docker commands, it shows the following errors:
Unmet requirements:
docker.server.osType contains linux
docker.server.version exists
Under Agent Parameters -> Configuration Parameters, I can see the docker version and the dockerCompose.version properly. Is there a setting that I am missing?
If you are trying to access a docker socket in fargate, Fargate does not support running docker commands, there is a proposed ticket for this feature.
the issue with "docker.server.osType" not showing up usually means
that the docker command run from the agent cannot connect with the
docker daemon running. This is usually due to a lack of permissions,
as docker by default only allows connections from root and users of
the group docker
Teamcity-Unmet-requirements-docker-server-osType-contains-linux
I was facing similar issues got them fixed by adding "build agent" user in "docker" group and restarted/rebooted the server.
Where build agent user ==> Means the user with which your TeamCity services are running.
Command to add a user to group
#chmod -a -G docker <userasperyourrequirement>
Command to reboot the server:
#init 6
I have a .NET Core 2.1 API which, when run via Visual Studio in Windows, receives a HTTP GET from the browser and successfully returns data from a MySQL DB.
I've been trying to add the API to a Docker container (inside Ubuntu) - this builds, but I can't access the API from the browser:
What I've tried:
Checking available ports. Here's the relevant output:
Connecting using a different browser: In Chromium, it says 'This site can't be reached: localhost unexpectedly closed the connection.'
Testing unused ports in the browser to see if this returns a different message - for Firefox, unused ports return 'Unable to connect' instead of 'Secure connection Failed', and in Chromium they return 'localhost refused to connect.' instead of 'localhost unexpectedly closed the connection.'
In Firefox, configuring 'security.tls.insecure_fallback_hosts' to 'localhost'.
Double-checking that ports are mapped correctly in docker-compose.yml - under 'ports' for the relevant container, 44329 is mapped to 44329.
Running a DB query when the API starts and logging the result: this is successful. I run docker-compose up, the API starts, connects to the DB container, and it logs the result of an SQL query to a text file. So the problem is unlikely to be anything to do with the database.
Logging GET requests: Inside Windows, the GET requests are successfully logged, but in the Ubuntu Docker container, they're not.
This might be relevant: In Windows, the API only works properly if you start it from Visual Studio. If you execute dotnet webapi.dll, you get this output
...\netcoreapp2.1>dotnet webapi.dll
...
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
So here it's not running on 44329; instead it's accessible via 5001 in the browser, where you get this message which is not chill at all:
Clicking 'ADVANCED' allows you to continue to the API.
So I've also tried connecting via 5001 in Ubuntu without luck.
Here's the output from 'docker-compose up':
matt#Matt-Ubuntu:~/docker2$ docker-compose up
Starting docker2_mysql_1 ... done
Starting docker2_dbmodelmapper_1 ... done
Attaching to docker2_mysql_1, docker2_dbmodelmapper_1
... (mysql stuff) ...
dbmodelmapper_1 | Hosting environment: Production
dbmodelmapper_1 | Content root path: /app
dbmodelmapper_1 | Now listening on: http://[::]:80
dbmodelmapper_1 | Application started. Press Ctrl+C to shut down.
Seeing the port 80, I've tried connecting to that, without success.
The relevant container as shown by docker ps is:
What kind of issue am I looking at here?
As pointed out by multiple people in the comments (thanks sp0gg, Martin Ullrich and Daniel Lerps), the API was incorrectly listening on port 80.
The solution was to map port 5000 to 44329 in docker-compose.yml for the API container, and also modify the Dockerfile to pass ports in as arguments to dotnet when starting the ASP.NET API:
ENTRYPOINT ["dotnet", "webapi.dll", "--urls", "http://*:5000;http://*:5001"]
I am using Toolchain in IBM Bluemix for deploying an Simple Spring boot application.
In Delivery pipeline I have added 3 stages:
Stage-1(Maven Build)
Fetching source code from git repo and building with Maven to build jar file
Stage-2(Building Docker Image)
In this stage it is reading from a Dockerfile in source code and building a Docker image. In this stage Builder Type is "IBM Container Service".
Stage-3(Container Deploy)
In this stage I am deploying the image in Container in Bluemix. Here Deployer Type is "IBM Container Service".
After all stages are completed successfully I hit the container ip provided in deploy stage but it gives an error
A communication error occurred: "Connection refused"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
I have checked the container status with bx ic inspect some-container-name
it shows container status running.
Any help will be appreciated.
This sounds like a problem with the application. You can investigate by either doing bx ic logs some-container-name or by connecting to the running container by doing bx ic exec -it some-container-name /bin/bash
Edit: You should also make sure you are specifying the correct port in the Container Deploy stage and when trying to connect to the IP address.
So we followed the Docker get started tutorial
(https://docs.docker.com/get-started/part2/). The build works, the command
docker run -p 4000:80 friendlyhello
works but when we go to http://localhost:4000, nothing is reached. We just followed the tutorial step by step but don't see anything.
Yes we also went to localhost:4001.
Is this perhaps something that has to do witht the message "system pool is not available on windows"?
Here's a screenshot of our docker output
Firstly talking about the issue that you've pointed out yourself, this is identified as an issue that can't be fixed for Windows.
Please try downgrading to version 1.12.x so that these warnings do not pop-up anymore. This solution is found working for most of us.
level-info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
Coming to the main issue that you're facing, which is as follows:
Error response from daemon: driver failed programming external connectivity on endpoint objective_joliot
This says that the port 4000 is already in use on Docker VM or possibly on your system. You can either stop whatever is running on that port or change the port used in your Docker command.
To change to the external port 8080, use:
docker run -d -p 8080:80 --name objective_joliot nginx
Hope this helps!!!