UnKnownHostException when connect cosmos in private link - azure-cosmosdb

private DNS zone(private link) has been setup for cosmos DB https://qa-db.documents.azure.com:443/
Aliases:
qa-db.documents.azure.com
qa-db.privatelink.documents.azure.com
Application within same VNet was able to connect to https://qa-db.documents.azure.com:443/ in azure-cosmos 4.15.0 + azure-core 1.16.0
After updating to azure-cosmos 4.30.0 + azure-core 1.27.0, it gets UnKnownHostException
2022-11-22T20:31:02,469 [reactor-http-epoll-1] [ERROR] com.azure.cosmos.implementation.RxGatewayStoreModel lambda$toDocumentServiceResponse$3 [384] - Network failure
java.net.UnknownHostException: qa-db.documents.azure.com: Name or service not known
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source)
How to fix this?

Related

Connect AWS Dax Client to localstack DynamoDB?

I am attempting to use the AWS DaxClient to connect to a localstack setup running DynamoDB.
I start localstack from the docker-compose file in their github repo here.
Then I try creating a Dax Client in Java code and pointing it to that
public class PlainJavaClass {
static AmazonDynamoDB daxClient;
public static void main(String[] args) throws Exception {
AmazonDaxClientBuilder daxClientBuilder = AmazonDaxClientBuilder.standard();
daxClientBuilder.withRegion("us-east-1").withEndpointConfiguration("localhost:4566");
daxClient = daxClientBuilder.build();
}
}
However I'm getting the following exception:
12:36:53.713 [main] WARN com.amazon.dax.client.dynamodbv2.ClusterDaxClient - exception starting up cluster client: java.io.IOException: failed to configure cluster endpoints from hosts: [localhost:4566]
java.io.IOException: failed to configure cluster endpoints from hosts: [localhost:4566]
at com.amazon.dax.client.cluster.Source$AutoconfSource.pull(Source.java:127)
at com.amazon.dax.client.cluster.Source$AutoconfSource.update(Source.java:59)
at com.amazon.dax.client.cluster.Source$AutoconfSource.refresh(Source.java:50)
at com.amazon.dax.client.cluster.Cluster.refresh(Cluster.java:426)
at com.amazon.dax.client.cluster.Cluster.refresh(Cluster.java:409)
at com.amazon.dax.client.cluster.Cluster.startup(Cluster.java:330)
at com.amazon.dax.client.cluster.Cluster.startup(Cluster.java:263)
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient.<init>(ClusterDaxClient.java:148)
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient.<init>(ClusterDaxClient.java:119)
at com.amazon.dax.client.dynamodbv2.AmazonDaxClientBuilder.build(AmazonDaxClientBuilder.java:34)
at com.example.crudspringbootdynamodb.PlainJavaClass.createDaxClient(PlainJavaClass.java:30)
at com.example.crudspringbootdynamodb.PlainJavaClass.main(PlainJavaClass.java:50)
Caused by: com.amazon.cbor.EndOfStreamException: null
at com.amazon.cbor.CborInputStream.readObject(CborInputStream.java:1340)
at com.amazon.dax.client.exceptions.DaxServiceException.pickException(DaxServiceException.java:44)
at com.amazon.dax.client.generated.DaxClientStubs.handleResponse(DaxClientStubs.java:963)
at com.amazon.dax.client.generated.DaxClientStubs.endpoints_455855874_1(DaxClientStubs.java:479)
at com.amazon.dax.client.dynamodbv2.DaxClient.endpoints(DaxClient.java:2375)
at com.amazon.dax.client.cluster.Source$AutoconfSource.pullFrom(Source.java:137)
at com.amazon.dax.client.cluster.Source$AutoconfSource.pull(Source.java:105)
... 11 common frames omitted
Suppressed: com.amazon.cbor.EndOfStreamException: null
... 18 common frames omitted
I know I'm able to connect to localstack using a normal DynamoDb client created like this:
AmazonDynamoDBClientBuilder
.standard()
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("http://localhost:4566/", "us-east-1"))
.build();
So not really sure where to go next. Is it possible to use DAX client to connect to DynamoDB localstack?
No, localstack does not support it yet. There is an open issue about it on github (https://github.com/localstack/localstack/issues/3707).

Getting error while redeploying nodes

I am still using Corda 1.0 version. when i try to redeploy nodes with existing data, getting below error while start-up but able to access the nodes . If i clear the data and redeploy the nodes, i didn't face these error message.
Logs can be found in :
C:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\kotlin-
source\build\nodes\xxxxxxxx\logs
Database connection url is : jdbc:h2:tcp://xxxxxxxxx/node
E 18:38:46+0530 [main] core.client.createConnection - AMQ214016: Failed to
create netty connection
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler.handshake(...)(Unknown Source) ~[netty
all-4.1.9.Final.jar:4.1.9.Final]
Incoming connection address : xxxxxxxxxxxx
Listening on port : 10014
RPC service listening on port : 10015
Loaded CorDapps : corda-finance-1.0.0, kotlin-
source-0.1, corda-core-1.0.0
Node for "xxxxxxxxxxx" started up and registered in 213.08 sec
Welcome to the Corda interactive shell.
Useful commands include 'help' to see what is available, and 'bye' to shut
down the node.
Wed May 23 18:39:20 IST 2018>>> E 18:39:24+0530 [Thread-6 (ActiveMQ-server-
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImp
l$3#4a532271)] core.client.createConnection - AMQ214016: Failed to create
netty connection
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler.handshake(...)(Unknown Source) ~[netty-
all-4.1.9.Final.jar:4.1.9.Final]
This looks like the Artemis failed to connect to the node which means the node fails to start.
You should look at the log and if there are any other previous Corda node started which occupy the node.
If there are any legacy Corda nodes that have not been killed, try ps -ef |grep java to see if there is any other java still alive. Especially look for the port number and check if they are overlapped

Running corda nodes in different machines

I have the problem in Corda regarding performing IOU from Party A to Party B.
Below is configuration detail:
3 node.conf [Party A, Party B, and Notary ].
Hosting application in AWS, So in node config file instead of "localhost", I gave the IP of the machines. I gave the same IP for Notary & Party A, different for Party B.
Network Bootstrapping was successful and moved the newly created node folders respective EC2 instances and started run nodes.
But when performed the IOU from Party A to Party B it's not working. Please suggest how to resolve the issue.
I see the following error in the node logs:
E 11:34:47+0000 [main] internal.Node.run - Exception during node startup {}
java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_161]
at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_161]
at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_161]
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[?:1.8.0_161]
at io.netty.channe
Reference: https://docs.corda.net/tutorial-cordapp.html#running-nodes-across-machines
I reach node communication on different hosts by the following way.
First of all I deploy node with node.conf file which contains
"p2pAddress" : "host:10012",
"rpcSettings" : {
"address" : "host:10014",
"adminAddress" : "host:10013"
}
Then after node deployed I change host of rpcSettings to localhost
"rpcSettings" : {
"address" : "localhost:10014",
"adminAddress" : "localhost:10013"
}
Such way looks strange, however after this manipulation nodes started to communicate
This is related with NodeInfo file which is generated at node deploy and it should contains the host for rpc. After that rpc needs localhost for interaction. I think it might be a bug, but works fine in that way.
When using rpcSettings in Corda V3.1 the address and adminAddress need to be using 0.0.0.0.
rpcSettings {
address="0.0.0.0:10003"
adminAddress="0.0.0.0:10103"
}
These endpoints are not advertised externally so the local ip is solely a binding for Corda.
This should solve the following exception on starting your cordapp when using public ip or DNS:
E 21:28:56+0000 [main] internal.Node.run - Exception during node
startup {} io.netty.channel.unix.Errors$NativeIoException: bind(..)
failed: Cannot assign requested address

