View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
14875Bug reportsInstallationpublic2019-05-29 16:39
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.17.x 
Fixed in Version3.17.x 
Summary14875: No error is shown at debug=0 if DB is broken
Description

When DB don't exist : white page, no error shown if debug = 0.

Steps To Reproduce

Install, rename DB , check

Additional Information

I don't remind what his happen in 2.6lts and before, but maybe we can throw error (with vanilla theme) even if debug = 0 ?
Because it's hard to fix DB when didn't know what happen

TagsNo tags attached.
Attached Files
CDbException.html (30,514 bytes)   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CDbException</title>

<style type="text/css">
/*<![CDATA[*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;}
ol,ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:none;}
:focus{outline:0;}
ins{text-decoration:none;}
del{text-decoration:line-through;}
table{border-collapse:collapse;border-spacing:0;}

body {
	font: normal 9pt "Verdana";
	color: #000;
	background: #fff;
}

h1 {
	font: normal 18pt "Verdana";
	color: #f00;
	margin-bottom: .5em;
}

h2 {
	font: normal 14pt "Verdana";
	color: #800000;
	margin-bottom: .5em;
}

h3 {
	font: bold 11pt "Verdana";
}

pre {
	font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace;
}

pre span.error {
	display: block;
	background: #fce3e3;
}

pre span.ln {
	color: #999;
	padding-right: 0.5em;
	border-right: 1px solid #ccc;
}

pre span.error-ln {
	font-weight: bold;
}

.container {
	margin: 1em 4em;
}

.version {
	color: gray;
	font-size: 8pt;
	border-top: 1px solid #aaa;
	padding-top: 1em;
	margin-bottom: 1em;
}

.message {
	color: #000;
	padding: 1em;
	font-size: 11pt;
	background: #f3f3f3;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	margin-bottom: 1em;
	line-height: 160%;
}

.source {
	margin-bottom: 1em;
}

.code pre {
	background-color: #ffe;
	margin: 0.5em 0;
	padding: 0.5em;
	line-height: 125%;
	border: 1px solid #eee;
}

.source .file {
	margin-bottom: 1em;
	font-weight: bold;
}

.traces {
	margin: 2em 0;
}

.trace {
	margin: 0.5em 0;
	padding: 0.5em;
}

.trace.app {
	border: 1px dashed #c00;
}

.trace .number {
	text-align: right;
	width: 2em;
	padding: 0.5em;
}

.trace .content {
	padding: 0.5em;
}

.trace .plus,
.trace .minus {
	display:inline;
	vertical-align:middle;
	text-align:center;
	border:1px solid #000;
	color:#000;
	font-size:10px;
	line-height:10px;
	margin:0;
	padding:0 1px;
	width:10px;
	height:10px;
}

.trace.collapsed .minus,
.trace.expanded .plus,
.trace.collapsed pre {
	display: none;
}

.trace-file {
	cursor: pointer;
	padding: 0.2em;
}

.trace-file:hover {
	background: #f0ffff;
}
/*]]>*/
</style>
</head>

<body>
<div class="container">
	<h1>CDbException</h1>

	<p class="message">
		CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1049] Unknown database 'ls_master'	</p>

	<div class="source">
		<p class="file">/mnt/data/shnoulle/nginx/www/master/framework/db/CDbConnection.php(399)</p>
		<div class="code"><pre><span class="ln">387</span>                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
