can't start solana validator node,can't connect - solana

I have used SSR, and the viewer can access the node
get_cluster_shred_version failed: 108.160.170.41:8001, connection timed out
.....
[2022-05-07T01:25:37.984950553Z INFO solana_validator] Contacting 128.242.240.212:8001 to determine the validator's public IP address
....
Unable to determine the validator's public IP address

This error happens when it isn't possible for the software to figure out what its public ip address is for the gossip protocol at this line: https://github.com/solana-labs/solana/blob/8d0134e0fdede539cf8ab89ef0ce794f1d41f9dc/validator/src/main.rs#L2819
To be explicit, pass --gossip-host and --gossip-port, ie:
$ solana-validator <all of your previous args> --gossip-host YOUR_IP_HERE --gossip-port 8001
Note that you don't need to have your gossip port at 8001, but it's a convention.

Related

Some problems on QUIC-GO example server

The situation is, I wanna establish a QUIC connection based on quic-go from local to ECS server. The related tests using localhost are done both on local and remote device. That is:
#local: .$QUIC-GO-PATH/example/client/main -insecure -keylog ssl.log -qlog trial.log -v https://127.0.0.1:6121/demo/tile
#local: .$QUIC-GO-PATH/example/main -qlog -tcp -v
These tests are completed.
Now is the problem,when I start local-remote connection an error occurred:
#remote: .$QUIC-GO-PATH/example/main -qlog -tcp -v
#local: .$QUIC-GO-PATH/example/client/main -insecure -keylog ssl.log -qlog trial.log -v https://$REMOTE_IPADDR:6121/demo/tile
timeout: no recent network activity
When I go through a wireshark examination, it seems like the CRYPTO handshake never finishes:
Wireshark
Also client Qlog file atteched here:
Qlog file
Codes are all the same with https://github.com/lucas-clemente/quic-go
Help!
This problem has been solved.
Code $QUIC-GO-PATH/example/main.go has binded the port as a default onto 127.0.0.1:6121, which led to the problem that the server cannot get reached by client outside, just get this on server running:
-bind 0.0.0.0:6121

gomobile build, the Paho mqtt client cannot connect to mqtt broker in APK

I am working on a project where I need to use gomobile tool to create an Android app.
The sample code I have in Go is as below
var broker = "127.0.0.1"
//var broker = "broker.mqttdashboard.com"
var port = 1883
opts := mqtt.NewClientOptions()
opts.AddBroker(fmt.Sprintf("tcp://%s:%d", broker, port))
opts.SetClientID("go_mqtt_client")
opts.SetConnectionLostHandler(connectLostHandler) // define what to do when connection is lost
client := mqtt.NewClient(opts)
tokenClient := client.Connect()
if tokenClient.Wait() && tokenClient.Error() != nil {
panic(tokenClient.Error())
}
...
When I bind this code using "gomobile bind", generating the Golang plugin and calling them inside the android project there is no issue.
Connections is satisfied and I can verify the local mqtt broker (mosquitto) and the mqtt client app are communicating as well.
But when I generate the APK file using "gomobile build -target=android", the connect function generates and error.
To be able to test the logs i used a public broker instead of the local mqtt broker. I replaced the
var broker = "127.0.0.1"
by the HiveMQ public broker address (I have already validated the public broker functionality)
var broker = "broker.mqttdashboard.com"
It seems like there is an issue with connecting from mqtt client app to mqtt broker. Here is the exact error message I found in logs:
E/Go: panic: network Error : dial tcp: lookup
broker.mqttdashboard.com: No address associated with hostname
goroutine 11 [running]: E/GoLog: panic: network Error : dial tcp: lookup broker.mqttdashboard.com: No address associated with hostname
E/Go: main.starting()
This is generated by "panic(tokenClient.Error())" part in my code.
Any idea why the connection is not settled using "gomobile build", while it is working when I use "gomobile bind" ?
Here is how I could fix the issue.
I added the AndoridManifest.xml file to the same directory that the main go package is.
Added the following line in between the manifest tags (<manifest> )
<uses-permission android:name="android.permission.INTERNET">

JMeter - Listen to a port on a given IP

