^ yii\db\Exception {#208
  +errorInfo: null
  #message: "SQLSTATE[HY000] [2002] Connection refused"
  #code: 2002
  #file: "/var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php"
  #line: 642
  -previous: PDOException {#209
    #message: "SQLSTATE[HY000] [2002] Connection refused"
    #code: 2002
    #file: "/var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php"
    #line: 712
    +errorInfo: null
    trace: {
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:712 {
        yii\db\Connection->createPdoInstance() …
        › 
        ›     return new $pdoClass($dsn, $this->username, $this->password, $this->attributes);}
        arguments: {
          $dsn: "mysql:host=127.0.0.1;port=9306;"
          $username: ""
          $passwd: ""
          $options: null
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:631 {
        yii\db\Connection->open() …
        › 
        › $this->pdo = $this->createPdoInstance();$this->initConnection();
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:1032 {
        yii\db\Connection->getMasterPdo() …
        › {    $this->open();    return $this->pdo;
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:1019 {
        yii\db\Connection->getSlavePdo($fallbackToMaster = true) …
        › if ($db === null) {    return $fallbackToMaster ? $this->getMasterPdo() : null;}
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Command.php:265 {
        yii\sphinx\Command->prepare($forRead = null) …
        › if ($forRead || $forRead === null && $this->db->getSchema()->isReadQuery($sql)) {    $pdo = $this->db->getSlavePdo();} else {
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Command.php:1160 {
        yii\db\Command->queryInternal($method, $fetchMode = null) …
        › 
        › $this->prepare(true);arguments: {
          $forRead: true
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Command.php:407 {
        yii\db\Command->queryAll($fetchMode = null) …
        › {    return $this->queryInternal('fetchAll', $fetchMode);}
        arguments: {
          $method: "fetchAll"
          $fetchMode: null
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:256 {
        yii\sphinx\Schema->findIndexes() …
        › 
        ›     return $this->db->createCommand($sql)->queryAll();}
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:240 {
        yii\sphinx\Schema->initIndexesInfo() …
        › $this->_indexTypes = [];$indexes = $this->findIndexes();foreach ($indexes as $index) {
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:227 {
        yii\sphinx\Schema->getIndexTypes($refresh = false) …
        › if (!isset($this->_indexTypes) || $refresh) {    $this->initIndexesInfo();}
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:114 {
        yii\sphinx\Schema->resolveIndexType($index) …
        › {    $indexTypes = $this->getIndexTypes();    $index->type = array_key_exists($index->name, $indexTypes) ? $indexTypes[$index->name] : 'unknown';
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:90 {
        yii\sphinx\Schema->loadIndexSchema($name) …
        › $this->resolveIndexNames($index, $name);$this->resolveIndexType($index);arguments: {
          $index: yii\sphinx\IndexSchema {#206 …}
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:152 {
        yii\sphinx\Schema->getIndexSchema($name, $refresh = false) …
        › 
        ›     return $this->_indexes[$name] = $this->loadIndexSchema($realName);}
        arguments: {
          $name: "f7_firm_index"
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Connection.php:89 {
        yii\sphinx\Connection->getIndexSchema($name, $refresh = false) …
        › {    return $this->getSchema()->getIndexSchema($name, $refresh);}
        arguments: {
          $name: "f7_firm_index"
          $refresh: false
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:1294 {
        yii\sphinx\QueryBuilder->getIndexSchemas($indexes) …
        › foreach ($indexes as $indexName) {    $index = $this->db->getIndexSchema($indexName);    if ($index !== null) {
        arguments: {
          $name: "f7_firm_index"
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:602 {
        yii\sphinx\QueryBuilder->buildWhere($indexes, $condition, &$params, $match = null) …
        › }$indexSchemas = $this->getIndexSchemas($indexes);$where = $this->buildCondition($indexSchemas, $condition, $params);
        arguments: {
          $indexes: array:1 [ …1]
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:128 {
        yii\sphinx\QueryBuilder->build($query, $params = []) …
        › $this->buildFrom($from, $params),$this->buildWhere($from, $query->where, $params, $query->match),$this->buildGroupBy($query->groupBy, $query->groupLimit),
        arguments: {
          $indexes: array:1 [ …1]
          $condition: array:3 [ …3]
          &$params: array:1 [ …1]
          $match: "Рекламные макеты"
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Query.php:180 {
        yii\sphinx\Query->createCommand($db = null) …
        › $db = $this->getConnection();list ($sql, $params) = $db->getQueryBuilder()->build($this);arguments: {
          $query: yii\sphinx\Query {#200 …}
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/db/Query.php:249 {
        yii\db\Query->all($db = null) …
        › 
        › $rows = $this->createCommand($db)->queryAll();arguments: {
          $db: yii\sphinx\Connection {#203 …}
        }
      }
      /var/www/f7/data/www/models/Firm.php:926 {
        app\models\Firm::search($geo, $filter, $pager = null, $returnCount = false) …
        › \t->limit(300)\r\t->all();\r$searchIds = ArrayHelper::getColumn($rows, 'id');\r
      }
      /var/www/f7/data/www/models/Firm.php:1001 {
        app\models\Firm::count($geo, $filter) …
        › public static function count($geo, $filter){\r\treturn Firm::search($geo, $filter, null, true);\r}\r
        arguments: {
          $geo: app\models\Geo {#106 …}
          $filter: app\models\Filter {#197 …}
          $pager: null
          $returnCount: true
        }
      }
      /var/www/f7/data/www/components/BpkApiService.php:97 {
        app\components\BpkApiService->prepareOtherDominants($od) …
        › $filter->search = $dominant['name'];\r$firmCount = Firm::count($this->geo, $filter);\rif($firmCount > 0) {\r
        arguments: {
          $geo: app\models\Geo {#106 …}
          $filter: app\models\Filter {#197 …}
        }
      }
      /var/www/f7/data/www/components/BpkApiService.php:79 {
        app\components\BpkApiService->prepareData($data) …
        › $result['main_dominant'] = $data['main_dominant'];\r$result['other_dominants'] = $this->prepareOtherDominants($data['other_dominants']);\r//$result['main_dominant_core'] = array_slice($data['main_dominant_core'], 0, rand(5, 10));\r
        arguments: {
          $od: array:32 [ …32]
        }
      }
      /var/www/f7/data/www/components/BpkApiService.php:67 {
        app\components\BpkApiService->getKotelCores() …
        › \r    return $this->prepareData($data);\r}\r
        arguments: {
          $data: array:3 [ …3]
        }
      }
      /var/www/f7/data/www/components/BpkApiService.php:43 {
        app\components\BpkApiService->getCores() …
        › try {\r    $cores = $this->getKotelCores();\r} catch (\Exception $exception) {\r
      }
      /var/www/f7/data/www/controllers/SiteController.php:988 {
        app\controllers\SiteController->actionFirm($cityUrl, $groupUrl, $firmUrl) …
        › $bpkApiService = new BpkApiService($firm, $geo);$cores = $bpkApiService->getCores();}
      app\controllers\SiteController->actionFirm() {}
      /var/www/f7/data/www/vendor/yiisoft/yii2/base/InlineAction.php:57 {
        yii\base\InlineAction->runWithParams($params) …
        › 
        ›     return call_user_func_array([$this->controller, $this->actionMethod], $args);}
        arguments: {
          $function_name: array:2 [ …2]
          $parameters: array:3 [ …3]
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/base/Controller.php:181 {
        yii\base\Controller->runAction($id, $params = []) …
        › // run the action$result = $action->runWithParams($params);arguments: {
          $params: array:3 [ …3]
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/base/Module.php:534 {
        yii\base\Module->runAction($route, $params = []) …
        › Yii::$app->controller = $controller;$result = $controller->runAction($actionID, $params);if ($oldController !== null) {
        arguments: {
          $id: "firm"
          $params: array:3 [ …3]
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/web/Application.php:104 {
        yii\web\Application->handleRequest($request) …
        › $this->requestedRoute = $route;$result = $this->runAction($route, $params);if ($result instanceof Response) {
        arguments: {
          $route: "site/firm"
          $params: array:3 [ …3]
        }
      }
      /var/www/f7/data/www/vendor/yiisoft/yii2/base/Application.php:392 {
        yii\base\Application->run() …
        › $this->state = self::STATE_HANDLING_REQUEST;$response = $this->handleRequest($this->getRequest());arguments: {
          $request: yii\web\Request {#8 …}
        }
      }
      /var/www/f7/data/www/public/index.php:25 {
        › 
        › (new yii\web\Application($config))->run();}
    }
  }
  trace: {
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:642 {
      yii\db\Connection->open() …
      › 
      ›     throw new Exception($e->getMessage(), $e->errorInfo, (int) $e->getCode(), $e);}
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:1032 {
      yii\db\Connection->getMasterPdo() …
      › {    $this->open();    return $this->pdo;
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Connection.php:1019 {
      yii\db\Connection->getSlavePdo($fallbackToMaster = true) …
      › if ($db === null) {    return $fallbackToMaster ? $this->getMasterPdo() : null;}
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Command.php:265 {
      yii\sphinx\Command->prepare($forRead = null) …
      › if ($forRead || $forRead === null && $this->db->getSchema()->isReadQuery($sql)) {    $pdo = $this->db->getSlavePdo();} else {
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Command.php:1160 {
      yii\db\Command->queryInternal($method, $fetchMode = null) …
      › 
      › $this->prepare(true);arguments: {
        $forRead: true
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Command.php:407 {
      yii\db\Command->queryAll($fetchMode = null) …
      › {    return $this->queryInternal('fetchAll', $fetchMode);}
      arguments: {
        $method: "fetchAll"
        $fetchMode: null
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:256 {
      yii\sphinx\Schema->findIndexes() …
      › 
      ›     return $this->db->createCommand($sql)->queryAll();}
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:240 {
      yii\sphinx\Schema->initIndexesInfo() …
      › $this->_indexTypes = [];$indexes = $this->findIndexes();foreach ($indexes as $index) {
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:227 {
      yii\sphinx\Schema->getIndexTypes($refresh = false) …
      › if (!isset($this->_indexTypes) || $refresh) {    $this->initIndexesInfo();}
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:114 {
      yii\sphinx\Schema->resolveIndexType($index) …
      › {    $indexTypes = $this->getIndexTypes();    $index->type = array_key_exists($index->name, $indexTypes) ? $indexTypes[$index->name] : 'unknown';
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:90 {
      yii\sphinx\Schema->loadIndexSchema($name) …
      › $this->resolveIndexNames($index, $name);$this->resolveIndexType($index);arguments: {
        $index: yii\sphinx\IndexSchema {#206 …}
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Schema.php:152 {
      yii\sphinx\Schema->getIndexSchema($name, $refresh = false) …
      › 
      ›     return $this->_indexes[$name] = $this->loadIndexSchema($realName);}
      arguments: {
        $name: "f7_firm_index"
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Connection.php:89 {
      yii\sphinx\Connection->getIndexSchema($name, $refresh = false) …
      › {    return $this->getSchema()->getIndexSchema($name, $refresh);}
      arguments: {
        $name: "f7_firm_index"
        $refresh: false
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:1294 {
      yii\sphinx\QueryBuilder->getIndexSchemas($indexes) …
      › foreach ($indexes as $indexName) {    $index = $this->db->getIndexSchema($indexName);    if ($index !== null) {
      arguments: {
        $name: "f7_firm_index"
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:602 {
      yii\sphinx\QueryBuilder->buildWhere($indexes, $condition, &$params, $match = null) …
      › }$indexSchemas = $this->getIndexSchemas($indexes);$where = $this->buildCondition($indexSchemas, $condition, $params);
      arguments: {
        $indexes: array:1 [ …1]
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/QueryBuilder.php:128 {
      yii\sphinx\QueryBuilder->build($query, $params = []) …
      › $this->buildFrom($from, $params),$this->buildWhere($from, $query->where, $params, $query->match),$this->buildGroupBy($query->groupBy, $query->groupLimit),
      arguments: {
        $indexes: array:1 [ …1]
        $condition: array:3 [ …3]
        &$params: array:1 [ …1]
        $match: "Рекламные макеты"
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2-sphinx/src/Query.php:180 {
      yii\sphinx\Query->createCommand($db = null) …
      › $db = $this->getConnection();list ($sql, $params) = $db->getQueryBuilder()->build($this);arguments: {
        $query: yii\sphinx\Query {#200 …}
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/db/Query.php:249 {
      yii\db\Query->all($db = null) …
      › 
      › $rows = $this->createCommand($db)->queryAll();arguments: {
        $db: yii\sphinx\Connection {#203 …}
      }
    }
    /var/www/f7/data/www/models/Firm.php:926 {
      app\models\Firm::search($geo, $filter, $pager = null, $returnCount = false) …
      › \t->limit(300)\r\t->all();\r$searchIds = ArrayHelper::getColumn($rows, 'id');\r
    }
    /var/www/f7/data/www/models/Firm.php:1001 {
      app\models\Firm::count($geo, $filter) …
      › public static function count($geo, $filter){\r\treturn Firm::search($geo, $filter, null, true);\r}\r
      arguments: {
        $geo: app\models\Geo {#106 …}
        $filter: app\models\Filter {#197 …}
        $pager: null
        $returnCount: true
      }
    }
    /var/www/f7/data/www/components/BpkApiService.php:97 {
      app\components\BpkApiService->prepareOtherDominants($od) …
      › $filter->search = $dominant['name'];\r$firmCount = Firm::count($this->geo, $filter);\rif($firmCount > 0) {\r
      arguments: {
        $geo: app\models\Geo {#106 …}
        $filter: app\models\Filter {#197 …}
      }
    }
    /var/www/f7/data/www/components/BpkApiService.php:79 {
      app\components\BpkApiService->prepareData($data) …
      › $result['main_dominant'] = $data['main_dominant'];\r$result['other_dominants'] = $this->prepareOtherDominants($data['other_dominants']);\r//$result['main_dominant_core'] = array_slice($data['main_dominant_core'], 0, rand(5, 10));\r
      arguments: {
        $od: array:32 [ …32]
      }
    }
    /var/www/f7/data/www/components/BpkApiService.php:67 {
      app\components\BpkApiService->getKotelCores() …
      › \r    return $this->prepareData($data);\r}\r
      arguments: {
        $data: array:3 [ …3]
      }
    }
    /var/www/f7/data/www/components/BpkApiService.php:43 {
      app\components\BpkApiService->getCores() …
      › try {\r    $cores = $this->getKotelCores();\r} catch (\Exception $exception) {\r
    }
    /var/www/f7/data/www/controllers/SiteController.php:988 {
      app\controllers\SiteController->actionFirm($cityUrl, $groupUrl, $firmUrl) …
      › $bpkApiService = new BpkApiService($firm, $geo);$cores = $bpkApiService->getCores();}
    app\controllers\SiteController->actionFirm() {}
    /var/www/f7/data/www/vendor/yiisoft/yii2/base/InlineAction.php:57 {
      yii\base\InlineAction->runWithParams($params) …
      › 
      ›     return call_user_func_array([$this->controller, $this->actionMethod], $args);}
      arguments: {
        $function_name: array:2 [ …2]
        $parameters: array:3 [ …3]
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/base/Controller.php:181 {
      yii\base\Controller->runAction($id, $params = []) …
      › // run the action$result = $action->runWithParams($params);arguments: {
        $params: array:3 [ …3]
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/base/Module.php:534 {
      yii\base\Module->runAction($route, $params = []) …
      › Yii::$app->controller = $controller;$result = $controller->runAction($actionID, $params);if ($oldController !== null) {
      arguments: {
        $id: "firm"
        $params: array:3 [ …3]
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/web/Application.php:104 {
      yii\web\Application->handleRequest($request) …
      › $this->requestedRoute = $route;$result = $this->runAction($route, $params);if ($result instanceof Response) {
      arguments: {
        $route: "site/firm"
        $params: array:3 [ …3]
      }
    }
    /var/www/f7/data/www/vendor/yiisoft/yii2/base/Application.php:392 {
      yii\base\Application->run() …
      › $this->state = self::STATE_HANDLING_REQUEST;$response = $this->handleRequest($this->getRequest());arguments: {
        $request: yii\web\Request {#8 …}
      }
    }
    /var/www/f7/data/www/public/index.php:25 {
      › 
      › (new yii\web\Application($config))->run();}
  }
}