<span class="ln">388</span>             try
<span class="ln">389</span>             {
<span class="ln">390</span>                 Yii::trace('Opening DB connection','system.db.CDbConnection');
<span class="ln">391</span>                 $this-&gt;_pdo=$this-&gt;createPdoInstance();
<span class="ln">392</span>                 $this-&gt;initConnection($this-&gt;_pdo);
<span class="ln">393</span>                 $this-&gt;_active=true;
<span class="ln">394</span>             }
<span class="ln">395</span>             catch(PDOException $e)
<span class="ln">396</span>             {
<span class="ln">397</span>                 if(YII_DEBUG)
<span class="ln">398</span>                 {
<span class="error"><span class="ln error-ln">399</span>                     throw new CDbException('CDbConnection failed to open the DB connection: '.
</span><span class="ln">400</span>                         $e-&gt;getMessage(),(int)$e-&gt;getCode(),$e-&gt;errorInfo);
<span class="ln">401</span>                 }
<span class="ln">402</span>                 else
<span class="ln">403</span>                 {
<span class="ln">404</span>                     Yii::log($e-&gt;getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
<span class="ln">405</span>                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e-&gt;getCode(),$e-&gt;errorInfo);
<span class="ln">406</span>                 }
<span class="ln">407</span>             }
<span class="ln">408</span>         }
<span class="ln">409</span>     }
<span class="ln">410</span> 
<span class="ln">411</span>     /**
</pre></div>	</div>

	<div class="traces">
		<h2>Stack Trace</h2>
				<table style="width:100%;">
						<tbody><tr class="trace core collapsed">
			<td class="number">
				#0			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/CDbConnection.php(347): <strong>CDbConnection</strong>-&gt;<strong>open</strong>()				</div>

				<div class="code"><pre><span class="ln">342</span>     public function setActive($value)
<span class="ln">343</span>     {
<span class="ln">344</span>         if($value!=$this-&gt;_active)
<span class="ln">345</span>         {
<span class="ln">346</span>             if($value)
<span class="error"><span class="ln error-ln">347</span>                 $this-&gt;open();
</span><span class="ln">348</span>             else
<span class="ln">349</span>                 $this-&gt;close();
<span class="ln">350</span>         }
<span class="ln">351</span>     }
<span class="ln">352</span> 
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#1			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/CDbConnection.php(325): <strong>CDbConnection</strong>-&gt;<strong>setActive</strong>(true)				</div>

				<div class="code"><pre><span class="ln">320</span>      */
