Kaa hostname resolve failed - kaa

I've installed Kaa platform on Ubuntu 16-04. not Sandbox but source 0.11
Default sample period: 1 seconds
2016/11/25 2:31:25 [ERROR] [kaa_tcp_channel.c:870] (-101) - Kaa TCP channel new access point [0x929A2016] hostname resolve failed
2016/11/25 2:31:25 [WARNING] [kaa_bootstrap_manager.c:612] (-7) - Could not find next Bootstrap access point (protocol: id=0x56C8FF92, version=1)
2016/11/25 2:31:25 [ERROR] [kaa_tcp_channel.c:307] (-7) - Kaa TCP channel [0x929A2016] error notifying bootstrap manager on access point failure
2016/11/25 2:31:25 [ERROR] [kaa_client.c:268] (-7) - Failed to connect channel [0x9E010CC0]
Sampled temperature: 29
Sampled temperature: 30
Sampled temperature: 30
Sampled temperature: 29
Sampled temperature: 25
What are my errors indicating?

There are 2 possible reasons for such output:
1. you are trying to run application without running/connected server.
2. wrong server ip set in the web UI.
Things to fix:
1. check connection beetween kaa client & server then regenerate SDK.

Perform these two steps may be this can solve your problem.
Just run this command on host machine
sudo /usr/lib/kaa-sandbox/bin/change_kaa_host.sh $new host name/ip$
Then change the IP address of using Admin UI, for that you need to sign in using username : kaa
and passwword : kaa123
then go to setting > general setting then change the IP address preceded by :8080, enter your machine's public IP address, that can be easily accessible from anywhere.
Tips :: if you are using AWS instance then use public IP address of your instance.
Further error persist then drop your previous instance and launch a new instance.
For more details go the official documentation page
Hope it will be helpful for you.

I have configured my kaa's host name to be my current connection's ip address because i am using bridged adapter as one of my methods of getting the new host name

I had the same problem with KAA installation on my virtual server. Instead of putting the IP address inside kaa-node.properties just put the full domain name or hostname.
transport_public_interface=<server name or full domain name>
and on your client host, update DNS or /etc/hosts accordingly.
The client app will not complain about a name resolution issue.

Related

Unable to access Kafka Broker from separate LAN machine

EDIT: OBE - figured it out. Provided in answer for anyone else who has this issue.
I am working in an offline environment and am unable to connect to a kafka broker, on machine 1, from a separate machine, machine 2, on a LAN connection through a single switch.
Machine 1 (where Kafka and ZK are running):
server.properties
listeners=PLAINTEXT://<ethernet_IPv4_m1>:9092
advertised.listeners=PLAINTEXT://<ethernet_IPv4_m1>:9092
zookeeper.connect=localhost:2181
I am starting kafka/ZK from the config files located in kafka_2.12-2.8.0/config and the running the appropritate .bat from kafka_2.12-2.8.0/bin/windows.
On machine 2 I am able to ping <ethernet_IPv4_m1> and get results; however, I fail to get a TCP connection if I run Test-NetConnection <ethernet_IPv4_m1> -p 9092 while kafka is running. In python 3.8.11, using KafkaConsumer from kafka-python, I receive the NoBrokersAvailable error when using <ethernet_IPv4_m1>:9092 as the bootstrap_server. Additionally if I run a python:3.8.12-buster docker container with a '/bin/bash' entrypoint, and follow along with the kafka-listener walkthrough I am unable to connect to the broker. I'm in the exact situation as Scenario 1 provided in the link, but the walkthrough assumes you can connect to the broker. I have also tried opening the 9092 port in my Windows Defender for in/outbound traffic (on both machines) and still have no luck. Neither Kafka, nor networking, are my strong suits and every tutorial/answer I find refers to changing the listener and advertised.listener in the kafka server.properties file - I think I correctly did this, but am unsure. This is everything I have tried so far, any recommendations would be greatly appreciated. Thank you.
For M1, the private network was the active network.
Go to control panel -> Firewall & network protection -> advanced settings (must be admin) -> setup inbound/outbound rules for port 9092 for the active network.

corda CENM networkmap server start failing to connect database after a few week run

we operate CENM(1.2 and use helm template to run on k8s cluster) to construct our own private network and keep on running CENM network map server for a few week, then launching new node start failing.
with further investigation, its appeared that request timeout for http://nmap:10000/network-map causes problem.
in nmap server’s log, we found following output when access to above url with curl.
[NMServer] - Error while handling socket client message com.r3.enm.servicesapi.networkmap.handlers.LatestUnsignedNetworkParametersRetrievalMessage#760c53ea: HikariPool-1 - Connection is not available, request timed out after 30000ms.
netstat shows there is at least 3 establish connection to the database from the container which network map server runs, also I can connect database directly with using CLI.
so I don’t think it is neither database saturated nor network configuration problem.
anyone have an idea why this happens? I think restart probably solve the problem, but want to know the root cause...
regards,
Please test the following options.
Since it is the HikariCP (connection pool) component that is throwing the error it would be worth seeing if increasing the pool size in the network map configuration may help - see below)
Corda uses Hikari Pool for creating the connection pool. To configure the connection pool any custom properties can be set in the dataSourceProperties section.
dataSourceProperties = {
dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
...
maximumPoolSize = 10
connectionTimeout = 50000
}
Has a healthcheck been conducted to verify there are sufficient resources on that postgres database i.e basic diagnostic checks ?
Another option to get more information logged from the network map service is to run with TRACE logging also:
From https://docs.corda.net/docs/cenm/1.2/troubleshooting-common-issues.html
Enabling debug/trace logging
Each service can be configured to run with a deeper log level via command line flags passed at startup:
java -DdefaultLogLevel=TRACE -DconsoleLogLevel=TRACE -jar <enm-service-jar>.jar --config-fi

