Cannot connect to Kafka running on a virtual machine - c#

I installed kafka_2.10-0.8.1.1 on a Ubuntu 12.04 (Linux ubuntu 3.8.0-44-generic) hosted by vmware player 6.0.3 build-1895310. On the host machine (Windows 8) I am using the C# client from https://github.com/Jroland/kafka-net. The ip of the kafka machine is correctly configured in C# code, the topic "test" is accordingly created in kafka etc. I get the following messages:
No connection to:http://:9092/. Attempting to re-connect...
Type a message and press enter...
Awaiting message from: http://:9092/
BrokerRouter: Refreshing metadata for topics: test
Failed re-connection to:http://:9092/. Will retry in:1000
Failed re-connection to:http://:9092/. Will retry in:2000
Failed re-connection to:http://:9092/. Will retry in:4000
The same client connects to a physical linux machine with kafka.
I would like to be able to develop with kafka running as a virtual machine. How could I solve the communication issue?
Thanks

I never used the c# version, but is your producer configure correctly?
From the error message, it seems that it doesn't have the IP/DNS configured...
No connection to:http://:9092/

Related

Renci SshNet "server response does not contain ssh protocol identification"

I am trying to connect to a remote ssh server using the SshNet package.
My code looks like this:
List<AuthenticationMethod> authenticationMethods = new List<AuthenticationMethod>();
authenticationMethods.Add(new PasswordAuthenticationMethod(SSHusername, SSHpassword));
SSHConnection = new SshClient(new ConnectionInfo(ip, Int32.Parse(SSHport), SSHusername, authenticationMethods.ToArray()));
SSHConnection.Connect();
When the program tries to make the connection, I get the following exception:
Exception thrown: 'Renci.SshNet.Common.SshConnectionException' in Renci.SshNet.dll
An exception of type 'Renci.SshNet.Common.SshConnectionException' occurred in Renci.SshNet.dll but
was not handled in user code
Server response does not contain SSH protocol identification.
I have been searching for a solution for 2 hours now, but haven't been able to fix it.
Looking through the source code of SshNet if found this error is thrown when the client doesn't get an ssh version from the server. I'm not an expert in this field, but looking at wireshark the server sends a packet with this info:
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
I'm pretty sure this is the ssh version it's looking for. So I hope one of you guys can tell me what else I can try to fix this.
My Core project has target framework .NET standard 2.0, the UWP project's min version is Windows 10 1903. The SshNet package is on version 2016.1.0

Azure function gets 'Listener unable to start' error on linux