<span class="ln">321</span>     public function init()
<span class="ln">322</span>     {
<span class="ln">323</span>         parent::init();
<span class="ln">324</span>         if($this-&gt;autoConnect)
<span class="error"><span class="ln error-ln">325</span>             $this-&gt;setActive(true);
</span><span class="ln">326</span>     }
<span class="ln">327</span> 
<span class="ln">328</span>     /**
<span class="ln">329</span>      * Returns whether the DB connection is established.
<span class="ln">330</span>      * @return boolean whether the DB connection is established
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#2			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/base/CModule.php(394): <strong>CDbConnection</strong>-&gt;<strong>init</strong>()				</div>

				<div class="code"><pre><span class="ln">389</span>             if(!isset($config['enabled']) || $config['enabled'])
<span class="ln">390</span>             {
<span class="ln">391</span>                 Yii::trace("Loading \"$id\" application component",'system.CModule');
<span class="ln">392</span>                 unset($config['enabled']);
<span class="ln">393</span>                 $component=Yii::createComponent($config);
<span class="error"><span class="ln error-ln">394</span>                 $component-&gt;init();
</span><span class="ln">395</span>                 return $this-&gt;_components[$id]=$component;
<span class="ln">396</span>             }
<span class="ln">397</span>         }
<span class="ln">398</span>     }
<span class="ln">399</span> 
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#3			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/base/CApplication.php(459): <strong>CModule</strong>-&gt;<strong>getComponent</strong>("db")				</div>

				<div class="code"><pre><span class="ln">454</span>      * Returns the database connection component.
<span class="ln">455</span>      * @return CDbConnection the database connection
<span class="ln">456</span>      */
<span class="ln">457</span>     public function getDb()
<span class="ln">458</span>     {
<span class="error"><span class="ln error-ln">459</span>         return $this-&gt;getComponent('db');
</span><span class="ln">460</span>     }
<span class="ln">461</span> 
<span class="ln">462</span>     /**
<span class="ln">463</span>      * Returns the error handler component.
<span class="ln">464</span>      * @return CErrorHandler the error handler application component.
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#4			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/ar/CActiveRecord.php(639): <strong>CApplication</strong>-&gt;<strong>getDb</strong>()				</div>

				<div class="code"><pre><span class="ln">634</span>     {
<span class="ln">635</span>         if(self::$db!==null)
<span class="ln">636</span>             return self::$db;
<span class="ln">637</span>         else
<span class="ln">638</span>         {
<span class="error"><span class="ln error-ln">639</span>             self::$db=Yii::app()-&gt;getDb();
</span><span class="ln">640</span>             if(self::$db instanceof CDbConnection)
<span class="ln">641</span>                 return self::$db;
<span class="ln">642</span>             else
<span class="ln">643</span>                 throw new CDbException(Yii::t('yii','Active Record requires a "db" CDbConnection application component.'));
<span class="ln">644</span>         }
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#5			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/ar/CActiveRecord.php(2389): <strong>CActiveRecord</strong>-&gt;<strong>getDbConnection</strong>()				</div>

				<div class="code"><pre><span class="ln">2384</span>     public function __construct($model)
<span class="ln">2385</span>     {
<span class="ln">2386</span>         $this-&gt;_modelClassName=get_class($model);
<span class="ln">2387</span> 
<span class="ln">2388</span>         $tableName=$model-&gt;tableName();
<span class="error"><span class="ln error-ln">2389</span>         if(($table=$model-&gt;getDbConnection()-&gt;getSchema()-&gt;getTable($tableName))===null)
</span><span class="ln">2390</span>             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
<span class="ln">2391</span>                 array('{class}'=&gt;$this-&gt;_modelClassName,'{table}'=&gt;$tableName)));
<span class="ln">2392</span>                 
<span class="ln">2393</span>         if(($modelPk=$model-&gt;primaryKey())!==null || $table-&gt;primaryKey===null)
<span class="ln">2394</span>         {
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#6			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/ar/CActiveRecord.php(413): <strong>CActiveRecordMetaData</strong>-&gt;<strong>__construct</strong>(SettingGlobal)				</div>

				<div class="code"><pre><span class="ln">408</span>     {
<span class="ln">409</span>         $className=get_class($this);
<span class="ln">410</span>         if(!array_key_exists($className,self::$_md))
<span class="ln">411</span>         {
<span class="ln">412</span>             self::$_md[$className]=null; // preventing recursive invokes of {@link getMetaData()} via {@link __get()}
<span class="error"><span class="ln error-ln">413</span>             self::$_md[$className]=new CActiveRecordMetaData($this);
</span><span class="ln">414</span>         }
<span class="ln">415</span>         return self::$_md[$className];
<span class="ln">416</span>     }
<span class="ln">417</span> 
<span class="ln">418</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#7			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/ar/CActiveRecord.php(682): <strong>CActiveRecord</strong>-&gt;<strong>getMetaData</strong>()				</div>

				<div class="code"><pre><span class="ln">677</span>      * @param string $name attribute name
<span class="ln">678</span>      * @return boolean whether this AR has the named attribute (table column).
<span class="ln">679</span>      */
<span class="ln">680</span>     public function hasAttribute($name)
<span class="ln">681</span>     {
<span class="error"><span class="ln error-ln">682</span>         return isset($this-&gt;getMetaData()-&gt;columns[$name]);
</span><span class="ln">683</span>     }
<span class="ln">684</span> 
<span class="ln">685</span>     /**
<span class="ln">686</span>      * Returns the named attribute value.
<span class="ln">687</span>      * If this is a new record and the attribute is not set before,
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#8			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/models/LSActiveRecord.php(34): <strong>CActiveRecord</strong>-&gt;<strong>hasAttribute</strong>("created")				</div>

				<div class="code"><pre><span class="ln">29</span>      * @return array
<span class="ln">30</span>      */
<span class="ln">31</span>     public function behaviors()
<span class="ln">32</span>     {
<span class="ln">33</span>         $aBehaviors = array();
<span class="error"><span class="ln error-ln">34</span>         $sCreateFieldName = ($this-&gt;hasAttribute('created') ? 'created' : null);
</span><span class="ln">35</span>         $sUpdateFieldName = ($this-&gt;hasAttribute('modified') ? 'modified' : null);
<span class="ln">36</span>         $sDriverName = Yii::app()-&gt;db-&gt;getDriverName();
<span class="ln">37</span>         if ($sDriverName == 'sqlsrv' || $sDriverName == 'dblib') {
<span class="ln">38</span>             $sTimestampExpression = new CDbExpression('GETDATE()');
<span class="ln">39</span>         } else {
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#9			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/db/ar/CActiveRecord.php(398): <strong>LSActiveRecord</strong>-&gt;<strong>behaviors</strong>()				</div>

				<div class="code"><pre><span class="ln">393</span>         if(isset(self::$_models[$className]))
<span class="ln">394</span>             return self::$_models[$className];
<span class="ln">395</span>         else
<span class="ln">396</span>         {
<span class="ln">397</span>             $model=self::$_models[$className]=new $className(null);
<span class="error"><span class="ln error-ln">398</span>             $model-&gt;attachBehaviors($model-&gt;behaviors());
</span><span class="ln">399</span>             return $model;
<span class="ln">400</span>         }
<span class="ln">401</span>     }
<span class="ln">402</span> 
<span class="ln">403</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#10			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/models/SettingGlobal.php(33): <strong>CActiveRecord</strong>::<strong>model</strong>("SettingGlobal")				</div>

				<div class="code"><pre><span class="ln">28</span>      * @inheritdoc
<span class="ln">29</span>      * @return CActiveRecord
<span class="ln">30</span>      */
<span class="ln">31</span>     public static function model($class = __CLASS__)
<span class="ln">32</span>     {
<span class="error"><span class="ln error-ln">33</span>         return parent::model($class);
</span><span class="ln">34</span>     }
<span class="ln">35</span> 
<span class="ln">36</span>     /** @inheritdoc */
<span class="ln">37</span>     public function tableName()
<span class="ln">38</span>     {
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#11			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/helpers/globalsettings_helper.php(23): <strong>SettingGlobal</strong>::<strong>model</strong>()				</div>

				<div class="code"><pre><span class="ln">18</span> injectglobalsettings();
<span class="ln">19</span> 
<span class="ln">20</span> 
<span class="ln">21</span> function injectglobalsettings()
<span class="ln">22</span> {
<span class="error"><span class="ln error-ln">23</span>     $settings = SettingGlobal::model()-&gt;findAll();
</span><span class="ln">24</span> 
<span class="ln">25</span>     //if ($dbvaluearray!==false)
<span class="ln">26</span>     if (count($settings) &gt; 0) {
<span class="ln">27</span>         foreach ($settings as $setting) {
<span class="ln">28</span>             Yii::app()-&gt;setConfig($setting-&gt;getAttribute('stg_name'), $setting-&gt;getAttribute('stg_value'));
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#12			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/helpers/globalsettings_helper.php(18): <strong>injectglobalsettings</strong>()				</div>

				<div class="code"><pre><span class="ln">13</span>  * See COPYRIGHT.php for copyright notices and details.
<span class="ln">14</span>  *
<span class="ln">15</span>  */
<span class="ln">16</span> //Ensure script is not run directly, avoid path disclosure
<span class="ln">17</span> //if (!isset($homedir) || isset($_REQUEST['$homedir'])) {die("Cannot run this script directly");}
<span class="error"><span class="ln error-ln">18</span> injectglobalsettings();
</span><span class="ln">19</span> 
<span class="ln">20</span> 
<span class="ln">21</span> function injectglobalsettings()
<span class="ln">22</span> {
<span class="ln">23</span>     $settings = SettingGlobal::model()-&gt;findAll();
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#13			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/YiiBase.php(328): <strong>require</strong>("/mnt/data/shnoulle/nginx/www/master/application/helpers/globalse...")				</div>

				<div class="code"><pre><span class="ln">323</span>             if($isClass)
<span class="ln">324</span>             {
<span class="ln">325</span>                 if($forceInclude)
<span class="ln">326</span>                 {
<span class="ln">327</span>                     if(is_file($path.'.php'))
<span class="error"><span class="ln error-ln">328</span>                         require($path.'.php');
</span><span class="ln">329</span>                     else
<span class="ln">330</span>                         throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.',array('{alias}'=&gt;$alias)));
<span class="ln">331</span>                     self::$_imports[$alias]=$className;
<span class="ln">332</span>                 }
<span class="ln">333</span>                 else
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#14			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/core/LSYii_Application.php(180): <strong>YiiBase</strong>::<strong>import</strong>("application.helpers.globalsettings_helper", true)				</div>

				<div class="code"><pre><span class="ln">175</span>      * @param string $helper
<span class="ln">176</span>      * @return void
<span class="ln">177</span>      */
<span class="ln">178</span>     public function loadHelper($helper)
<span class="ln">179</span>     {
<span class="error"><span class="ln error-ln">180</span>         Yii::import('application.helpers.'.$helper.'_helper', true);
</span><span class="ln">181</span>     }
<span class="ln">182</span> 
<span class="ln">183</span>     /**
<span class="ln">184</span>      * Loads a library
<span class="ln">185</span>      *
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#15			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/core/LSYii_Controller.php(70): <strong>LSYii_Application</strong>-&gt;<strong>loadHelper</strong>("globalsettings")				</div>

				<div class="code"><pre><span class="ln">65</span>      * @param string $helper
<span class="ln">66</span>      * @return void
<span class="ln">67</span>      */
<span class="ln">68</span>     public function loadHelper($helper)
<span class="ln">69</span>     {
<span class="error"><span class="ln error-ln">70</span>         Yii::app()-&gt;loadHelper($helper);
</span><span class="ln">71</span>     }
<span class="ln">72</span> 
<span class="ln">73</span>     /**
<span class="ln">74</span>      * Loads a library
<span class="ln">75</span>      *
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#16			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/application/core/LSYii_Controller.php(39): <strong>LSYii_Controller</strong>-&gt;<strong>loadHelper</strong>("globalsettings")				</div>

				<div class="code"><pre><span class="ln">34</span>         $this-&gt;_checkInstallation();
<span class="ln">35</span> 
<span class="ln">36</span>         //Yii::app()-&gt;session-&gt;init();
<span class="ln">37</span>         $this-&gt;loadLibrary('LS.LS');
<span class="ln">38</span>         // This will setConfig from database
<span class="error"><span class="ln error-ln">39</span>         $this-&gt;loadHelper('globalsettings');
</span><span class="ln">40</span>         $this-&gt;loadHelper('common');
<span class="ln">41</span>         $this-&gt;loadHelper('expressions.em_manager');
<span class="ln">42</span>         $this-&gt;loadHelper('replacements');
<span class="ln">43</span>         $this-&gt;_init();
<span class="ln">44</span>     }
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#17			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/web/CWebApplication.php(359): <strong>LSYii_Controller</strong>-&gt;<strong>__construct</strong>("admin", null)				</div>

				<div class="code"><pre><span class="ln">354</span>                     require($classFile);
<span class="ln">355</span>                 if(class_exists($className,false) &amp;&amp; is_subclass_of($className,'CController'))
<span class="ln">356</span>                 {
<span class="ln">357</span>                     $id[0]=strtolower($id[0]);
<span class="ln">358</span>                     return array(
<span class="error"><span class="ln error-ln">359</span>                         new $className($controllerID.$id,$owner===$this?null:$owner),
</span><span class="ln">360</span>                         $this-&gt;parseActionParams($route),
<span class="ln">361</span>                     );
<span class="ln">362</span>                 }
<span class="ln">363</span>                 return null;
<span class="ln">364</span>             }
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#18			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/web/CWebApplication.php(276): <strong>CWebApplication</strong>-&gt;<strong>createController</strong>("")				</div>

				<div class="code"><pre><span class="ln">271</span>      * @param string $route the route of the current request. See {@link createController} for more details.
<span class="ln">272</span>      * @throws CHttpException if the controller could not be created.
<span class="ln">273</span>      */
<span class="ln">274</span>     public function runController($route)
<span class="ln">275</span>     {
<span class="error"><span class="ln error-ln">276</span>         if(($ca=$this-&gt;createController($route))!==null)
</span><span class="ln">277</span>         {
<span class="ln">278</span>             list($controller,$actionID)=$ca;
<span class="ln">279</span>             $oldController=$this-&gt;_controller;
<span class="ln">280</span>             $this-&gt;_controller=$controller;
<span class="ln">281</span>             $controller-&gt;init();
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#19			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/web/CWebApplication.php(141): <strong>CWebApplication</strong>-&gt;<strong>runController</strong>("admin")				</div>

				<div class="code"><pre><span class="ln">136</span>             foreach(array_splice($this-&gt;catchAllRequest,1) as $name=&gt;$value)
<span class="ln">137</span>                 $_GET[$name]=$value;
<span class="ln">138</span>         }
<span class="ln">139</span>         else
<span class="ln">140</span>             $route=$this-&gt;getUrlManager()-&gt;parseUrl($this-&gt;getRequest());
<span class="error"><span class="ln error-ln">141</span>         $this-&gt;runController($route);
</span><span class="ln">142</span>     }
<span class="ln">143</span> 
<span class="ln">144</span>     /**
<span class="ln">145</span>      * Registers the core application components.
<span class="ln">146</span>      * This method overrides the parent implementation by registering additional core components.
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#20			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/framework/base/CApplication.php(185): <strong>CWebApplication</strong>-&gt;<strong>processRequest</strong>()				</div>

				<div class="code"><pre><span class="ln">180</span>     public function run()
<span class="ln">181</span>     {
<span class="ln">182</span>         if($this-&gt;hasEventHandler('onBeginRequest'))
<span class="ln">183</span>             $this-&gt;onBeginRequest(new CEvent($this));
<span class="ln">184</span>         register_shutdown_function(array($this,'end'),0,false);
<span class="error"><span class="ln error-ln">185</span>         $this-&gt;processRequest();
</span><span class="ln">186</span>         if($this-&gt;hasEventHandler('onEndRequest'))
<span class="ln">187</span>             $this-&gt;onEndRequest(new CEvent($this));
<span class="ln">188</span>     }
<span class="ln">189</span> 
<span class="ln">190</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#21			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;/mnt/data/shnoulle/nginx/www/master/index.php(194): <strong>CApplication</strong>-&gt;<strong>run</strong>()				</div>

				<div class="code"><pre><span class="ln">189</span> require_once APPPATH . 'core/LSYii_Application' . EXT;
<span class="ln">190</span> 
<span class="ln">191</span> $config = require_once(APPPATH . 'config/internal' . EXT);
<span class="ln">192</span> 
<span class="ln">193</span> Yii::$enableIncludePath = false;
<span class="error"><span class="ln error-ln">194</span> Yii::createApplication('LSYii_Application', $config)-&gt;run();
</span><span class="ln">195</span> 
<span class="ln">196</span> /* End of file index.php */
<span class="ln">197</span> /* Location: ./index.php */
</pre></div>			</td>
		</tr>
				</tbody></table>
	</div>

	<div class="version">
		2019-05-09 13:59:52 nginx/1.14.2 <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.21	</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/
var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");

var e = document.getElementsByTagName("div");
for(var j=0,len=e.length;j<len;j++){
	if(traceReg.test(e[j].className)){
		e[j].onclick = function(){
			var trace = this.parentNode.parentNode;
			if(collapsedReg.test(trace.className))
				trace.className = trace.className.replace("collapsed", "expanded");
			else
				trace.className = trace.className.replace("expanded", "collapsed");
		}
	}
}
/*]]>*/
</script>



</body></html>
CDbException.html (30,514 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)3.17.2 github
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Users monitoring this issue

There are no users monitoring this issue.

Activities

dominikvitt

dominikvitt

2019-05-10 14:31

developer   ~51864

This issue is related to your commit, exception is suppressed:
https://github.com/LimeSurvey/LimeSurvey/commit/c3d25219b8e939814e116c3264b71ebd7431c9fc#diff-f5392477bcb7ace25c65e8bd7abd39e9R141

On this line nice message should be shown:
https://github.com/LimeSurvey/LimeSurvey/blob/f62d45ef6c72bd16a65557b43e0c29070888314e/application/core/LSYii_Application.php#L158

DenisChenu

DenisChenu

2019-05-10 15:16

developer   ~51865

Thanks you , no i unserstand why i don't have nothing in https://github.com/LimeSurvey/LimeSurvey/blob/f62d45ef6c72bd16a65557b43e0c29070888314e/application/controllers/SurveysController.php#L64 width debug at 0 :)

DenisChenu

DenisChenu

2019-05-10 15:19

developer   ~51867

@dominikvitt : what is your advice :

  1. Throws simple CDbException with default Yii behaviour
  2. Thows CDbException with vanilla theme
  3. Throw another exception ?
dominikvitt

dominikvitt

2019-05-10 16:12

developer   ~51889

@DenisChenu:
For debug mode turned off, it shouldn't be CDbException but some nice custom message, something like "Unable to connect to database specified in application/config/config.php file".
For debug mode turned on should stay as it is.

DenisChenu

DenisChenu

2019-05-11 10:26

developer   ~51899

Can not translate : gT don't exist at this time …
Yii error seems clean enough (checked with invalid DB, invalid username : same error.

I have just 'connectionString' => '' ,than didn't throw any error …
I want this : https://github.com/LimeSurvey/LimeSurvey/blob/49237af44f162e584c2ac931b06a22d973e27150/framework/db/CDbConnection.php#L387 but seems Yii::app()->db->getConnectionStatus() don't use open function ????

DenisChenu

DenisChenu

2019-05-11 12:02

developer   ~51901

https://github.com/LimeSurvey/LimeSurvey/pull/1276

DenisChenu

DenisChenu

2019-05-13 14:54

developer   ~51927

Cleaner : https://github.com/LimeSurvey/LimeSurvey/pull/1279

dominikvitt

dominikvitt

2019-05-13 15:12

developer   ~51929

https://github.com/LimeSurvey/LimeSurvey/commit/a6ace6c5a4d53a8892d12edd5a1f87a6202cf4fb

DenisChenu

DenisChenu

2019-05-29 16:12

developer   ~52182

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=28900

c_schmitz

c_schmitz

2019-05-29 16:39

administrator   ~52214

Version 3.17.4+190529 released

Related Changesets

LimeSurvey: master a6ace6c5

2019-05-13 15:11:07

DenisChenu


Committer: Dominik Vitt Details Diff
Fixed issue 14875: No error is shown at debug=0 if DB is broken (#1279) Affected Issues
14875
mod - application/core/LSYii_Application.php Diff File

Issue History

Date Modified Username Field Change
2019-05-09 16:03 DenisChenu New Issue
2019-05-09 16:03 DenisChenu File Added: CDbException.html
2019-05-09 16:07 DenisChenu Summary No error is shown if DB is broken => No error is shown at debug=0 if DB is broken
2019-05-09 16:07 DenisChenu Additional Information Updated
2019-05-09 16:08 DenisChenu Additional Information Updated
2019-05-10 14:31 dominikvitt Note Added: 51864
2019-05-10 15:14 DenisChenu Assigned To => DenisChenu
2019-05-10 15:14 DenisChenu Status new => assigned
2019-05-10 15:16 DenisChenu Note Added: 51865
2019-05-10 15:19 DenisChenu Note Added: 51867
2019-05-10 16:12 dominikvitt Note Added: 51889
2019-05-11 10:26 DenisChenu File Added: Capture d’écran du 2019-05-11 10-23-16.png
2019-05-11 10:26 DenisChenu Note Added: 51899
2019-05-11 12:02 DenisChenu Note Added: 51901
2019-05-13 14:54 DenisChenu Note Added: 51927
2019-05-13 15:12 dominikvitt Status assigned => resolved
2019-05-13 15:12 dominikvitt Resolution open => fixed
2019-05-13 15:12 dominikvitt Fixed in Version => 3.17.x
2019-05-13 15:12 dominikvitt Note Added: 51929
2019-05-29 16:12 DenisChenu Changeset attached => LimeSurvey master a6ace6c5
2019-05-29 16:12 DenisChenu Note Added: 52182
2019-05-29 16:39 c_schmitz Note Added: 52214
2019-05-29 16:39 c_schmitz Status resolved => closed