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

SSH task hangs then fails #17

Closed
0bserver07 opened this issue Jul 20, 2021 · 12 comments
Closed

SSH task hangs then fails #17

0bserver07 opened this issue Jul 20, 2021 · 12 comments

Comments

@0bserver07
Copy link

At first, I checked the EC2 / security group, it is good to go, 22 is open to local IP.

Here is the error log:

TASK [Wait 300 seconds for port 22 to become open] ********************************************************************

fatal: [forem]: FAILED! => changed=false
  elapsed: 300
  invocation:
    module_args:
      active_connection_states:
      - ESTABLISHED
      - FIN_WAIT1
      - FIN_WAIT2
      - SYN_RECV
      - SYN_SENT
      - TIME_WAIT
      connect_timeout: 5
      delay: 20
      exclude_hosts: null
      host: XX.XX.XX.XX
      msg: null
      path: null
      port: 22
      search_regex: null
      sleep: 1
      state: started
      timeout: 300
  msg: Timeout when waiting for  XX.XX.XX.XX

PLAY RECAP ************************************************************************************************************
forem                      : ok=41   changed=17   unreachable=0    failed=1    skipped=1    rescued=0    ignored=0

I'm not sure what's the error here.

@jdoss
Copy link
Contributor

jdoss commented Jul 20, 2021

Can you manually SSH into the server? https://github.com/forem/selfhost#ssh-examples

If this fails then it sounds like the EC2 never launched correctly. If you can SSH into it, try rerunning the playbook.

@0bserver07
Copy link
Author

thanks for getting back to me @jdoss , I can't SSH into the machine manually, since I'm not certain where the ".pem" file go while deploying the instance?

@jdoss
Copy link
Contributor

jdoss commented Jul 20, 2021

See Step 7 of the Quickstart https://github.com/forem/selfhost#quick-start. If you followed this guide it is located ${HOME}/.ssh/forem.pub

@0bserver07
Copy link
Author

0bserver07 commented Jul 20, 2021

Thanks, I think the github link doesn't explain what needs to happen for this use-case:

Here is an outline of steps I'm taking:

cd ~/.ssh/
  1. Generate the key with $ ssh-keygen -t rsa -b 2048 -v
ssh-keygen -t rsa -b 2048 -v
  1. when asked to enter file in which to save the key, type forem, confirm by Enter.

  2. then wee will get two files generated, one will be forem and one will be forem.pub.

  3. Then rename the forem to forem.pem, so you will have two files, forem.pub and forem.pem

  • I check the port for 22 is open.
  • Still hangs and connection refused.

I terminate the server and redo every to avoid config overlaps as well.

@cmgorton
Copy link
Contributor

Hey @0bserver07 if you are using AWS as your cloud provider you can try using this Forem AWS Setup guide. There is a section that goes in to more detail on how to ssh into your server.

If you have any more questions regarding getting set up or errors you are seeing please feel free to post on forem.dev with the #help and #selfhost tags. Someone on the team will be able to help you over there! Thanks 😄

@maslof
Copy link

maslof commented Aug 2, 2021

How were you able to solve this problem?

@maslof
Copy link

maslof commented Aug 2, 2021

I have same problem if I change region us-east-1 -> eu-west-1

@cmgorton
Copy link
Contributor

cmgorton commented Aug 4, 2021

I have same problem if I change region us-east-1 -> eu-west-1

Hey @MaslovAnton just to confirm are you having trouble with SSH (step 11 in the quick start) and the problem is occurring only when you change your region to us-east-1 -> eu-west-1?

@maslof
Copy link

maslof commented Aug 6, 2021

I have problem in this if i change fcos_aws_region: us-east-1 -> eu-west-1.
Error on task
TASK [Wait 300 seconds for port 22 to become open]

And i can't connect by ssh and generated rsa key

In default region (us-east-1) it was OK.

@0bserver07
Copy link
Author

@MaslovAnton for now it worked when I switched to us-east-1, there might be something hard-coded, but to make it work you can just do that change.

I tried, -west-, but that's what led to the ssh error.

@maslof
Copy link

maslof commented Aug 11, 2021

Thanks. Same error in -west- region

@cmgorton
Copy link
Contributor

I am going to walk through setting up my Forem on AWS again today and I will change the region. I'll let you know what steps I take and if I get the same errors you all are seeing @0bserver07 and @MaslovAnton . If I do I'll ping our systems team to get more info on why the error is occurring.

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

4 participants