I want to run a jmeter test, which listens to a port on a given ip, and prints the messages which are being sent to that port. I have tried using this:
SocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.getByName("<client ipAddress>"),<port number>);
def server = new ServerSocket();
server.bind(inetSocketAddress);
while(true) {
server.accept { socket ->
log.info('Someone is connected')
socket.withStreams { input, output ->
def line = input.newReader().readLine()
log.info('Received message: ' + line)
}
log.info("Connection processed")
}
}
But this is giving me error - "Cannot assign requested address: JVM_Bind
"
Is there any alternate way to approach this? Or what changes do i need to do for the current approach to work?
You copied and pasted this code from the right place and it should work just fine. Evidence:
as per the BindException documentation
Signals that an error occurred while attempting to bind a socket to a local address and port. Typically, the port is in use, or the requested local address could not be assigned.
So I can think of 2 options:
Your <client ipAddress> is not correct and cannot be resolved.
Something is already running on the <port number>, you cannot have 2 applications listening to the same port, the first one will be successful and another one will fail
More information:
Fixing java.net.BindException: Cannot assign requested address: JVM_Bind in Tomcat, Jetty
Apache Groovy - Why and How You Should Use It

Setting address of whois service for ruby whois gem

Using the ruby whois gem, how do I set the server address of the whois service?
Setting the bind_host, I get an error.
> whois_client = Whois::Client.new(bind_host: "192.0.47.59", bind_port: 43)
=> #<Whois::Client:0x00000008188e7e50 #timeout=10, #settings={:bind_host=>"192.0.47.59", :bind_port=>43}>
> record = whois_client.lookup('wandajackson.com')
Whois::ConnectionError: Errno::EADDRNOTAVAIL: Can't assign requested address - bind(2) for "192.0.47.59" port 43
from (irb):4
I'm pretty sure bind_host doesn't refer to the host used for the whois lookup, but instead refers to the adapter binding on the server running your code. By default it binds to 0.0.0.0, or all the adapters on the local server.
If you want to have the whois gem use a custom server address for looking up whois information then it appears that you have to specify it in one of the following ways:
# Define a server for the .com TLD
Whois::Server.define :tld, "com", "your.whois.server.address"
Whois.whois("google.com")
# Define a new server for an range of IPv4 addresses
Whois::Server.define :ipv4, "10.0.0.0/8", "your.whois.server.address"
Whois.whois("10.0.0.1")
# Define a new server for an range of IPv6 addresses
Whois::Server.define :ipv6, "2001:2000::/19", "your.whois.server.address"
Whois.whois("2001:2000:85a3:0000:0000:8a2e:0370:7334")
These examples were taken from https://www.rubydoc.info/gems/whois/Whois/Server.

libnetwork: Error: unknown command "/var/run/docker/netns/582bd184e561" for "some_app"

I am trying to setup a network in the container (using Docker's libnetwork and libcontainer), but I keep running into this issue. As far as I can tell it's looking into some_app to get some sandbox information?
INFO[3808] No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : [nameserver 8.8.8.8 nameserver 8.8.4.4]
INFO[3808] IPv6 enabled; Adding default IPv6 external servers : [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]
Error: unknown command "/var/run/docker/netns/582bd184e561" for "some_app"
Run 'some_app --help' for usage.
ERRO[3808] Resolver Setup/Start failed for container 6b81802576bd4f16aa117061f81b5c3e, "setup not done yet"
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument
I was wondering if anyone could help me make sense of this and perhaps prevent it. Are these two separate errors?
Thank you
Here is the library I am trying to use
It took me a while to figure this out, but here goes:
Just like in Docker, libnetwork creates a veth interface pair. It then moves one end of the veth pair into the container namespace. During this process libnetwork tries to execute commands registered at runtime on the current instance of the binary (some_app in this case).
These commands do not exist on the external interface of some_app however. They are injected later using a library called reexec. For this to work, reexec needs to be initialized like this:
if reexec.Init() {
return
}
Also note that according to this thread libnetwork is currently not supported for applications outside of Docker.
NB: I discovered this by reading the source code, so I might be wrong but my issue went away after this.

Resources