Skip to content

BadRequestException: Connection refused  #184

@cecilialam

Description

@cecilialam

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:

  1. 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

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions