4

I was able to connect to the Notebook for my Database cluster earlier but now I am getting error when I do %status.

I have created cluster and notebook with new VPC connection and also added the roles. I have also verified that the VPC connection is same for both notebook and DB Cluster

Please find the error message below.(I have removed the host name)

{'error': ConnectionError(MaxRetryError("HTTPSConnectionPool(host='mic.us-east-1.neptune.amazonaws.com', port=8182): Max retries exceeded with url: /status/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff16b264080>: Failed to establish a new connection: [Errno 110] Connection timed out',))",),)}

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Meghana Kb
  • 43
  • 5
  • Hi there - the error message above seems to perhaps have got messed up when you posted it? Could you please clarify the exact error message you are seeing? – Kelvin Lawrence Apr 20 '21 at 17:05
  • Also worth checking that your `%graph_notebook_config` looks OK. Are the SSL and IAM parameters and endpoint name set appropriately? Also (if IAM is not enabled) perhaps try using a simple `curl` from a cell and see if that works. Along the lines of `!curl endpoint:8182/status` – Kelvin Lawrence Apr 20 '21 at 17:14
  • @KelvinLawrence Thank you for the reply. I am getting the same error message, I just removed my host name. I did check my %graph_notebook_config. everthing looks fine. Not sure why I am getting the issue – Meghana Kb Apr 20 '21 at 18:28
  • @KelvinLawrence Thanks for pointing out. I have updated the error – Meghana Kb Apr 20 '21 at 19:04

2 Answers2

3

That error message typically only occurs when there's something blocking network connectivity between the notebook instance and your Neptune cluster.

  1. Make sure the security group for your Neptune cluster is allowing traffic from your notebook instance.

  2. Validate that DNS is resolving to your Neptune cluster. From a %%bash cell or from a Jupyter terminal window:

    nslookup <cluster_endpoint>

  3. Validate that you can connect to your Neptune cluster's status endpoint. From a %%bash cell or Jupyter terminal window:

    curl -s https://<cluster_endpoint>:8182/status

UPDATE:

It also appears that you're attempting to connect using 'mic.us-east-1.neptune.amazonaws.com'. That's not a valid Neptune endpoint. Neptune endpoints are in the form of:

<cluster-name>.cluster-abcdefghijkl.<region>.neptune.amazonaws.com

(where abcdefghijkl is some random 12 letter string)

Taylor Riggan
  • 1,963
  • 6
  • 12
  • I'm getting the same error, and the endpoint is proper. 2) Output of nslookup : `Server: 172.31.0.2 Address: 172.31.0.2#53 Non-authoritative answer: xxx-database-x.cluster-cxxxxxxxxxxj.us-east-2.neptune.amazonaws.com canonical name = xxx-database-x-instance-1.cxxxxxxxxxxj.us-east-2.neptune.amazonaws.com. Name: xxx-database-x-instance-1.cxxxxxxxxxxj.us-east-2.neptune.amazonaws.com Address: 172.31.27.1` 3) No output for the curl How can I proceed – purpin Mar 08 '22 at 11:22
0

By looking at the message:

{'error': ConnectionError(MaxRetryError("HTTPSConnectionPool(host='mic.us-east-1.neptune.amazonaws.com', port=8182):

my thinking is that the call from the notebook to the db is unable to connect at Port 8182.

One of the reasons could be that the security group attached with the database might not have an inbound policy that allows inbound requests to 8182 port.

You could try the following:

  1. Find the security group associated with your database. This could be done as follows:
    a. Open the neptune database in the AWS console.
    b. Choose the correct instance and then select Connectivity & security tab.
    c. This would allow you to see the attached security group. Click and open it.
  2. Once the security group is opened, look at the tab called Inbound Rules
  3. Within this, see if a Security group rule exists that has 8182 in the port range.
  4. If not, do Edit Inbound Rules > Add rule and then add a rule with port number 8182 and protocol type Custom TCP. Give any description.

Try using the %status in the notebook once again and check if it works.

Thanks!!