openstack: Failed to launch instance from the glance

We have setup OpenStack using conjure-up on a (Ubuntu LTS server 16.04.3) single machine. All are services are up and running, and successfully I am able to upload images to the glance.
We wanted to save these glance images created by "glance image-create" in remote machine which have nfs server. So we have configured glance-api.conf file as below.
My glance-api.conf looks like this:
[glance_store]
filesystem_store_datadir = /var/lib/glance/images
default_store = file
And in glance controller node, I have mounted
remote machine Ip/home/glance/images/ in this directory path
/var/lib/glance/images
and have mentioned the same mounted directory path inside the glance-api.conf file.
I have created the two sample private network with some ip (192.168.1.0 and 10.221.50.0) but have not created a public network as at this moment I don't want to access this VM instance from outside.
When I am trying to launch the instance from dashboard UI as well as through CLI, I am getting below error.
Error: Failed to perform requested operation on instance "Ubuntu_Hawkbit", the instance has an error status: Please try again later [Error: No valid host was found. There are not enough hosts available.].
Note: I have tried by associating Instance with different private network ,thinking that it may be network IP address issue but facing the same error.
When I check /var/log/nova/nova-compute.log logs, I see below error.
ERROR nova.image.glance [req-1459f1b2-491c-46a2-b803-6ff621a79d30 6ebc7996240c4ce688234f544c9d0116 07427c9d49704357a049b24193ee0a28 - -
-] Error contacting glance server 'http://10.206.193.159:9292' for 'data', done trying.
ERROR nova.image.glance CommunicationError:
Error finding address for
http://10.206.193.159:9292/v1/images/6c30e2ab-1078-45ad-bed2-3e3a75f6af8c:
('Connection aborted.', BadStatusLine("''",))
ERROR
nova_lxd.nova.virt.lxd.image
[req-1459f1b2-491c-46a2-b803-6ff621a79d30
6ebc7996240c4ce688234f544c9d0116 07427c9d49704357a049b24193ee0a28 - -
-] [instance: eedc008d-ef34-498d-8774-b3813ce032f4] Failed to upload 6c30e2ab-1078-45ad-bed2-3e3a75f6af8c to LXD: Connection to glance
ERROR nova_lxd.nova.virt.lxd.operations
[req-1459f1b2-491c-46a2-b803-6ff621a79d30
6ebc7996240c4ce688234f544c9d0116 07427c9d49704357a049b24193ee0a28 - -
-] [instance: eedc008d-ef34-498d-8774-b3813ce032f4] Faild to start container instance-00000020: Connection to glance host
http://10.206.193.159:9292 failed: Error finding address for
http://10.206.193.159:9292/v1/images/6c30e2ab-1078-45ad-bed2-3e3a75f6af8c:
('Connection aborted.', BadStatusLine("''",))
ERROR nova.compute.manager [req-1459f1b2-491c-46a2-b803-6ff621a79d30
6ebc7996240c4ce688234f544c9d0116 07427c9d49704357a049b24193ee0a28 - -
-] [instance: eedc008d-ef34-498d-8774-b3813ce032f4] Instance failed to spawn

