Site is down, can't be reached

0

Hello,

I have a very small site in WP in Lightdsail. I got a "en error establishing a database connection" first then I reboot the instance and now the site cannot be reached. The instance is supposed to be "running". I have snapshots too.

I need help getting this site back up and running.

Thank you,

asked a month ago38 views
2 Answers
0

I understand you're experiencing issues with your WordPress site on Amazon Lightsail. Let's go through some steps to diagnose and potentially resolve the problem:

  1. First, confirm that your Lightsail instance is indeed running. Even though it's supposed to be, it's worth double-checking in the Lightsail console.

  2. The initial "error establishing a database connection" message suggests there might be an issue with your MySQL database. This could be because the database service isn't running or there's a configuration problem.

  3. To check and potentially restart the database service, you'll need to SSH into your Lightsail instance. Once connected, try running the following command:

sudo /opt/bitnami/ctlscript.sh restart mysql

This should attempt to restart the MySQL service.

  1. If the above doesn't work, check the status of all services with:

sudo /opt/bitnami/ctlscript.sh status

This will show you which services are running or stopped.

  1. If you're still having trouble, it's possible that your instance is running out of resources (CPU, memory, or disk space). You can check resource usage while connected via SSH.

  2. Since you mentioned having snapshots, if the above steps don't resolve the issue, you could consider creating a new instance from your most recent snapshot. This might help if there's been some corruption in your current instance.

  3. Lastly, verify that your domain's DNS settings are correctly pointing to your Lightsail instance's IP address, as sometimes DNS issues can cause sites to appear unreachable.

If these steps don't resolve your issue, you may need to dive deeper into log files or consider reaching out to AWS support for more specialized assistance.
Sources
Error establishing a database connection - Lightsail and Wordpress | AWS re:Post
My website is showing database connection error | AWS re:Post
Need Help in getting instance working again !! | AWS re:Post
Database server is down in my lightsail instance | AWS re:Post
Website is down | AWS re:Post

profile picture
answered a month ago
  • Running sudo /opt/bitnami/ctlscript.sh restart mysql it returns "Cannot find check with id mysql"

    sudo /opt/bitnami/ctlscript.sh status it returns "Cannot find any running daemon to contact. If it is running, make sure you are pointing to the right pid file (/var/run/gonit.pid)"

    How can I check if I am running out of resources? The graphs show very little usage, which makes me think I don't need to upgrade.

    The DNS looks correct. Pointing at the correct IP in @ and www

    UPDATE I created an new instance from the oldest snapshot I could find, Using the new IP of the new instance I cannot reached the site either. If I run the command udo /opt/bitnami/ctlscript.sh status it returns "Cannot find any running daemon to contact. If it is running, make sure you are pointing to the right pid file (/var/run/gonit.pid)" I get the same result.

    Help!

0

Hello,

I'm sorry to hear about the issues you are facing with your WordPress application. If possible, please provide additional information about any modifications you made to the application before it began having problems connecting to the database.

You may also find this previous re:Post helpful: https://repost.aws/questions/QU9D0l41-hSdaKSmw07qwL1w/website-is-down-after-lightsail-instance-reboot

The most relevant section is: You tried to check the status of your service using the sudo /opt/bitnami/ctlscript.sh status command and got the following message:

Cannot find any running daemon to contact. If it is running, make sure you are pointing to the right pid file (/var/run/gonit.pid)

The output of the command "sudo /opt/bitnami/ctlscript.sh status" indicates that it was unable to find any running daemon to communicate with. A daemon is a background process that runs continuously on a system. In this case, it appears that the command is trying to check the status of a daemon related to Bitnami services.

The error message specifically mentions the absence of a pid file or an incorrect path to the pid file. A pid file, short for process identifier file, is a file that typically contains the process ID (PID) of a running daemon. It helps other processes or scripts identify and interact with the running daemon.

The command is looking for the pid file at the location "/var/run/gonit.pid" but is unable to find it. This could be due to one of the following reasons:

The daemon associated with the Bitnami services is not running. The pid file is located in a different directory. The pid file is named differently. To resolve the issue, you can try the following steps:

Restart the server or the specific daemon associated with Bitnami services using the appropriate command, such as "sudo /opt/bitnami/ctlscript.sh restart" or "sudo systemctl restart bitnami". If the issue persists, check if the pid file is located in a different directory. You can search for the correct location or consult the Bitnami documentation for the expected location of the pid file. Verify if the pid file has a different name than "gonit.pid". You can look for files with a ".pid" extension in the expected directory or refer to the documentation for the specific Bitnami installation. By ensuring that the daemon is running and the correct pid file is located in the expected directory, you should be able to resolve the error and successfully check the status of the Bitnami services using the command "sudo /opt/bitnami/ctlscript.sh status".

For additional troubleshooting and reference, you can consult the following AWS documentation: Popular Articles – All docs | Lightsail Documentation

Thank you.

AWS
MODERATOR
answered a month ago

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