View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
16251Bug reportsInstallationpublic2020-06-22 23:00
Reportercaitifty Assigned Tocdorin  
PrioritynoneSeveritypartial_block 
Status closedResolutionreopened 
Product Version4.2.2 
Fixed in Version4.3.1 
Summary16251: 4.2.2 stable release will not work with mysql 8.0.20, the default with Ubuntu 20.04 LTS
Description

The new (23 April 2020) 20.04 LTS release of ubuntu installs mysql 8.0.20 by default. As noted in previous issue 13010, 'group' is a reserved codeword in mysql 8.0+ leading to the following error on basic operations such as creating a new survey:

500: Internal Server Error
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups g JOIN questions q on q.gid=g.gid JOIN group_l10ns gls on gls.gid=g.gid ' at line 1

Steps To Reproduce

Install limesurvey 4.2.2 on a fresh install of ubuntu 20.04 LTS with mysql as the selected database. After logging in, create new survey, click save -> the error above will appear.

Additional Information

Cannot reproduce it (same system ; default ubuntu 20.04) -> could you please try once more the latest release?

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)limesurvey4.2.2+200504
I will donate to the project if issue is resolvedYes
BrowserFirefox but identical error on vivaldi
Database type & versionmysql 8.0.20
Server OS (if known)ubuntu 20.04
Webserver software & version (if known)apache 2.4.41
PHP Version7.4.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2020-05-11 09:36

administrator   ~57650

Can you enable debug = 2 in application/config/config.php and try again, please? Paste the complete error message here.

caitifty

caitifty

2020-05-11 21:23

reporter   ~57691

Last edited: 2020-05-29 13:57

Here's the output from clicking 'create new survey', entering 'test' in the survey title, and clicking 'save'.

Many thanks!

--

CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups g JOIN questions q on q.gid=g.gid JOIN group_l10ns gls on gls.gid=g.gid ' at line 1. The SQL statement executed was: SELECT g., q., gls., qls., qa.attribute, qa.value FROM groups g JOIN questions q on q.gid=g.gid JOIN group_l10ns gls on gls.gid=g.gid JOIN question_l10ns qls on qls.qid=q.qid LEFT JOIN question_attributes qa ON qa.qid=q.qid AND qa.attribute='question_template' WHERE qls.language='en' and gls.language='en' AND g.sid=366299 AND q.parent_qid=0 ORDER BY group_order, question_order

/var/www/test.overdoseresearch.org/limesurvey/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
#0
+
/var/www/test.overdoseresearch.org/limesurvey/framework/db/CDbCommand.php(396): CDbCommand->queryInternal()
#1

/var/www/test.overdoseresearch.org/limesurvey/application/helpers/common_helper.php(1393): CDbCommand->queryAll()