I am using Ubuntu Linux and I have been having issue when I try to run .Net core 2.2 Azure function app.
A quick googling showed that it could be related to storage somehow but none of them were clear.
Although the runtime seems to start running normally, I get this error after a while:
[6/4/2020 8:35:09 am] The listener for function 'FunctionName' was unable to start.
[6/4/2020 8:35:09 am] The listener for function 'FunctionName' was unable to start. Microsoft.Azure.Storage.Common: Connection refused. System.Net.Http: Connection refused. System.Private.CoreLib: Connection refused.
So I found the problem.
I attempted to run my azure function on my windows partition and I was getting a similar error. It turned out the problem was the Azure Storage Emulator in both cases.
To fix it in windows I had to:
Delete all "AzureEmulatorDb" instances in /%USERPROFILE%
Then I had to run "SqlLocalDb i" to find all currently running local Dbs and delete them with "SqlLocalDb delete"
Lastly, I had to go into the SDK folder and run "./AzureStorageEmulator.exe init -forcecreate" to re-create the azureEmulatorDb and initialise a new configuration for the emulator
The fix in Linux was actually easier:
I downloaded Azurite, which is an open source Azure Storage emulator (https://github.com/azure/azurite)
Then I just run it with the "azurite" command before I started my azure function

Outgoing HTTP requests time out when running ASP.NET in Docker Desktop using Windows Container

I am running an ASP.NET web application in Docker Desktop for the first time. I have created an ASP.NET application (targeting .NET Framework) using the standard template in Visual Studio 2019 with Docker Support.
Dockerfile:
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-1803
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
Docker-compose.yml:
version: '3.4'
services:
mydockerizedwebapp:
image: ${DOCKER_REGISTRY-}mydockerizedwebapp
container_name: mydockerizedwebapp
build:
context: .\MyDockerizedWebApp
dockerfile: Dockerfile
Docker-compose.override.yml:
version: '3.4'
services:
mydockerizedwebapp:
ports:
- "80"
networks:
default:
external:
name: nat
I have installed Docker Desktop on my Win 10 computer (running Windows Containers).
The problem is that I am not able to make outgoing http requests from the web server inside Docker.
I get the following error message:
'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'
Running the webserver in IIS Express works fine.
I have used Powershell to connect to the container hosting the image. Running "Test-NetConnection" returns the following output:
PS C:\inetpub\wwwroot> Test-NetConnection
ComputerName : internetbeacon.msedge.net
RemoteAddress : 13.107.4.52
InterfaceAlias : Ethernet
SourceAddress : 172.24.21.136
PingSucceeded : True
PingReplyDetails (RTT) : 14 ms
Test-NetConnection -port 80 fails after some time with this output:
PS C:\inetpub\wwwroot> Test-NetConnection -port 80
WARNING: TCP connect to (13.107.4.52 : 80) failed
ComputerName : internetbeacon.msedge.net
RemoteAddress : 13.107.4.52
RemotePort : 80
InterfaceAlias : Ethernet
SourceAddress : 172.24.21.136
PingSucceeded : True
PingReplyDetails (RTT) : 15 ms
TcpTestSucceeded : False
If I open a different powershell window into the same container and run "netstat -an" to see active connections, the TCP request is visible:
Active Connections
Proto Local Address Foreign Address State
[...]
TCP 172.24.21.136:49169 13.107.4.52:80 SYN_SENT
The State is "SYN_SENT" for the entire duration of the connection test.
I have tried setting the MTU as suggested in Docker - Outgoing HTTPS requests timing out but it did not work for me.
It is worth mentioning that I am working remotely, so I have an VPN connection (software), but it does not work even if I disconnect the VPN.
Am I missing something?
I have tried creating an ASP.NET Core web app using the nanoserver image, but I the problem still exists. So I think the problem must be in my Docker/network configuration?
Update:
I tested running the same image on another computer which has neither VPN connection nor the same AV installed. "Test-NetConnection -port 80" worked instantly.
Here is Wireshark capture of successful test on different computer:
Here is Wireshark capture of failing test on my computer:
I see that the failing computer is using the same DNS server to find the ip for "internetbeacon.msedge.net" but after the response with IP 13.107.4.52, no TCP request is recorded from the container. On the working machine, this request is captured immediately after the DNS response.
Check host firewall/AV as it's most likely the curlpit here

Problems to connect to a SignalR Self-Hosted in a Windows Service

I have been trying to connect to the Windows Service created in this tutorial:
http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host
The thing is that I do can connect to it using its own client. However, I've tried to connect to it from a console application and haven't had success. Moreover, if I host the SignalR Hub in a console application I can connect to it successfully.
The errors that I got say that my client version isn't compatible with the server and that the connection was refused.
This is how my attempt to connect looks like:
IHubProxy _hub;
string url = #"http://localhost:8080/";
var connection = new HubConnection(url);
_hub = connection.CreateHubProxy("MyHub");
_hub.On("addMessage", x => ShowMessage(x));
connection.Start().Wait();
UPDATE:
-Errors Messages:
1.
Exception:Caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3." (System.InvalidOperationException)
A System.InvalidOperationException was caught: "You are using a version of the client that isn't compatible with the server. Client version 1.4, server version 1.3."
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[5924]
2.
Exception:Thrown: "No connection could be made because the target machine actively refused it" (System.Net.Sockets.SocketException)
A System.Net.Sockets.SocketException was thrown: "No connection could be made because the target machine actively refused it"
Time: 2/20/2015 12:03:36 PM
Thread:Worker Thread[3320]
As pointed by Christophe, this question is a duplicate of SignalR Java client only supports exactly 1.3 and, in my case, was solved by uninstalling and re-installing all the SignalR/Owin packages.

SSL/TLS Error during connecting vCenter via VMware Web Services SDK

I'd like to write some application to manage vSphere environment but first I want to try SDK_5.5 Samples. After building solution I tried to run simpleclient.exe and I've received following message: "Could not establish a trust relationship for the SSL/TLS secure channel".
Here is the command I'm typing to run the program:
SimpleClient.exe --url https://192.168.xxx.xxx/sdk --username administrator#vsphere.local --disablesso
I've installed esxi 5.5 and vCenter with default settings. Is there something i'm missing with certs?
Wired thing... The problem was I didn't place username in " "... after that everything works fine.

Categories

Resources