PDOException (2002)
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql2 failed: Temporary failure in name resolution
Previous exceptions
  • PDO::__construct(): php_network_getaddresses: getaddrinfo for mysql2 failed: Temporary failure in name resolution (0)
PDOException thrown with message "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql2 failed: Temporary failure in name resolution" Stacktrace: #5 PDOException in /var/www/html/di.php:82 #4 PDO:__construct in /var/www/html/di.php:82 #3 {closure} in /var/www/html/vendor/pimple/pimple/src/Pimple/Container.php:122 #2 Pimple\Container:offsetGet in /var/www/html/di.php:218 #1 {closure} in /var/www/html/vendor/pimple/pimple/src/Pimple/Container.php:122 #0 Pimple\Container:offsetGet in /var/www/html/index.php:51
Stack frames (6)
5
PDOException
/di.php:82
4
PDO __construct
/di.php:82
3
{closure}
/vendor/pimple/pimple/src/Pimple/Container.php:122
2
Pimple\Container offsetGet
/di.php:218
1
{closure}
/vendor/pimple/pimple/src/Pimple/Container.php:122
0
Pimple\Container offsetGet
/index.php:51
/var/www/html/di.php
 * @return \Box_Crypt
 */
$di['crypt'] = function () use ($di) {
    $crypt = new Box_Crypt();
    $crypt->setDi($di);
 
    return $crypt;
};
 
/*
 * Creates a new PDO object for database connections
 *
 * @param void
 *
 * @return PDO The PDO object used for database connections
 */
