cunningham-lab / neurocaas_contrib

Repo to help develop on AMIs associated with NeuroCAAS
GNU General Public License v3.0
2 stars 4 forks source link

Connection Timed Out message while trying to ssh into the instance #34

Closed anjaliagarwal8 closed 2 years ago

anjaliagarwal8 commented 2 years ago

Hey, I was trying to ssh into the instance I launched but it gave the "Connection timed out" message. These are the contents of the blueprint,

{ "PipelineName": "pca", "REGION": "us-east-1", "STAGE": "webdev", "Lambda": { "CodeUri": "../../protocols", "Handler": "submit_start.handler_develop", "Launch": true, "LambdaConfig": { "AMI": "ami-061f98a1f90c0d6fd", "INSTANCE_TYPE": "t2.micro", "REGION": "us-east-1", "SECURITY_GROUPS": "testsgstack-SecurityGroupDeploy-C2Q3PGSF77Y3", "IAM_ROLE": "SSMRole", "KEY_NAME": "testkeystack-custom-dev-key-pair", "WORKING_DIRECTORY": "~/bin", "COMMAND": "cd /home/ubuntu; neurocaas_remote/run_main.sh \"{}\" \"{}\" \"{}\" \"{}\"; . neurocaas_remote/ncap_utils/workflow.sh; cleanup" } }, "UXData": { "Affiliates": [ { "AffiliateName": "traviscipermagroup", "UserNames": [ "cipermauser1", "cipermauser2" ], "UserInput": true, "ContactEmail": "NOTE: KEEP THIS AFFILIATE TO ENABLE EASY TESTING" } ] }, "localenv": "/home/ec2-user/neurocaas_project/neurocaas/ncap_iac/ncap_blueprints/pcademo" }

anjaliagarwal8 commented 2 years ago

Also when I used the command start-session, it gave the key error for Security_Groups which is not there in a blueprint while initializing so I manually added that (from other sample blueprints). This still did not resolve the issue so I used the develop-remote command and then I was able to start the session and launch the instance. But I could not ssh into it.

cellistigs commented 2 years ago

Hi Anjali! Thanks for that info, that’s all very clear. Can you try updating your blueprint with this security group instead:

testsgstack-SecurityGroupDev-1NQJIDBJG16KK

This group should have the right ssh permissions for you to log in- the other one is for when users are deploying analyses to be run automatically. You may have to restart your session (neurocaas_contrib remote end-session and neurocaas_contrib remote start session) to get the blueprint to update.

I’m working on a fix to correctly set the default security group automatically if it’s not found- if updating the security group solves the problems you’re seeing I will close this issue when the fix is ready.

anjaliagarwal8 commented 2 years ago

Thank you so much @cellistigs I am able to ssh into it now after updating the security group.

cellistigs commented 2 years ago

Awesome, glad to hear!