1388 if ($questionid !== false) {
1389 $aquery .= " and questions.qid={$questionid} ";
1390 }
1391 $aquery .= " ORDER BY group_order, question_order";
1392 /* @var Question[] $questions /
1393 $questions = Yii::app()->db->createCommand($aquery)->queryAll();
1394 $questionSeq = -1; // this is incremental question sequence across all groups
1395 $groupSeq = -1;
1396 $_groupOrder = -1;
1397
1398 foreach ($questions as $arow) {

#2

/var/www/test.overdoseresearch.org/limesurvey/application/helpers/expressions/em_manager_helper.php(3654): createFieldMap()

3649 if(empty($this->surveyOptions)) {
3650 / Log it as error : this need some test /
3651 Yii::log('setVariableAndTokenMappingsForExpressionManager with an empty surveyOptions.','error','application.LimeExpressionManager');
3652 }
3653 // TODO - do I need to force refresh, or trust that createFieldMap will cache langauges properly?
3654 $fieldmap=createFieldMap($survey,$style='full',$forceRefresh,false,$SESSION['LEMlang']);
3655 $this->sid= $surveyid;
3656 $this->sessid = 'survey
' . $this->sid;
3657 $this->runtimeTimings[] = array(METHOD . '.createFieldMap',(microtime(true) - $now));
3658 // LimeExpressionManager::ShowStackTrace();
3659

#3

/var/www/test.overdoseresearch.org/limesurvey/application/helpers/expressions/em_manager_helper.php(4967): LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager()

4962 $LEM->em->StartProcessingGroup(
4963 isset($_SESSION['LEMsid']) ? $_SESSION['LEMsid'] : NULL,
4964 '',
4965 true
4966 );
4967 $LEM->setVariableAndTokenMappingsForExpressionManager($_SESSION['LEMsid']);
4968 }
4969
4970 }
4971
4972 /**

#4

/var/www/test.overdoseresearch.org/limesurvey/application/controllers/admin/surveyadmin.php(487): LimeExpressionManager::StartProcessingPage()

482
483 // Reinit LEMlang and LEMsid: ensure LEMlang are set to default lang, surveyid are set to this survey id
484 // Ensure Last GetLastPrettyPrintExpression get info from this sid and default lang
485 LimeExpressionManager::SetEMLanguage($baselang);
486 LimeExpressionManager::SetSurveyId($iSurveyID);
487 LimeExpressionManager::StartProcessingPage(false, true);
488
489 $aData['title_bar']['title'] = $survey->currentLanguageSettings->surveyls_title." (".gT("ID").":".$iSurveyID.")";
490 $aData['surveyid'] = $iSurveyID;
491 $aData['display']['surveysummary'] = true;
492

#5
unknown(0): SurveyAdmin->view()
#6

/var/www/test.overdoseresearch.org/limesurvey/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs()

104 elseif($param->isDefaultValueAvailable())
105 $ps[]=$param->getDefaultValue();
106 else
107 return false;
108 }
109 $method->invokeArgs($object,$ps);
110 return true;
111 }
112 }

#7

/var/www/test.overdoseresearch.org/limesurvey/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal()

81 $oMethod = new ReflectionMethod($this, $sDefault);
82 }
83
84 // We're all good to go, let's execute it
85 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
86 return parent::runWithParamsInternal($this, $oMethod, $params);
87 }
88
89 /*
90
Some functions have different parameters, which are just an alias of the
91 * usual parameters we're getting in the url. This function just populates

#8

/var/www/test.overdoseresearch.org/limesurvey/framework/web/CController.php(308): Survey_Common_Action->runWithParams()

303 {
304 $priorAction=$this->_action;
305 $this->_action=$action;
306 if($this->beforeAction($action))
307 {
308 if($action->runWithParams($this->getActionParams())===false)
309 $this->invalidActionParams($action);
310 else
311 $this->afterAction($action);
312 }
313 $this->_action=$priorAction;

#9

/var/www/test.overdoseresearch.org/limesurvey/framework/web/CController.php(286): CController->runAction()

281 @see runAction
282
/
283 public function runActionWithFilters($action,$filters)
284 {
285 if(empty($filters))
286 $this->runAction($action);
287 else
288 {
289 $priorAction=$this->_action;
290 $this->_action=$action;
291 CFilterChain::create($this,$action,$filters)->run();

#10

/var/www/test.overdoseresearch.org/limesurvey/framework/web/CController.php(265): CController->runActionWithFilters()

260 {
261 if(($parent=$this->getModule())===null)
262 $parent=Yii::app();
263 if($parent->beforeControllerAction($this,$action))
264 {
265 $this->runActionWithFilters($action,$this->filters());
266 $parent->afterControllerAction($this,$action);
267 }
268 }
269 else
270 $this->missingAction($actionID);

#11

/var/www/test.overdoseresearch.org/limesurvey/application/controllers/AdminController.php(180): CController->run()

175 }
176
177 $this->runModuleController($action);
178
179
180 return parent::run($action);
181 }
182
183 /*
184
Starting with LS4, 3rd party developper can extends any of the LimeSurve controllers.
185 *

#12

/var/www/test.overdoseresearch.org/limesurvey/framework/web/CWebApplication.php(282): AdminController->run()

277 {
278 list($controller,$actionID)=$ca;
279 $oldController=$this->_controller;
280 $this->_controller=$controller;
281 $controller->init();
282 $controller->run($actionID);
283 $this->_controller=$oldController;
284 }
285 else
286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
287 array('{route}'=>$route===''?$this->defaultController:$route)));

#13

/var/www/test.overdoseresearch.org/limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController()

136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
137 $_GET[$name]=$value;
138 }
139 else
140 $route=$this->getUrlManager()->parseUrl($this->getRequest());
141 $this->runController($route);
142 }
143
144 /*
145
Registers the core application components.
146 * This method overrides the parent implementation by registering additional core components.

#14

/var/www/test.overdoseresearch.org/limesurvey/framework/base/CApplication.php(185): CWebApplication->processRequest()

180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /**

#15

/var/www/test.overdoseresearch.org/limesurvey/index.php(182): CApplication->run()

177 require_once APPPATH . 'core/LSYii_Application' . EXT;
178
179 $config = require_once(APPPATH . 'config/internal' . EXT);
180
181 Yii::$enableIncludePath = false;
182 Yii::createApplication('LSYii_Application', $config)->run();
183
184 / End of file index.php /
185 / Location: ./index.php /

2020-05-11 12:19:47 Apache/2.4.41 (Ubuntu) Yii Framework/1.1.22-dev

DenisChenu

DenisChenu

2020-05-12 07:59

developer   ~57693

Last edited: 2020-05-29 13:57

I start to always use https://www.yiiframework.com/doc/api/1.1/CDbConnection#quoteColumnName-detail even when not really readed (submitddate, id, stardate , language …)

Think it's a good idea ;)

ollehar

ollehar

2020-05-12 09:36

administrator   ~57695

Last edited: 2020-05-29 13:57

@DenisChenu The stacktrace mentions the event handler.

ollehar

ollehar

2020-05-12 09:47

administrator   ~57696

Last edited: 2020-05-29 13:57

Nah, never mind.

caitifty

caitifty

2020-05-16 19:57

reporter   ~57852

Last edited: 2020-05-29 13:57

I have a workaround for anyone else trying to get limesurvey working on a stock ubuntu 20.04: instead of installing the default mysql, install the default mariadb (10.3.22) instead. Same 'steps to reproduce' given above will no longer produce errors.

cdorin

cdorin

2020-05-29 16:37

reporter   ~58100

weird, i couldn't reproduce it with the latest version (latest master). Anybody else can test on ubuntu 20.04? with default config?

DenisChenu

DenisChenu

2020-06-04 10:35

developer   ~58169

@cdorin : https://forums.limesurvey.org/forum/design-issues/121435-internal-server-error-when-i-try-to-create-a-new-survey#200567

Are you sure you setup mysql and not mariadb ?

cdorin

cdorin

2020-06-22 23:00

reporter   ~58385

Ok, it should be solved in 4.3.1 (at least partially). The more issues reported (+ context how to reproduce them), the better. Therefore, I will close this one.

Issue History

Date Modified Username Field Change
2020-05-09 20:07 caitifty New Issue
2020-05-11 09:36 ollehar Assigned To => ollehar
2020-05-11 09:36 ollehar Status new => feedback
2020-05-11 09:36 ollehar Note Added: 57650
2020-05-11 21:23 caitifty Note Added: 57691
2020-05-11 21:23 caitifty Status feedback => assigned
2020-05-12 07:59 DenisChenu Note Added: 57693
2020-05-12 09:36 ollehar Note Added: 57695
2020-05-12 09:47 ollehar Note Added: 57696
2020-05-16 19:57 caitifty Note Added: 57852
2020-05-17 15:32 cdorin Assigned To ollehar =>
2020-05-17 15:32 cdorin Status assigned => confirmed
2020-05-17 15:32 cdorin Zoho Sprints => |Yes|
2020-05-17 15:33 swendrich Zoho Sprints ID => 14469000000093001
2020-05-29 13:57 swendrich Zoho Sprints Yes => |Yes|
2020-05-29 13:57 swendrich Status confirmed => resolved
2020-05-29 15:30 cdorin Assigned To => cdorin
2020-05-29 15:30 cdorin Status resolved => feedback
2020-05-29 15:30 cdorin Resolution open => reopened
2020-05-29 15:30 cdorin Additional Information Updated
2020-05-29 15:30 cdorin Zoho Sprints Yes => |Yes|
2020-05-29 16:37 cdorin Note Added: 58100
2020-06-04 10:35 DenisChenu Note Added: 58169
2020-06-17 10:47 c_schmitz Assigned To cdorin => c_schmitz
2020-06-22 23:00 cdorin Assigned To c_schmitz => cdorin
2020-06-22 23:00 cdorin Status feedback => closed
2020-06-22 23:00 cdorin Fixed in Version => 4.3.1
2020-06-22 23:00 cdorin Note Added: 58385