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

Unable to connect to RDS Aurora SQL DB via ToxiProxy server #450

Open
ashish-k opened this issue Oct 7, 2022 · 10 comments
Open

Unable to connect to RDS Aurora SQL DB via ToxiProxy server #450

ashish-k opened this issue Oct 7, 2022 · 10 comments

Comments

@ashish-k
Copy link

ashish-k commented Oct 7, 2022

Followed steps mentioned below:

  1. I have created proxy using following command:
    toxiproxy-cli create -l 0.0.0.0:26379 -u {RDS Aurora DB endpoint}:3306 RDS
  2. Replaced RDS aurora endpoint in url below with IP of proxy server
    jdbc:mysql://{proxy_server_ip}:26379/{DB_name}
  3. When I try to access SQL server as earlier, I get following error -
    "ERROR: Unexpected error: Could not connect to MySQL instance. Error is: (2003, "Can't connect to MySQL server on '{Proxy ip address}' (timed out)")"
@miry
Copy link
Contributor

miry commented Oct 7, 2022

jdbc:mysql://{proxy_server_ip}:3306/{DB_name}

Should be jdbc:mysql://{proxy_server_ip}:26379/{DB_name}

@ashish-k
Copy link
Author

@miry I did change it to "jdbc:mysql://{proxy_server_ip}:26379/{DB_name}". It was a typo. Apologies. Request you to help me here.

@miry
Copy link
Contributor

miry commented Oct 10, 2022

@ashish-k I propose to check toxiproxy with simple commands:

  1. Make sure toxiproxy server and client are uptodated:
$ toxiproxy-server --version
toxiproxy-server version 2.5.0

$ toxiproxy-cli --version
toxiproxy-cli version 2.5.0
  1. Run server with debug log level.
LOG_LEVEL=debug toxiproxy-server 
  1. Create a new proxy
toxiproxy-cli create -l 0.0.0.0:26379 -u {RDS Aurora DB endpoint}:3306 rds
toxiproxy-cli inspect rds
  1. Test that port is open
curl -v 0.0.0.0:26379
curl -v 127.0.0.1:26379
  1. Check logs from toxiproxy-server.

Pls share output of commands and logs, it would help me to identify the problem.

@ashish-k
Copy link
Author

ashish-k commented Oct 14, 2022

@miry Thank you for your inputs.

After running command "LOG_LEVEL=debug toxiproxy-server", following output is printed and nothing happens after that.
Can you please suggest if there is some alternative way to change LOG_LEVEL. Thanks again!

{"level":"info","host":"localhost","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2022-10-14T11:54:21Z","message":"Starting HTTP server on endpoint localhost:8474"}

@miry
Copy link
Contributor

miry commented Oct 14, 2022

@ashish-k Have you done commands with curl? According the logs, it looks there were no any requests done.

Can you please suggest if there is some alternative way to change LOG_LEVEL.

It is not possible right now, sorry for this. Probably we can move log level in config later.

@ashish-k
Copy link
Author

@miry Please find below the output of curl commands.

curl -v 0.0.0.0:26379

Output:

  • Trying 0.0.0.0:26379...
  • Connected to 0.0.0.0 (127.0.0.1) port 26379 (#0)

GET / HTTP/1.1
Host: 0.0.0.0:26379
User-Agent: curl/7.81.0
Accept: /

  • Received HTTP/0.9 when not allowed
  • Closing connection 0
    curl: (1) Received HTTP/0.9 when not allowed

curl -v 127.0.0.1:26379

Output:

  • Trying 127.0.0.1:26379...
  • Connected to 127.0.0.1 (127.0.0.1) port 26379 (#0)

GET / HTTP/1.1
Host: 127.0.0.1:26379
User-Agent: curl/7.81.0
Accept: /

  • Received HTTP/0.9 when not allowed
  • Closing connection 0
    curl: (1) Received HTTP/0.9 when not allowed

@ashish-k
Copy link
Author

@miry Request you to help me here. Do let me know if any other inputs are required.

@ashish-k
Copy link
Author

Can anyone else help me here please if @miry is not available

@ashish-k
Copy link
Author

@miry Can you please help me here

@miry
Copy link
Contributor

miry commented Jan 11, 2023

@ashish-k As I see toxiproxy shows the reply from Aurora DB. You did not provide logs from toxiproxy during your experiments with curl.
I am not familiar with Aurora DB, I could guess that some sort Handshake verification enabled. Example SSL or encription, where server see that proxy used.

You should check Toxiproxy server logs and Aurora DB logs.

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

No branches or pull requests

2 participants