Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadRequestException: Connection refused #184

Open
cecilialam opened this issue Jan 14, 2022 · 0 comments
Open

BadRequestException: Connection refused #184

cecilialam opened this issue Jan 14, 2022 · 0 comments

Comments

@cecilialam
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant