How to fix Blesta error ‘getaddrinfo failed: No such host is known’

How to fix Blesta error ‘getaddrinfo failed: No such host is known’

In our role as Outsourced hosting support specialists for web hosts, we manage web servers with various control panels and billing portals such as WHMCS, Blesta, HostBill, etc.

Blesta is a customer management, billing, and support system for web hosting providers, which is being used by many web hosts nowadays.
See how we help web hosting companies

While installing Blesta software in the server, if the installation process do not get completed properly, you may end up seeing an error like this:

An error occurred while attempting to connect to the database
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.

Today, we’ll see what causes this error in Blesta and how to resolve it and get your Blesta portal working fine.

What causes Blesta error ‘getaddrinfo failed: No such host is known’

Blesta is a database-driven software and the details of this database are updated in the config file during installation. The Blesta config file is located at ‘/config/blesta.php’.

This configuration file would have a format like:

Configure::set("Blesta.database_info", array(
	'driver' => "mysql",
	'host'	=> "localhost",
	//'port' => "8889",
	'database' => "MYDATABASE",
	'user' => "MYUSERNAME",
	'pass' => "MYPASSWORD",
	'persistent' => false,
	'charset_query' => "SET NAMES 'utf8'",
	'options' => array()
	)
);

Any issue related to the database – from settings to connectivity – can affect the normal functioning of the Blesta software and can end up showing an error.

The major reasons for the error ‘SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known’ are:

  1. MySQL server not working fine – If the MySQL server is not working fine in the server, then Blesta would be unable to connect to the database and will give the error. There can be several reasons why MySQL stops working, such as permission issues or disk space errors or abusive processes, and requires expert investigation to ensure the service is working fine.
  2. Blesta unable to connect to MySQL – Blesta has its MySQL database, username and password, using which it connects. If this user privileges are not enough, it can cause connectivity to fail and give errors
  3. Config file of Blesta is not properly updated with the credentials – MySQL uses the details provided in the config file to establish the database connection for Blesta. If any of the database credentials given in the config file are wrong, it can lead to errors.
  4. Permissions issues with the config folder – If the config file does not have adequate permissions for MySQL to access it and retrieve the credentials, it can cause database errors.
  5. Blesta database tables are corrupt or incomplete – If any of the database tables are incomplete or corrupt, yet again, the DB errors would throw up in Blesta.

You don’t have to lose your sleep to keep your customers happy. Our friendly Hosting Support Specialists are online 24/7/365 to help your customers. ]

How to fix Blesta error ‘getaddrinfo failed: No such host is known’

To resolve the Blesta error ‘getaddrinfo failed: No such host is known’, we perform the following tasks:

  1. Check the Blesta configuration file and confirm that the credentials given in it are correct.
  2. Ensure that the config file has adequate read permissions for MySQL.
  3. Validate the database credentials in the config file and confirm that the connection is being established fine.
  4. In case of database connectivity errors, check for the privileges and grant adequate privileges.
  5. Identify corrupt and incomplete database tables and repair or restore them as required.
  6. If MySQL server is not functioning right, we investigate the reason for the error and fix it based on the issue identified.

Once the MySQL issues are resolved and the configuration details are updated correctly, Blesta would start working fine.

[ Use your time to build your business. We’ll take care of your servers. Hire Our Hosting Support Specialists and boost your server performance. ]

At Bobcares, our 24/7 server specialists constantly monitor all the services in the server and proactively audit the server for any errors or corruption in them.

With our systematic debugging approach for service or other software errors, we have been able to provide an exciting support experience to the customers.

If you would like to know how to avoid downtime for your customers due to errors or other service failures, we would be happy to talk to you.

 


BOOST YOUR HOSTING BUSINESS!

Never again lose customers to poor service! Sign Up once. Enjoy Peace Of Mind For Ever!

CLICK HERE FOR WORLD-CLASS SUPPORT SERVICES

Submit a Comment

Your email address will not be published. Required fields are marked *

Bobcares
Bobcares is a server management company that helps businesses deliver uninterrupted and secure online services. Our engineers manage close to 51,500 servers that include virtualized servers, cloud infrastructure, physical server clusters, and more.
MORE ABOUT BOBCARES