$di['pdo'] = function () {
    $config = Config::getProperty('db');
 
    $pdo = new PDO(
        $config['type'] . ':host=' . $config['host'] . ';port=' . $config['port'] . ';dbname=' . $config['name'],
        $config['user'],
        $config['password'],
        [
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        ]
    );
 
    if (isset($config['debug']) && $config['debug']) {
        $pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['Box_DbLoggedPDOStatement']);
    }
 
    if ($config['type'] === 'mysql') {
        $pdo->exec('SET NAMES "utf8"');
        $pdo->exec('SET CHARACTER SET utf8');
        $pdo->exec('SET CHARACTER_SET_CONNECTION = utf8');
        $pdo->exec('SET character_set_results = utf8');
        $pdo->exec('SET character_set_server = utf8');
Arguments
  1. "PDO::__construct(): php_network_getaddresses: getaddrinfo for mysql2 failed: Temporary failure in name resolution"
    
Exception message: PDO::__construct(): php_network_getaddresses: getaddrinfo for mysql2 failed: Temporary failure in name resolution
/var/www/html/di.php
 * @return \Box_Crypt
 */
$di['crypt'] = function () use ($di) {
    $crypt = new Box_Crypt();
    $crypt->setDi($di);
 
    return $crypt;
};
 
/*
 * Creates a new PDO object for database connections
 *
 * @param void
 *
 * @return PDO The PDO object used for database connections
 */
$di['pdo'] = function () {
    $config = Config::getProperty('db');
 
    $pdo = new PDO(
        $config['type'] . ':host=' . $config['host'] . ';port=' . $config['port'] . ';dbname=' . $config['name'],
        $config['user'],
        $config['password'],
        [
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        ]
    );
 
    if (isset($config['debug']) && $config['debug']) {
        $pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['Box_DbLoggedPDOStatement']);
    }
 
    if ($config['type'] === 'mysql') {
        $pdo->exec('SET NAMES "utf8"');
        $pdo->exec('SET CHARACTER SET utf8');
        $pdo->exec('SET CHARACTER_SET_CONNECTION = utf8');
        $pdo->exec('SET character_set_results = utf8');
        $pdo->exec('SET character_set_server = utf8');
Arguments
  1. "mysql:host=mysql2;port=3306;dbname=bix"
    
  2. "xsbil"
    
  3. SensitiveParameterValue {#128}
    
  4. array:3 [
      1000 => true
      3 => 2
      19 => 2
    ]
    
/var/www/html/vendor/pimple/pimple/src/Pimple/Container.php
    {
        if (!isset($this->keys[$id])) {
            throw new UnknownIdentifierException($id);
        }
 
        if (
            isset($this->raw[$id])
            || !\is_object($this->values[$id])
            || isset($this->protected[$this->values[$id]])
            || !\method_exists($this->values[$id], '__invoke')
        ) {
            return $this->values[$id];
        }
 
        if (isset($this->factories[$this->values[$id]])) {
            return $this->values[$id]($this);
        }
 
        $raw = $this->values[$id];
        $val = $this->values[$id] = $raw($this);
        $this->raw[$id] = $raw;
 
        $this->frozen[$id] = true;
 
        return $val;
    }
 
    /**
     * Checks if a parameter or an object is set.
     *
     * @param string $id The unique identifier for the parameter or object
     *
     * @return bool
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($id)
    {
        return isset($this->keys[$id]);
    }
 
Arguments
  1. Pimple\Container {#16}
    
/var/www/html/di.php
 * @param void
 *
 * @return \Box_EventManager
 */
$di['events_manager'] = function () use ($di) {
    $service = new Box_EventManager();
    $service->setDi($di);
 
    return $service;
};
 
/*
 * Creates a new session, applying specified security rules depending on the config.php settings.
 *
 * @param void
 *
 * @return \FOSSBilling\Session
 */
$di['session'] = function () use ($di) {
    $handler = new PdoSessionHandler($di['pdo']);
    $session = new FOSSBilling\Session($handler);
    $session->setDi($di);
    $session->setupSession();
 
    return $session;
};
 
/*
 * Creates a new request object based on the current request.
 *
 * @param void
 *
 * @link https://symfony.com/doc/current/components/http_foundation.html
 *
 * @return Symfony\Component\HttpFoundation\Request
 */
$di['request'] = fn (): Request => Request::createFromGlobals();
 
/*
 * @param void
Arguments
  1. "pdo"
    
/var/www/html/vendor/pimple/pimple/src/Pimple/Container.php
    {
        if (!isset($this->keys[$id])) {
            throw new UnknownIdentifierException($id);
        }
 
        if (
            isset($this->raw[$id])
            || !\is_object($this->values[$id])
            || isset($this->protected[$this->values[$id]])
            || !\method_exists($this->values[$id], '__invoke')
        ) {
            return $this->values[$id];
        }
 
        if (isset($this->factories[$this->values[$id]])) {
            return $this->values[$id]($this);
        }
 
        $raw = $this->values[$id];
        $val = $this->values[$id] = $raw($this);
        $this->raw[$id] = $raw;
 
        $this->frozen[$id] = true;
 
        return $val;
    }
 
    /**
     * Checks if a parameter or an object is set.
     *
     * @param string $id The unique identifier for the parameter or object
     *
     * @return bool
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($id)
    {
        return isset($this->keys[$id]);
    }
 
Arguments
  1. Pimple\Container {#16}
    
/var/www/html/index.php
// Rewrite for custom pages
if (str_starts_with($url, '/page/')) {
    $url = substr_replace($url, '/custompages/', 0, 6);
}
 
// Set the final URL
$_GET['_url'] = $url;
$http_err_code = $_GET['_errcode'] ?? null;
 
$debugBar['time']->startMeasure('session_start', 'Starting / restoring the session');
 
/*
 * Workaround: Session IDs get reset when using PGs like PayPal because of the `samesite=strict` cookie attribute, resulting in the client getting logged out.
 * Internally the return and cancel URLs get a restore_session GET parameter attached to them with the proper session ID to restore, so we do so here.
 */
if (!empty($_GET['restore_session'])) {
    session_id($_GET['restore_session']);
}
 
$di['session'];
$debugBar['time']->stopMeasure('session_start');
 
if (strncasecmp($url, ADMIN_PREFIX, strlen(ADMIN_PREFIX)) === 0) {
    define('ADMIN_AREA', true);
    $appUrl = str_replace(ADMIN_PREFIX, '', preg_replace('/\?.+/', '', $url));
    $app = new Box_AppAdmin([], $debugBar);
} else {
    define('ADMIN_AREA', false);
    $appUrl = $url;
    $app = new Box_AppClient([], $debugBar);
}
 
$app->setUrl($appUrl);
$app->setDi($di);
 
$debugBar['time']->startMeasure('translate', 'Setting up translations');
$di['translate']();
$debugBar['time']->stopMeasure('translate');
 
// If HTTP error code has been passed, handle it.
Arguments
  1. "session"
    

Environment & details:

Key Value
PHP Version
"8.3.30"
Error code
2002
Instance ID
"40a31581-3a88-405a-b626-cce30fb53633"
Key Value
_url
"/sitemap.xml"
empty
empty
empty
empty
Key Value
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
HTTP_AUTHORIZATION
""
HTTP_HOST
"www.billing.denge.website"
HTTP_X_REAL_IP
"216.73.217.100"
HTTP_X_FORWARDED_FOR
"216.73.217.100"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_FORWARDED_HOST
"www.billing.denge.website"
HTTP_X_FORWARDED_PORT
"443"
HTTP_CONNECTION
"upgrade"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.66 (Debian) Server at www.billing.denge.website Port 80</address>\n"
SERVER_SOFTWARE
"Apache/2.4.66 (Debian)"
SERVER_NAME
"www.billing.denge.website"
SERVER_ADDR
"172.18.0.5"
SERVER_PORT
"80"
REMOTE_ADDR
"172.18.0.1"
DOCUMENT_ROOT
"/var/www/html"
REQUEST_SCHEME
"http"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html"
SERVER_ADMIN
"webmaster@localhost"
SCRIPT_FILENAME
"/var/www/html/index.php"
REMOTE_PORT
"45474"
REDIRECT_URL
"/sitemap.xml"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/sitemap.xml"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1789651643.3492
REQUEST_TIME
1789651643
argv
[]
argc
0
Key Value
DYNADOT_API_KEY
"7H6W7q8cL6q7P707u75e8j7V8S06j7U9C8Y6a8t56BE"
HOSTNAME
"55f9042507aa"
PHP_VERSION
"8.3.30"
APACHE_CONFDIR
"/etc/apache2"
DYNADOT_API_URL
"https://api.dynadot.com/api3.json?key=7H6W7q8cL6q7P707u75e8j7V8S06j7U9C8Y6a8t56BE&command=tld_price&currency=USD"
PHP_INI_DIR
"/usr/local/etc/php"
GPG_KEYS
"1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA"
PHP_LDFLAGS
"-Wl,-O1 -pie"
PWD
"/var/www/html"
TZ
"Europe/London"
DB_USER
"xsbil"
APACHE_LOG_DIR
"/var/log/apache2"
LANG
"C"
PHP_SHA256
"67f084d36852daab6809561a7c8023d130ca07fc6af8fb040684dd1414934d48"
TRUSTED_PROXIES
"127.0.0.1"
APACHE_PID_FILE
"/var/run/apache2/apache2.pid"
PHPIZE_DEPS
"autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
DB_HOST
"mysql2"
PHP_URL
"https://www.php.net/distributions/php-8.3.30.tar.xz"
APACHE_RUN_GROUP
"www-data"
APACHE_LOCK_DIR
"/var/lock/apache2"
SHLVL
"0"
PHP_CFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
DB_NAME
"bix"
APACHE_RUN_DIR
"/var/run/apache2"
APACHE_ENVVARS
"/etc/apache2/envvars"
APACHE_RUN_USER
"www-data"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
DB_PASS
"wwq21tgf#]/22"
PHP_ASC_URL
"https://www.php.net/distributions/php-8.3.30.tar.xz.asc"
PHP_CPPFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
0. Whoops\Handler\PrettyPageHandler