makarand
(mak_coder)
December 15, 2022, 5:48am
1
opened 12:22PM - 14 Dec 22 UTC
type: bug
status: triage needed
aws:elasticsearch
### Is there an existing issue for this?
- [X] I have searched the existing iss… ues
### Current Behavior
Trying to connect to elasticsearch domain using lambda and elasticsearch client but getting connection error.
this is my docker-compose.yml file
```
version: "2.1"
services:
localstack:
image: "localstack/localstack:latest"
container_name: "localstack"
ports:
- "4566-4620:4566-4620"
- "127.0.0.1:8055:8080"
environment:
- DEBUG=1
- EDGE_PORT=4566
- DATA_DIR=/var/lib/localstack/data
- DOCKER_HOST=unix:///var/run/docker.sock
- HOST_TMP_FOLDER=${TMPDIR}
- LAMBDA_EXECUTOR=docker
- DYNAMODB_SHARE_DB=1
- DISABLE_CORS_CHECKS=1
- AWS_DDB_ENDPOINT=http://localhost:4566
volumes:
- "${TMPDIR:-/var/lib/localstack}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- "local"
networks:
local:
driver: "bridge"
```
this is my elasticsearch client
```
const {Client} = require('@elastic/elasticsearch')
module.exports.elasticClient = new Client({
node : "http://localhost:4566"
})
```
I'm trying to create index from client but connection is refused.
### Expected Behavior
It should create index using Client connector.
### How are you starting LocalStack?
With a docker-compose file
### Steps To Reproduce
#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)
docker run localstack/localstack
#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
awslocal s3 mb s3://mybucket
### Environment
```markdown
- OS:windows 11
- LocalStack: 1.3.0
```
### Anything else?
_No response_
Hi guys can you please look into this? It is taking too much of my time.
This is an error regarding connection from nodeJs client to Elasticsearch.
Trying to connect to elasticsearch domain using lambda and elasticsearch client but getting connection error.
this is my docker-compose.yml file
version: "2.1"
services:
localstack:
image: "localstack/localstack:latest"
container_name: "localstack"
ports:
- "4566-4620:4566-4620"
- "127.0.0.1:8055:8080"
environment:
- DEBUG=1
- EDGE_PORT=4566
- DATA_DIR=/var/lib/localstack/data
- DOCKER_HOST=unix:///var/run/docker.sock
- HOST_TMP_FOLDER=${TMPDIR}
- LAMBDA_EXECUTOR=docker
- DYNAMODB_SHARE_DB=1
- DISABLE_CORS_CHECKS=1
- AWS_DDB_ENDPOINT=http://localhost:4566
volumes:
- "${TMPDIR:-/var/lib/localstack}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- "local"
networks:
local:
driver: "bridge"
this is my elasticsearch client
const {Client} = require('@elastic/elasticsearch')
module.exports.elasticClient = new Client({
node: 'http://mydomain.us-east-1.es.localhost.localstack.cloud:4566',
})
I'm trying to create index from client but connection is refused.
Expected Behavior
It should create index using Client connector.
Environment
OS:windows 11 - LocalStack: 1.3.0
Error I'm getting
lambda process returned with error. Result: {"errorType":"ConfigurationError","errorMessage":"Invalid protocol: 'mydomain.us-east-1.es.localhost.localstack.cloud:'"}. Output: 2022-12-14T13:11:45.942Z undefined ERROR Uncaught Exception {"errorType":"ConfigurationError","errorMessage":"Invalid protocol: 'mydomain.us-east-1.es.localhost.localstack.cloud:'","name":"ConfigurationError"
warkolm
(Mark Walkom)
December 15, 2022, 5:50am
2
Welcome to our community! We aren't all guys here though.
It's not clear what that repo has to do with either Elasticsearch or nodejs sorry. If you have code and errors then it'd be great if you posted them directly here.
makarand
(mak_coder)
December 15, 2022, 5:51am
3
sure, i'll add the code as well
system
(system)
Closed
January 12, 2023, 5:52am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.