Lightsail instance "refused to connect"

0

Hi, Navigating to my website www.*****smartmeters.com shows "*****smartmeters refused to connect"

I found this article, and tried the suggestions which did not work. Below is a screenshot after running the commands... no idea what that UDP stuff is, but I have no port 80 or port 443. Any ideas? Thank you in advance.

https://repost.aws/questions/QU_ZI0hOomQUChOwEhAvSSFw/my-lightsail-instance-website-is-not-working

Enter image description here

EDIT: FYI, port 22, 80, 443 etc are all setup in the firewall on aws lightsail networking tab.

Tried delete hostkeys and got this message saying the amazon region was unavailable?

Enter image description here

SunnyK
asked 10 days ago143 views
4 Answers
0

Tried delete hostkeys and got this message saying the amazon region was unavailable?

eu-west-1a isn't a region, it's an availability zone within the eu-west1 region.

profile picture
EXPERT
Steve_M
answered 9 days ago
  • Thanks for the pointer. Here is the CLI's response.

    aws lightsail delete-known-host-keys --region eu-west-1 --insta nce-name ie-capturesmartmeters

    An error occurred (AccessDeniedException) when calling the DeleteKnownHostKeys operation: User: arn:aws:sts::241458493594:assumed-role/AmazonLightsailInstanceRole/i-0123ffc21bdcd99 33 is not authorized to perform: lightsail:DeleteKnownHostKeys on resource: arn:aws:lights ail:eu-west-1:241458493594:* because no identity-based policy allows the lightsail:DeleteK nownHostKeys action

  • Why are you trying to delete host keys though? That should NOT be related to your website loading issue nor be necessary. . Separately, the AccessDeniedException is because the AWS command being run on Lightsail instance is using the default instance profile which does not have permissions for that action. You can either setup your AWS credentials on the instance or easier is to use AWS CloudShell from Lightsail console. Please refer this doc for the same.

  • Amazon Q told me to do that. Thanks for your help.

  • Sorry about the misleading information from Amazon Q.

0

=>Check Lightsail Firewall Settings:inbound traffic on ports 80 and 443 =>Verify Instance Status: Make sure that your Lightsail instance is running and in a healthy state. You can check the instance status in the Lightsail console.

=>Restart Instance: Try restarting your Lightsail instance to see if that resolves the issue. Sometimes, a simple restart can fix connectivity issues.

answered 9 days ago
  • I restarted a few times with no progress.

  • I can see your website https://www.capturesmartmeters.com/ loading in my browser successfully. Is the issue resolved at your end too?

  • It was working because I created a new instance and attached the static IP to it.

0

Here is the solution - Everyone on lightsail seems to encounter this and amazon don't care.

  • Create a snapshot in the same region.
  • Create and instance from that snapshot.
  • Point Static IP to new instance.

Total waste of time...

SunnyK
answered 9 days ago
  • To clarify, you can attach a Static IP to your existing instance - there should be no need to create a new instance for that. . Also, a static IP is recommended for servers hosting websites to avoid having to make DNS record changes such as A record which maps the domain-name such as www.example.com to the server public IP such as 1.2.3.4 because the public IP will otherwise change when the instance is stop-started for any reason.

  • The existing instance had a static IP address. I swapped it to the new instance so I could have my website accessible. The A record has been in place since the domain was registered. Thanks for your help.

0

Switched back to the old instance and just like magic... it works. The ports have now magically appeared.

Enter image description here

SunnyK
answered 9 days ago
  • I might venture that one of the several instance restarts or the Static IP attach-detach helped reset some configuration that had gone awry and helped recover the instance. It may have needed some time to recover after starting back up.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions