0

I am trying to set-up Athena connection in VSCode using SQLTools extension.

When I do Test Connection, I get this error

Error opening connection Inaccessible host: athena.us-east-1.amazonaws.com'. This service may not be available in the us-east-1' region.

I am behind VPN. If I disconnect from VPN, I can establish the connection to Athena

If the VPN is on, I get the above error.

I also have awscliv2 installed and if I run a script adapted from this, it returns the results, even when connected to VPN

I also tried this successfully so, doesn't seem to be general network issue.

How can I connect to Athena from VSCode when still being connected to VPN?

nc -v athena.us-east-1.amazonaws.com 443 Connection to athena.us-east-1.amazonaws.com port 443 [tcp/https] succeeded!

How can I fix this error

Athena-in-VSCode enter image description here

Guy
  • 12,388
  • 3
  • 45
  • 67
adbdkb
  • 1,897
  • 6
  • 37
  • 66
  • 1
    It sounds like a problem in the way that the VPN has been implemented. You'll probably need to raise it with your networking team. – John Rotenstein May 16 '23 at 02:59
  • @JohnRotenstein - What do I need to tell the networking team - not really conversant with how VPN is set-up. And when I tried to set-up a connection from dBeaver to Athena, I had to add these extra user parameters when looking at the driver settings - `AwsCredentialsProviderArguments`, `AwsCredentialsProviderClass`, `UseResultsetStreaming`, `Workgroup`, `ageforResultReuse`, `enableResultReuse`. Do we need to do something similar on VSCode, and how would we define those. Of these the `Workgroup` is part of the connection definition, but do we need to add any other and where? Thanks – adbdkb May 16 '23 at 15:12
  • Those are Athena-specific settings, but your problem is network-related (since it works without the VPN, but doesn't work _with_ the VPN). Just show them these two situations plus the error message and it will be up to them to figure things out. The cause might depend on whether the VPN is run through AWS, but only they will know the details. Let us know how you go! – John Rotenstein May 16 '23 at 22:09
  • @JohnRotenstein - Thank you. My confusion is - it works from awscli script on the same machine even when I am connected to VPN, but not from VSCode. So, trying to understand why that is so. That way I can give me the details correctly – adbdkb May 16 '23 at 23:17
  • No idea! If it is working via the script from your computer, then the problem is _NOT_ networking-related. It's now the combination of your VPN and the VSCode extension you're running. That's going to be a hard one to solve. I can't offer any advice for how to debug that situation. – John Rotenstein May 17 '23 at 00:29
  • @JohnRotenstein - Worked with one of the AWS experts in the company. He also tried on his machine. This is what he said - `it is definetely a proxy issue though, you wont be able to connect to the athena endpoint, without a hardcoded proxy in VScode, and that would explain all 3 scenarios: 1 - off network (no proxy needed) works, 2 - on-network terminal (proxy configured) works, 3 - on-network vscode, cannot conenct to the Athena endpoint`. Also, `Took a brief look at the VSCode plugin code, it doesnt look like its taking in the proxy settings from VSCode, not much we can do at that point.` – adbdkb May 18 '23 at 23:41
  • 1
    I have opened a GitHub issue on SQLTools extension. Hope there is a fix from the extension team – adbdkb May 18 '23 at 23:41

0 Answers0