CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[70100]: <<Unknown error>>: 1317 Query execution was interrupted. The SQL statement executed was: SELECT `t`.`id` AS `t0_c0`, `t`.`url` AS `t0_c1`, `t`.`type` AS `t0_c2`, `t`.`info_id` AS `t0_c3`, `t`.`congress_id` AS `t0_c4`, `t`.`has_top_image` AS `t0_c5`, `t`.`top_image_id` AS `t0_c6`, `t`.`top_title` AS `t0_c7`, `t`.`author_id` AS `t0_c8`, `t`.`publisher_id` AS `t0_c9`, `t`.`status` AS `t0_c10`, `t`.`created_at` AS `t0_c11`, `t`.`is_verified` AS `t0_c12`, `t`.`in_rss` AS `t0_c13`, `newsInfo`.`id` AS `t1_c0`, `newsInfo`.`site_id` AS `t1_c1`, `newsInfo`.`title` AS `t1_c2`, `newsInfo`.`starting_date` AS `t1_c3`, `newsInfo`.`on_main_site` AS `t1_c4`, `newsInfo`.`description` AS `t1_c5`, `newsInfo`.`ending_date` AS `t1_c6`, `newsInfo`.`use_header_image` AS `t1_c7`, `newsInfo`.`header_image_id` AS `t1_c8`, `newsInfo`.`title_x` AS `t1_c9`, `newsInfo`.`title_y` AS `t1_c10`, `newsInfo`.`title_colour` AS `t1_c11`, `newsInfo`.`title_location` AS `t1_c12`, `newsInfo`.`title_position` AS `t1_c13`, `newsInfo`.`is_special` AS `t1_c14`, `newsInfo`.`special_image_id` AS `t1_c15`, `newsInfo`.`special_is_video` AS `t1_c16`, `newsInfo`.`first_photo_gallery_id` AS `t1_c17`, `newsInfo`.`special_order` AS `t1_c18`, `newsInfo`.`is_votes2015` AS `t1_c19`, `newsInfo`.`is_arctic` AS `t1_c20`, `newsInfo`.`is_donbass` AS `t1_c21`, `newsInfo`.`is_pin` AS `t1_c22`, `specialImage`.`id` AS `t2_c0`, `specialImage`.`original_uid` AS `t2_c1`, `specialImage`.`original_width` AS `t2_c2`, `specialImage`.`original_height` AS `t2_c3`, `specialImage`.`cropped_uid` AS `t2_c4`, `specialImage`.`crop_x` AS `t2_c5`, `specialImage`.`crop_y` AS `t2_c6`, `specialImage`.`crop_width` AS `t2_c7`, `specialImage`.`crop_height` AS `t2_c8`, `specialImage`.`type` AS `t2_c9`, `specialImage`.`author_id` AS `t2_c10`, `specialImage`.`is_used` AS `t2_c11`, `specialImage`.`created_at` AS `t2_c12` FROM `article` `t` LEFT OUTER JOIN `news_article_info` `newsInfo` ON (`t`.`info_id`=`newsInfo`.`id`) LEFT OUTER JOIN `image` `specialImage` ON (`newsInfo`.`special_image_id`=`specialImage`.`id`) WHERE (t.status=:ycp5 AND t.type=:ycp6 AND t.is_verified=:ycp7) AND (site_id = 79 AND is_special = 1 AND starting_date < '2024-03-29 15:35:48' AND ending_date < '2024-03-29 15:35:48' ) ORDER BY starting_date DESC, special_order LIMIT 4. Bound with :ycp5='published', :ycp6='news', :ycp7=1

/var/www/html/protected/libs/framework/db/CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#6
+
 /var/www/html/protected/models/articles/News.php(167): CActiveRecord->findAll(CDbCriteria)
162                 'newsInfo' => array(
163                     'condition' => 'site_id = ' . (int)$siteId . ' AND is_special = 1 AND starting_date < \'' . $now . '\' AND ending_date < \'' . $now . '\' ',
164                     'order' => 'starting_date DESC, special_order'
165                 ),
166                 'newsInfo.specialImage'
167             ))->findAll($criteria);
168             $news = array_merge($news, $oldNews);
169 
170             //throw new Exception('site_id = ' . (int)$siteId . ' AND is_special = 1 AND starting_date < \'' . $now . '\' AND ending_date > \'' . $now . '\' ');
171         }
172 
#7
+
 /var/www/html/protected/components/BaseController.php(72): News::getSpecialNewsListForMainPage("79")
67             ]);
68         }
69 
70         $this->photoReports = PhotoAlbum::getList();
71 
72         $this->specialNews = News::getSpecialNewsListForMainPage($this->currentSiteId);
73     }
74 }
#8
+
 /var/www/html/protected/controllers/SiteController.php(20): BaseController->init()
15     public $bugReportForm;
16 
17     public $slogan;
18 
19     public function init() {
20         parent::init();
21 
22         if (!Yii::app()->user->isGuest && Yii::app()->user->getState('role') == 'user') {
23             $this->siteUser = User::model()->with(['avatar', 'cityInfo'])->findByPk(Yii::app()->user->id, 'deleted IS NULL');
24         } elseif (!Yii::app()->user->isGuest && Yii::app()->user->getState('role') == 'admin') {
25             $admin = Admin::model()->with('user')->findByPk(Yii::app()->user->id);
2024-03-29 15:35:51 Apache/2.4.7 (Ubuntu) Yii Framework/1.1.14
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away. The SQL statement executed was: SELECT `id` FROM `session` WHERE id=:id. Bound with :id='6ibua9qgv736t12kfnqvndk136'