array(5) { ["headers"]=> array(5) { ["Server"]=> string(21) "nginx/1.18.0 (Ubuntu)" ["Date"]=> string(29) "Sun, 14 Dec 2025 23:34:58 GMT" ["Content-Type"]=> string(24) "text/html; charset=UTF-8" ["Transfer-Encoding"]=> string(7) "chunked" ["Connection"]=> string(10) "keep-alive" } ["httpStatusCode"]=> int(500) ["contentType"]=> string(24) "text/html; charset=UTF-8" ["body"]=> string(16411) " CDbException

CDbException

CDbConnection failed to open the DB connection: SQLSTATE[08004] [1040] Too many connections

/var/www/html/anyway2fun/srcAppServer/protected/components/AppServerWebApplication.php(34)

22     /**
23      * Doing some application-level initialization here.
24      */
25     public function init() {
26         /**
27          * [Dowlin 20130325]
28          * We have to set the following db PDO attributes explicitly when we
29          * migrate from PostgreSQL to MySQL. This is because MySQL PDO driver
30          * always return numeric data as strings unless we enforce the results
31          * to match database defined datatypes.
32          * @see: http://www.yiiframework.com/forum/index.php/topic/3934-cdbcommand-queryall-problem/
33          */
34         $this->db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
35         $this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
36         $this->dbRun->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
37         $this->dbRun->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
38 
39         $this->chiefCloudRestClient->initialize(array("server" => $this->chiefCloudServerLoadBalancer->getServerAddress()));
40         $this->chiefCloudRestClient->option(CURLOPT_FORBID_REUSE, false);
41         $this->chiefCloudRestClient->option(CURLOPT_FRESH_CONNECT, false);
42         $this->chiefCloudRestClient->option(CURLOPT_CONNECTTIMEOUT, 10);
43         $this->chiefCloudRestClient->option(CURLOPT_TIMEOUT, 120);
44     }
45 
46     /**

Stack Trace

#4
+
 /var/www/html/anyway2fun/srcAppServer/protected/components/AppServerWebApplication.php(34): CModule->__get("db")
29          * migrate from PostgreSQL to MySQL. This is because MySQL PDO driver
30          * always return numeric data as strings unless we enforce the results
31          * to match database defined datatypes.
32          * @see: http://www.yiiframework.com/forum/index.php/topic/3934-cdbcommand-queryall-problem/
33          */
34         $this->db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
35         $this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
36         $this->dbRun->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
37         $this->dbRun->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
38 
39         $this->chiefCloudRestClient->initialize(array("server" => $this->chiefCloudServerLoadBalancer->getServerAddress()));
#6
+
 /var/www/html/anyway2fun/srcAppServer/protected/components/AppServerWebApplication.php(19): CApplication->__construct(array("name" => "Anyway 2 Fun!!! - Application Server", "preload" => array("log"), "import" => array("application.models.*", "application.models.runwatch.*", "application.components.*", "application.interface.*", ...), "defaultController" => "app", ...))
14     /**
15      * Constructor.
16      * @param mixed $config application configuration.
17      */
18     public function __construct($config) {
19         parent::__construct($config);
20     }
21 
22     /**
23      * Doing some application-level initialization here.
24      */
#8
+
 /var/www/html/anyway2fun/srcAppServer/index-dev.php(22): YiiBase::createApplication("AppServerWebApplication", "/var/www/html/anyway2fun/srcAppServer/protected/config/main.php")
17 require_once(dirname(__FILE__).'/protected/config/globalconst.php');
18 
19 // Use Application Specific CWebApplication class
20 $appServerWebAppFile = dirname(__FILE__) . "/protected/components/AppServerWebApplication.php";
21 require_once($appServerWebAppFile);
22 Yii::createApplication("AppServerWebApplication", $config)->run();
2025-12-14 23:34:58 nginx/1.18.0 Yii Framework/1.1.19
" ["lastUrl"]=> string(70) "http://localhost:56789/anyway2fun/srcAppServer/profiles/402341/summary" }