- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23
 
Description
Describe the bug
Hoping someone can help. I am trying to use the local-data-api image as is. Then, calling it as in the sample with aws client. I keep getting Connection refused error.
To Reproduce
Steps to reproduce the behavior:
- On the 1st terminal, I have
 
docker run --rm -it --name my-data-api -p 8080:80 -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASSWORD=example -e RESOURCE_ARN=arn:aws:rds:us-east-1:123456789012:cluster:dummy -e SECRET_ARN=arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy koxudaxi/local-data-api
2022-01-14 16:05:36.497 [main] TRACE Application - {
# application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 6
"application" : {
# application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 7
"modules" : [
# application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 7
"com.koxudaxi.localDataApi.ApplicationKt.module"
]
},
# application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 2
"deployment" : {
# application.conf @ jar:file:/app/local-data-api.jar!/application.conf: 3
"port" : 8080
},
# Content hidden
"security" : "***"
}2022-01-14 16:05:36.605 [main] INFO Application - Autoreload is disabled because the development mode is off.
2022-01-14 16:05:37.193 [main] INFO Application - Responding at http://0.0.0.0:80
- On the 2nd terminal, I use the aws script in ReadMe and the response:
 
aws --endpoint-url http://127.0.0.1:8080 rds-data execute-statement --resource-arn "arn:aws:rds:us-east-1:123456789012:cluster:dummy" --sql "show databases" --secret-arn "arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy" --database 'test'
An error occurred (BadRequestException) when calling the ExecuteStatement operation: Database error code: -1. Message: : Socket fail to connect to host:127.0.0.1, port:3306. Connection refused (Connection refused)
Desktop (please complete the following information):
- OS: v 10.15.7
 
Additional context
- I had tried different values of MYSQL_HOST, e.g. localhost. It did not make a different.
 - I had tried using AWS.RDSDataService (in JavaScript) to executeStatement at the 
endpoint = 'http://127.0.0.1:8080' 
Any suggestion is appreciated. Thanks in advanced.