View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18618 | Bug reports | _ Unknown | public | 2023-02-03 12:09 | 2023-02-04 12:26 |
Reporter | anonfunc | Assigned To | ollehar | ||
Priority | high | Severity | crash | ||
Status | assigned | Resolution | open | ||
Product Version | 5.6.x | ||||
Summary | 18618: Incompatible with PostgreSQL 15 | ||||
Description | Using LimeSurvey 5.6.3 with PostgreSQL does not work. As soon as any page is visited, it throws the following error: Internal Servererror | ||||
Steps To Reproduce | Steps to reproduceUse LimeSurvey with PostgreSQL 15 Expected resultLimeSurvey not throwing any errors. Actual resultSee description. | ||||
Tags | No tags attached. | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 5.6.3+230130 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | PostgreSQL 15 | ||||
Server OS (if known) | Linux | ||||
Webserver software & version (if known) | |||||
PHP Version | 8.0 | ||||
Can you activate debug mode please ? |
|
^. The SQL statement executed was: SELECT Not sure how to best copy this here, so I screenshot-ed it. If you need anything specific, I can of course copy it here. |
|
You can just save the HTML and send it here :) |
|
Yes we need to know where (and why) this request is done (i have a PG13, but no PG15) |
|
Attached as HTML. CDbException.html (17,971 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"> CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[42804]: Datatype mismatch: 7 ERROR: UNION types "char" and text cannot be matched<br /> LINE 21: CASE WHEN indisprimary THEN<br /> ^. The SQL statement executed was: SELECT<br /> conname,<br /> consrc,<br /> contype,<br /> indkey<br /> FROM (<br /> SELECT<br /> conname,<br /> pg_catalog.pg_get_constraintdef(oid) AS consrc,<br /> contype,<br /> conrelid AS relid,<br /> NULL AS indkey<br /> FROM<br /> pg_catalog.pg_constraint<br /> WHERE<br /> contype IN ('f', 'c')<br /> UNION ALL<br /> SELECT<br /> pc.relname,<br /> NULL,<br /> CASE WHEN indisprimary THEN<br /> 'p'<br /> ELSE<br /> 'u'<br /> END,<br /> pi.indrelid,<br /> indkey<br /> FROM<br /> pg_catalog.pg_class pc,<br /> pg_catalog.pg_index pi<br /> WHERE<br /> pc.oid=pi.indexrelid<br /> AND EXISTS (<br /> SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c<br /> ON (d.refclassid = c.tableoid AND d.refobjid = c.oid)<br /> WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p')<br /> )<br /> ) AS sub<br /> WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table<br /> AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace<br /> WHERE nspname=:schema)) </p> <div class="source"> <p class="file">/data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/db/CDbCommand.php(543)</p> <div class="code"><pre><span class="ln">531</span> { <span class="ln">532</span> if($this->_connection->enableProfiling) <span class="ln">533</span> Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query'); <span class="ln">534</span> <span class="ln">535</span> $errorInfo=$e instanceof PDOException ? $e->errorInfo : null; <span class="ln">536</span> $message=$e->getMessage(); <span class="ln">537</span> Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.', <span class="ln">538</span> array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand'); <span class="ln">539</span> <span class="ln">540</span> if(YII_DEBUG) <span class="ln">541</span> $message.='. The SQL statement executed was: '.$this->getText().$par; <span class="ln">542</span> <span class="error"><span class="ln error-ln">543</span> throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}', </span><span class="ln">544</span> array('{error}'=>$message)),(int)$e->getCode(),$errorInfo); <span class="ln">545</span> } <span class="ln">546</span> } <span class="ln">547</span> <span class="ln">548</span> /** <span class="ln">549</span> * Builds a SQL SELECT statement from the given query specification. <span class="ln">550</span> * @param array $query the query specification in name-value pairs. The following <span class="ln">551</span> * query options are supported: {@link select}, {@link distinct}, {@link from}, <span class="ln">552</span> * {@link where}, {@link join}, {@link group}, {@link having}, {@link order}, <span class="ln">553</span> * {@link limit}, {@link offset} and {@link union}. <span class="ln">554</span> * @throws CDbException if "from" key is not present in given query parameter <span class="ln">555</span> * @return string the SQL statement </pre></div> </div> <div class="traces"> <h2>Stack Trace</h2> <table style="width:100%;"> <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> /data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/db/CDbCommand.php(396): <strong>CDbCommand</strong>-><strong>queryInternal</strong>() </div> <div class="code"><pre><span class="ln">391</span> * An empty array is returned if the query results in nothing. <span class="ln">392</span> * @throws CException execution failed <span class="ln">393</span> */ <span class="ln">394</span> public function queryAll($fetchAssociative=true,$params=array()) <span class="ln">395</span> { <span class="error"><span class="ln error-ln">396</span> return $this->queryInternal('fetchAll',$fetchAssociative ? $this->_fetchMode : PDO::FETCH_NUM, $params); </span><span class="ln">397</span> } <span class="ln">398</span> <span class="ln">399</span> /** <span class="ln">400</span> * Executes the SQL statement and returns the first row of the result. <span class="ln">401</span> * This is a convenient method of {@link query} when only the first row of data is needed. </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> /data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/db/schema/pgsql/CPgsqlSchema.php(278): <strong>CDbCommand</strong>-><strong>queryAll</strong>() </div> <div class="code"><pre><span class="ln">273</span> WHERE nspname=:schema)) <span class="ln">274</span> EOD; <span class="ln">275</span> $command=$this->getDbConnection()->createCommand($sql); <span class="ln">276</span> $command->bindValue(':table',$table->name); <span class="ln">277</span> $command->bindValue(':schema',$table->schemaName); <span class="error"><span class="ln error-ln">278</span> foreach($command->queryAll() as $row) </span><span class="ln">279</span> { <span class="ln">280</span> if($row['contype']==='p') // primary key <span class="ln">281</span> $this->findPrimaryKey($table,$row['indkey']); <span class="ln">282</span> elseif($row['contype']==='f') // foreign key <span class="ln">283</span> $this->findForeignKey($table,$row['consrc']); </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> /data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/db/schema/pgsql/CPgsqlSchema.php(115): <strong>CPgsqlSchema</strong>-><strong>findConstraints</strong>() </div> <div class="code"><pre><span class="ln">110</span> { <span class="ln">111</span> $table=new CPgsqlTableSchema; <span class="ln">112</span> $this->resolveTableNames($table,$name); <span class="ln">113</span> if(!$this->findColumns($table)) <span class="ln">114</span> return null; <span class="error"><span class="ln error-ln">115</span> $this->findConstraints($table); </span><span class="ln">116</span> <span class="ln">117</span> if(is_string($table->primaryKey) && isset($this->_sequences[$table->rawName.'.'.$table->primaryKey])) <span class="ln">118</span> $table->sequenceName=$this->_sequences[$table->rawName.'.'.$table->primaryKey]; <span class="ln">119</span> elseif(is_array($table->primaryKey)) <span class="ln">120</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> /data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/db/schema/CDbSchema.php(96): <strong>CPgsqlSchema</strong>-><strong>loadTable</strong>() </div> <div class="code"><pre><span class="ln">091</span> { <span class="ln">092</span> $key='yii:dbschema'.$this->_connection->connectionString.':'.$this->_connection->username.':'.$name; <span class="ln">093</span> $table=$cache->get($key); <span class="ln">094</span> if($refresh===true || $table===false) <span class="ln">095</span> { <span class="error"><span class="ln error-ln">096</span> $table=$this->loadTable($realName); </span><span class="ln">097</span> if($table!==null) <span class="ln">098</span> $cache->set($key,$table,$duration); <span class="ln">099</span> } <span class="ln">100</span> $this->_tables[$name]=$table; <span class="ln">101</span> } </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #4 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /data/kunden/021/limesurvey/application/core/LSYii_Application.php(179): <strong>CDbSchema</strong>-><strong>getTable</strong>() </div> <div class="code"><pre><span class="ln">174</span> /* encrypt emailsmtppassword value, because emailsmtppassword in database is also encrypted <span class="ln">175</span> it would be decrypted in LimeMailer when needed */ <span class="ln">176</span> $this->config['emailsmtppassword'] = LSActiveRecord::encryptSingle($this->config['emailsmtppassword']); <span class="ln">177</span> <span class="ln">178</span> /* Check DB : let throw error if DB is broken issue #14875 */ <span class="error"><span class="ln error-ln">179</span> $settingsTableExist = Yii::app()->db->schema->getTable('{{settings_global}}'); </span><span class="ln">180</span> /* No table settings_global : not installable or updatable */ <span class="ln">181</span> if (empty($settingsTableExist)) { <span class="ln">182</span> /* settings_global was created before 1.80 : not updatable version or not installed (but table exist) */ <span class="ln">183</span> Yii::log("LimeSurvey table settings_global not found in database", 'error'); <span class="ln">184</span> throw new CDbException("LimeSurvey table settings_global not found in database"); </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #5 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /data/kunden/021/limesurvey/application/core/LSYii_Application.php(93): <strong>LSYii_Application</strong>-><strong>setConfigs</strong>() </div> <div class="code"><pre><span class="ln">88</span> <span class="ln">89</span> /* Construct CWebApplication */ <span class="ln">90</span> parent::__construct($aApplicationConfig); <span class="ln">91</span> <span class="ln">92</span> /* Because we have app now : we have to call again the config (usage of Yii::app() for publicurl) */ <span class="error"><span class="ln error-ln">93</span> $this->setConfigs(); </span><span class="ln">94</span> /* Since session can be set by DB : need to be set again … */ <span class="ln">95</span> $this->setSessionByDB($aApplicationConfig); <span class="ln">96</span> <span class="ln">97</span> /* Update asset manager path and url only if not directly set in aApplicationConfig (from config.php), <span class="ln">98</span> * must do after reloading to have valid publicurl (the tempurl) */ </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> /data/kunden/021/limesurvey/vendor/yiisoft/yii/framework/YiiBase.php(132): <strong>LSYii_Application</strong>-><strong>__construct</strong>() </div> <div class="code"><pre><span class="ln">127</span> * to the constructor of the application class. <span class="ln">128</span> * @return mixed the application instance <span class="ln">129</span> */ <span class="ln">130</span> public static function createApplication($class,$config=null) <span class="ln">131</span> { <span class="error"><span class="ln error-ln">132</span> return new $class($config); </span><span class="ln">133</span> } <span class="ln">134</span> <span class="ln">135</span> /** <span class="ln">136</span> * Returns the application singleton or null if the singleton has not been created yet. <span class="ln">137</span> * @return CApplication the application singleton, null if the singleton has not been created yet. </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #7 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /data/kunden/021/limesurvey/index.php(192): <strong>YiiBase</strong>::<strong>createApplication</strong>() </div> <div class="code"><pre><span class="ln">187</span> require_once APPPATH . 'core/LSYii_Application' . EXT; <span class="ln">188</span> <span class="ln">189</span> $config = require_once(APPPATH . 'config/internal' . EXT); <span class="ln">190</span> <span class="ln">191</span> Yii::$enableIncludePath = false; <span class="error"><span class="ln error-ln">192</span> Yii::createApplication('LSYii_Application', $config)->run(); </span><span class="ln">193</span> <span class="ln">194</span> /* End of file index.php */ <span class="ln">195</span> /* Location: ./index.php */ </pre></div> </td> </tr> </table> </div> <div class="version"> 2023-02-03 18:01:53 nginx/1.23.3 <a href="https://www.yiiframework.com/">Yii Framework</a>/1.1.26 </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> |
|
Oh F**** Yii1 issue : https://github.com/yiisoft/yii/issues/4490 |
|
@ollehar : Yii1 dev have the fix , did we update YII1 to dev or did we fix in our PgsqlSchema.php ? |
|
We use composer for Yii now. But composer can be configured to pull dev. Or we monkey patch it until it's released. |
|
It's easy to patch here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/db/PgsqlSchema.php But i let you compose if needed :) |
|
composer for 3.X can fix this too https://github.com/yiisoft/yii/pull/4501#issuecomment-1349091209 |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2023-02-03 12:09 | anonfunc | New Issue | |
2023-02-03 13:43 | ollehar | Priority | none => high |
2023-02-03 14:04 | DenisChenu | Note Added: 73647 | |
2023-02-03 14:04 | DenisChenu | Bug heat | 0 => 2 |
2023-02-03 14:12 | anonfunc | Note Added: 73649 | |
2023-02-03 14:12 | anonfunc | File Added: Screenshot 2023-02-03 at 14-09-53 CDbException.png | |
2023-02-03 14:12 | anonfunc | Bug heat | 2 => 4 |
2023-02-03 14:41 | DenisChenu | Note Added: 73651 | |
2023-02-03 14:41 | DenisChenu | Note Added: 73652 | |
2023-02-03 18:02 | anonfunc | Note Added: 73660 | |
2023-02-03 18:02 | anonfunc | File Added: CDbException.html | |
2023-02-04 11:43 | DenisChenu | Note Added: 73671 | |
2023-02-04 11:44 | DenisChenu | Note Added: 73672 | |
2023-02-04 11:44 | DenisChenu | Assigned To | => DenisChenu |
2023-02-04 11:44 | DenisChenu | Status | new => assigned |
2023-02-04 12:05 | ollehar | Note Added: 73673 | |
2023-02-04 12:05 | ollehar | Bug heat | 4 => 6 |
2023-02-04 12:25 | DenisChenu | Assigned To | DenisChenu => ollehar |
2023-02-04 12:25 | DenisChenu | Note Added: 73676 | |
2023-02-04 12:26 | DenisChenu | Note Added: 73677 |