kondou
December 24, 2024, 6:17am
1
Hello.
We have created a Rovo agent app on Jira.
I would like to integrate Rovo with ElasticSearch.
The questions asked by users on Rovo are returned via ElasticSearch.
If I use “forge tunnel” command and ask a question in Rovo chat,
I get a response from ElasticSearch in Rovo chat without any problem.
However, if I use “forge deploy” command and ask a question in Rovo chat,
I get the following error and cannot get an answer from ElasticSearch.
getaddrinfo ENOTFOUND
I assume that there is no mistake in the source code, because “forge tunnel” command works as expected.
In addition, on the ElasticSearch side, the IP address of the following URL is set in the allow list.
IP addresses and domains for Atlassian cloud products
Is there any solution to this problem?
If there is any other information needed, please let me know.
Hi @kondou ,
I believe the getaddrinfo ENOTFOUND
indicates a DNS resolution problem occurred. If this is still occurring, can you share the code where you make the request.
Regards,
Dugald
kondou
January 7, 2025, 5:21am
3
@dmorrow
Thanks for the reply.
The source code is below.
const { Client } = require("@elastic/elasticsearch");
const endpoint = "my endpoint URL";
const apiKey = "my APIkey";
export async function search(payload){
try{
console.log(`Question: ${payload.question}`);
const client = new Client({
node: endpoint,
auth: {
apiKey: apiKey
}
});
const result = await client.search({
index: "my index name",
query: {
match: {
content: payload.question
}
}
});
const hit = result.hits.hits[0];
console.log(hit);
return hit._source.content;
} catch (error){
console.error('An error occurred:', error);
}
}