why i got an error while running C:\otp\otp>bin\start-server.bat in command prompt?

When i'm tring to run Open trip planner in my windos system i got an error like this why this happens?
when i'm tring to run
C:\otp\otp>bin\start-server.bat
in command prompt,i had an error like below..
can anyone know why this happens??
C:\otp\otp>bin\start-server.bat
C:\otp\otp>java -Xmx1448m -jar lib\winstone.jar --webappsDir=webapps
.......
.......
[Winstone 2012/11/22 15:47:59] - Beginning extraction from war file
[Winstone 2012/11/22 15:48:00] - No webapp classes folder found - C:\otp\otp\web
apps\opentripplanner-webapp\WEB-INF\classes
[Winstone 2012/11/22 15:48:00] - Deployed web application found at opentripplann
er-webapp.war
[Winstone 2012/11/22 15:48:00] - Winstone Servlet Engine v0.9.10 running: contro
lPort=disabled
[Winstone 2012/11/22 15:48:00] - Error during HTTP listener init or shutdown
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at winstone.HttpListener.getServerSocket(HttpListener.java:102)
at winstone.HttpListener.run(HttpListener.java:116)
at java.lang.Thread.run(Unknown Source)
[Winstone 2012/11/22 15:48:00] - HTTP Listener shutdown successfully
[Winstone 2012/11/22 15:48:00] - AJP13 Listener started: port=8009
The error tells you why:
Error during HTTP listener init or shutdown
java.net.BindException: Address already in use: JVM_Bind
The port the application tries to bind to, is already in use by another application. Change the port or shutdown the other application.
java.net.BindException: Address already in use: JVM_Bind... Seems you have something that is already listening on the port you have specified. You have to check what is using it (especially if it's a standard one like 80 or 443).

Resources