Kubernetes on Windows Error: Unable to connect to the server: dial tcp some ip - windows

I have downloaded Docker and then enabled Kubernetes on the Desktop. When I execute 'Kubectl version' command on the PowerShell it says:
kubectl : Unable to connect to the server: dial tcp : 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.
At line:1 char:1
kubectl version

The same issue started to occur today when I run anything related to kubectl on Windows. However, it previously worked fine. Maybe there are some recent updates in Windows/Docker.
UPD
Actually, my network sharing options were reset for some reasons. Please try the solution described below (works for me)
SOLUTION:
Check your Network and Sharing settings:
Control Panel > Network and Sharing > [YOUR_NETWORK] (For me it's my Wi-Fi connection) > Properties > Sharing
On the Sharing tab make sure that you have all checkboxes checked and that you selected the correct virtual network in the "Home network connection" field. If not, please use the correct one.

Related

GRPC server on Mac not working when using laptop's actual IP address instead of localhost

I am following the GRPC tutorials here https://grpc.io/docs/languages/python/.
In greeter_client.py over here - https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_client.py, instead of using
with grpc.insecure_channel('localhost:50051') as channel:
(the above code works fine), I use the following -
with grpc.insecure_channel('XX.XX.XX.XX:50051') as channel:
where XX.XX.XX.XX is my laptop's public IP address from https://www.whatsmyip.org/.
I get this error
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:XX.XX.XX.XX:50051: Failed to connect to remote host: Connection refused"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:XX.XX.XX.XX:50051: Failed to connect to remote host: Connection refused {created_time:"2022-12-29T23:18:44.033798+00:00", grpc_status:14}"
does anyone know why this happens? I think this might be a MacOS issue. Mine is a MacOS Monterey, and I have the firewalls all disabled, so I am not sure what else I should be doing. Is this expected behaviour?
Turns out, the best way to deal with this is by using ngrok. The steps would be something like -
Download ngrok (can use brew install ngrok)
Set up forwarding using something like ngrok tcp 50051
Once you click 'enter', there will be a field under Forwarding, which you should then use. Remember to remove the tcp://

clickhouse-client get error "Timeout exceeded while reading from socket"

I'm newbie to clickhouse, I'm trying to create a clickhouse database on my unbuntu 18.04 remote server, I follow instruction to install click house from DEB package in this link: https://clickhouse.tech/docs/en/getting_started/install/#from-sources
after that when I run command clickhouse-client it shows something like this :
root#busmap-api-test:~# clickhouse-client
ClickHouse client version 20.3.5.21 (official build)
Connecting to localhost:9000 as user default.
Code: 209. DB::NetException: Timeout exceeded while reading from socket (127.0.0.1:9000)
Can someone help me to figure out what is the problem and how I can solve it?
Thanks,
Follow these steps to resolve the issue:
check that clickhouse-server-service started
service clickhouse-server status
check the server logs to find the possible reason
cat /var/log/clickhouse-server/clickhouse-server.err.log
if occured the error 'Address already in use':
{} <Error> Application: Net Exception: Address already in use: [::1]:9000
{} <Error> Application: Net Exception: Address already in use: 127.0.0.1:9000
need to switch CH-server to any other port by editing tcp_port-param in /etc/clickhouse-server/config.xml-file:
..
<tcp_port>9032</tcp_port>
..
restart CH-server service:
service clickhouse-server restart
and connect this way
clickhouse-client --port 9032
I actually had this problem too but I got it working with the default port.
The setting should be this way if you want to connect remotely and be able to use the loopback from localhost.
<listen_host>::1</listen_host>
<listen_host>0.0.0.0</listen_host>
This allows the loopback method to work (i.e clickhouse-client no args) on localhost to connect through the IPV6 route, and the remote connection (i.e clickhouse-client -h <hostname>) through the IPV4 connection.
My original problem was that i only used <listen_host>0.0.0.0</listen_host> in my config which meant theclickhouse-client no args would not work on localhost. And I could not get both to work by adding <listen_host>127.0.0.1</listen_host>

gcloud login network connection failed issue

I tried to connect gcloud with gcloud init. I got Network connection error.
I tried to fix with Network connection problems in Google Cloud SDK while I have access to google or website like google app engine in my browser
gcloud config set proxy/type socks5
gcloud config set proxy/address 127.0.0.1
gcloud config set proxy/port 1086
But it still does not work for me.
My log is:
Welcome! This command will take you through the configuration of gcloud.
Settings from your current configuration [default] are:
core:
disable_usage_reporting: 'False'
proxy:
address: 127.0.0.1
port: '1080'
type: socks5
Pick configuration to use:
[1] Re-initialize this configuration [default] with new settings
[2] Create a new configuration
[3] Switch to and re-initialize existing configuration: [cindy]
Please enter your numeric choice: 1
Your current configuration has been set to: [default]
You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
ERROR: Reachability Check failed.
Cannot reach https://www.google.com (error)
Cannot reach https://accounts.google.com (error)
Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (error)
Cannot reach https://www.googleapis.com/auth/cloud-platform (error)
Cannot reach https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json (error)
Network connection problems may be due to proxy or firewall settings.
Current effective Cloud SDK network proxy settings:
type = socks5
host = 127.0.0.1
port = 1080
username = None
password = None
What would you like to do?
[1] Change Cloud SDK network proxy properties
[2] Clear all gcloud proxy properties
[3] Exit
It is due to redirection from goolge account to localhost for acquiring token Try to login using firefox
Considering the error and mainly the following part of the error, it seems that you are facing issues with your proxy and firewall settings and configuration.
Network connection problems may be due to proxy or firewall settings.
Due to this error, you need to configure your SDK to be used with proxy and firewall. I would recommend you to take a look at the documentation Configuring Cloud SDK for use behind a proxy/firewall, to get more information and steps on how to achieve it and avoid the error that you are facing.
Besides that, I could find the below two posts from the Community, of users that are facing similar cases that you are facing.
ERROR: Reachability Check failed. #51
gcloud utility not working #25
Let me know if the information helped you!
For the people who still have this problem.
Try to use IPV4 first as IPV6 is still buggy for many systems.
For Linux, you can just uncomment or add the following line in /etc/gai.conf file:
precedence ::ffff:0:0/96 100
For other systems, you can google the set-up

Jenkins - slave mac - unable to connect

I have a Jenkins build server (v2.77) installed on a windows server 2016 and I'd like to add a mac as a slave node. I set the node to run via "Java Web Start". On the mac side I downloaded the slave-agent.jnlp file from jenkins, but it doesn't connects to the server.
This is the exception:
java.io.IOException: Failed to connect to 37.210.56.16:49693
at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:243)
at hudson.remoting.Engine.connect(Engine.java:660)
at hudson.remoting.Engine.innerRun(Engine.java:524)
at hudson.remoting.Engine.run(Engine.java:447)
Caused by: java.net.ConnectException: Operation timed out
at java.base/sun.nio.ch.Net.connect0(Native Method)
...
I tried to turn off the windows firewall, to change the TCP port for JNLP agents option in jenkins to fixed/random, but they didn't connected.
Any ideas?
Thanks for help
Finally I found the solution. I rent the server from the google, and in the google cloud console I had to define for this VM instance a firewall rule to accept a specific port number for this JNLP agent connection. Now it's working well.