How can i solve ""Need to upload logs" Error

this ERROR is when i try to sent data temperature from FIRST APP TUTORIAL
[pool-1-thread-1] INFO FirstKaaDemo - Sampled Temperature: 31
[pool-4-thread-147] INFO org.kaaproject.kaa.client.logging.strategies.RecordCountLogUploadStrategy - Need to upload logs - current count: 147, threshold: 1
[Thread-2] INFO org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel - Can't sync. Channel [default_operation_tcp_channel] is waiting for CONNACK message + KAASYNC message
Need to upload logs Need to upload logs Need to upload logs !!!!!!!!!!!!!!!????
Please check your connection to the server and configuration of the Mongo DB Log Appender:
Ensure the Kaa host on Kaa Sandbox Management page is configured correctly. Ideally, you should change localhost (127.0.0.1) there to real IP address of the PC host you are running the Kaa Sandbox on.
Ensure the application PC host can reach the Kaa Sandbox IP address by the IP address configured on the Kaa Sandbox Management page (see item 1).
Ensure the Kaa SDK used for the application was downloaded after the change of the Kaa host on the Kaa Sandbox Management page.
Check your MongoDB log appender configuration.

Accessing localhost API endpoint from different machine

I have a pressure sensor plugged into my computer, and the only way to collect the data is through a localhost API endpoint, meaning right now only that machine can collect data. Is there any way to receive data from the localhost API on a different machine? I also need to ping the API 20-40 times a second if that matters.
There are couple of ways I can think of, I am assuming both the machines are on same network
Use localhost API to collect the data in database and create a GET endpoint inside same application for fetching the data according your parameters. You can access GET endpoint from different machine by hitting network ip address of your local machine. Which you can check using ifconfig command in your terminal, check en0 type where you will find something like 192.168.X.X. From other machine you can hit http://192.168.X.X:<port>/getData, where <port> is the localhost port.
If you don't want to use database, then you can use publish subscribe mechanism which is real time. see http://autobahn.ws/python/
How publish subscribe works ?
You will have to make your localhost machine a publisher (server) which will publish events or sensor data in your case (real time). The other machine will be subscriber (client ) which will listen to the events from your server and do necessary processing.
Its uses WAMP (Web application messaging protocol) for communication. The sample code for basic publisher and subsriber can be found here.
Follow steps:
1 : Download ngrok,
2 : Go to the path where ngrok.exe file present and open that path in cmd.
3 : Connect your account.
paste : ngrok authtoken1pA6advIt950uA4y2Rixgc8rdx9_23MSDokKjWhbPUW3NSrZK
4 : Replace your port no including bracket.
paste : ngrok http {9003} -host-header="localhost:{9003}".
5 : copy forward line and paste in other system to check.
Forwarding http://d1c0bc16ff7b.ngrok.io

Configure MS DTC over VPN

I tried to configure MS DTC via our VPN. But when I try to open the connection it gives me the following error.
The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)
When I check with the network team they told me that the firewall is already configured to allow DTC.
If I explain this further this communication is done via VPN. According to my network admin, although the client machine could see the NetBios name of the server but server cannot see the client's NetBios name, when this communication is done through a firewall/router. He is telling that, to start a DTC communication both machines should be able to see their NetBios names.
I tried with DTCPing (Same setup) and the dtc ping error is
03-04, 10:18:33.918-->RPC server:NGSVR received following information:
Network Name: NGSVR
Source Port: 49179
Partner LOG: WS-PCSPOS76036.log
Partner CID: EBA77A41-C9F9-4162-B7A2-E10404719072
++++++++++++Start Reverse Bind Test+++++++++++++
Received Bind call from WS-PCSPOS7
Network Name: NGSVR
Source Port: 49179
Hosting Machine:NGSVR
03-04, 10:18:33.996-->Trying to Reverse Bind to WS-PCSPOS7...
Test Guid:EBA77A41-C9F9-4162-B7A2-E10404719072
gethostbyname can not resolve WS-PCSPOS7
Error(0xB7) at nameping.cpp #43
-->gethostbyname failure
-->183(Cannot create a file when that file already exists.)
Can not resolve WS-PCSPOS7
Error(0x6BA) at ServerManager.cpp #453
-->RPC reverse BIND failed
-->1722(The RPC server is unavailable.)
Reverse Binding to WS-PCSPOS7 Failed
In GUID
Out GUID
Reverse BIND FAILED
Session Down
I have tried to open and do a transaction via non vpn setup and it was successful.
Can we configure MS DTC via VPN?
If it is possible any additional configuration should do to VPN?

Resources