Cannot connect to Perforce server via visual client

I set up a new Perforce free service on my home server. I am able to connect to the service on the same machine using the visual client targetting localhost:1666. When I try to connect from my desktop I am unable to connect. I originally tried my public IP which is forwarded to my server, but when that didn't work I tried targetting my server locally as Server: "192.168.1.105:1666" In either case I get a similar error of:
Connect to server failed; check $P4PORT.
TCP connect to 192.168.1.105:1666 failed.
connect: 192.168.1.105:1666: WSAETIMEDOUT
On my server "p4 set" shows:
C:\Users\Hephaestus>p4 set
P4EDITOR=C:\Windows\SysWOW64\notepad.exe (set)
P4PASSWD=13C72FC3B6AE5DF224D835D7A26332A0 (set)
P4PORT=1666
P4ROOT=D:\p4
P4USER=Hephaestus (set)
P4_1666_CHARSET=none (set)
On my desktop "p4 set" shows:
P4EDITOR=C:\Windows\SysWOW64\notepad.exe (set)
P4PORT=50.137.244.199:1666 (set)
P4USER=jelamb (set)
I've also worked through most of this: http://answers.perforce.com/articles/KB/2960/. I tried turning my server's firewall off completely.
I've spent hours trying to figure this out and I'm just stumped. Why would I be unable to connect?
I ended up finding out that for whatever reason, adding the config stuff as system variables through Windows didn't do what I needed. Adding them via p4 command-line commands did the trick. Weird, but it works now :/.

Resources