View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
16179Bug reportsInstallationpublic2020-04-28 10:12
ReporterBastianMuc Assigned Topstelling  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.2.0 
Summary16179: Update 3.20.2 -> 4.2.0 running into database error
Description

Hi,

I tried to update my existing installation version 3.20.2+191119 to version 4.2.0+200422.

For doing so, I followed the process described here:
https://manual.limesurvey.org/Upgrading_from_a_previous_version

After having copied the new version's files, I've opened the admin page and started the database update. The update then runs into following error (translated):

An error occurred during the database update. Error information:
Property "SurveysGroupsettings.ipanonymize is not defined.
File SurveysGroupsettings.php, Line 440.

Please fix the error in your database and try again.

When trying to restart the DB update, I can see it's trying to update from 403 to 426, whereas restarting the DB update consistently leads to the same result.

Thanks,
Bastian

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)4.2.0+200422
I will donate to the project if issue is resolvedNo
BrowserChrome 80.0.3987.163
Database type & versionMariaDB / mysql / mysqlnd 5.0.12-dev - 20150407
Server OS (if known)Debian 4.19.67
Webserver software & version (if known)Apache
PHP Version7.0.33

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2020-04-24 12:52

administrator   ~57357

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

BastianMuc

BastianMuc

2020-04-24 13:04

reporter   ~57358

Here you are:

CException
Eigenschaft "SurveysGroupsettings.ipanonymize ist nicht definiert.

/home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/db/ar/CActiveRecord.php(162)

150 This method is overridden so that AR attributes can be accessed like properties.
151
@param string $name property name
152 @param mixed $value property value
153
@throws CException
154 */
155 public function set($name,$value)
156 {
157 if($this->setAttribute($name,$value)===false)
158 {
159 if(isset($this->getMetaData()->relations[$name]))
160 $this->_related[$name]=$value;
161 else
162 parent::set($name,$value);
163 }
164 }
165
166 /*
167
Checks if a property value is null.
168 This method overrides the parent implementation by checking
169
if the named attribute is null or not.
170 @param string $name the property name or the event name
171
@return boolean whether the property value is null
172 */
173 public function
isset($name)
174 {
Stack Trace
#0
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/db/ar/CActiveRecord.php(162): CComponent->__set("ipanonymize", "I")
157 if($this->setAttribute($name,$value)===false)
158 {
159 if(isset($this->getMetaData()->relations[$name]))
160 $this->_related[$name]=$value;
161 else
162 parent::
set($name,$value);
163 }
164 }
165
166 /*
167
Checks if a property value is null.
#1
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/models/SurveysGroupsettings.php(440): CActiveRecord->__set("ipanonymize", "I")
435 $this->format = 'I';
436 foreach ($this->optionAttributesInteger as $attribute){
437 $this->$attribute = -1;
438 }
439 foreach ($this->optionAttributesChar as $attribute){
440 $this->$attribute = 'I';
441 }
442 foreach ($this->optionAttributesText as $attribute){
443 $this->$attribute = 'inherit';
444 }
445 }
#2
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/helpers/update/updatedb_helper.php(3575): SurveysGroupsettings->setToInherit()
3570
3571 $oDB->createCommand()->insert("{{surveys_groupsettings}}", $attributes);
3572
3573 // insert settings for default survey group
3574 $settings2 = new SurveysGroupsettings;
3575 $settings2->setToInherit();
3576 $settings2->gsid = 1;
3577
3578 // Quick hack to remote ipanonymize.
3579 // TODO: Don't use models in updatedb_helper. ok
3580 $attributes = $settings2->attributes;
#3
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/helpers/update/updatedb_helper.php(2672): createSurveysGroupSettingsTable(DbConnection)
2667 /
2668 Add sureys_groupsettings table and update settings_global table
2669
/
2670 if ($iOldDBVersion < 404) {
2671 $oTransaction = $oDB->beginTransaction();
2672 createSurveysGroupSettingsTable($oDB);
2673 $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>404),"stg_name='DBVersion'");
2674 $oTransaction->commit();
2675 }
2676
2677 // In case any LS4 user missed database update from version 356.
#4
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/helpers/update/update_helper.php(31): db_upgrade_all(359)
26 Yii::app()->loadHelper('update/updatedb');
27 if (isset($subaction) && $subaction == "yes") {
28 $header = Yii::app()->getController()->_getAdminHeader(false, true);
29 $header = preg_replace('/<###begin###>/', '', $header);
30 echo $header;
31 $result = db_upgrade_all(intval($currentDBVersion));
32 if ($result) {
33 $data =
34 '<div class="jumbotron message-box">'.
35 '<h2 class="">'.gT('Success').'</h2>'.
36 '<p class="lead">'.
#5
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/controllers/admin/databaseupdate.php(40): CheckForDBUpgrades("yes")
35 public function db($continue = null)
36 {
37 Yii::app()->loadHelper("update/update");
38 $aData = $aViewUrls = [];
39 if (isset($continue) && $continue == "yes") {
40 $aViewUrls['output'] = CheckForDBUpgrades($continue);
41 $aData['display']['header'] = false;
42 } else {
43 $aData['display']['header'] = true;
44 $aViewUrls['output'] = CheckForDBUpgrades();
45 }
#6
unknown(0): databaseupdate->db("yes")
#7
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(databaseupdate, array("yes"))
104 elseif($param->isDefaultValueAvailable())
105 $ps[]=$param->getDefaultValue();
106 else
107 return false;
108 }
109 $method->invokeArgs($object,$ps);
110 return true;
111 }
112 }
#8
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(databaseupdate, ReflectionMethod, array("continue" => "yes", "sa" => "db"))
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
#9
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("continue" => "yes", "sa" => "db"))
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;
#10
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/CController.php(286): CController->runAction(databaseupdate)
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();
#11
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/CController.php(265): CController->runActionWithFilters(databaseupdate, array())
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);
#12
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/application/controllers/AdminController.php(180): CController->run("databaseupdate")
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

#13
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/CWebApplication.php(282): AdminController->run("databaseupdate")
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)));
#14
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/databaseupdate/sa/db")
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.
#15
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/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 /*
#16
– /home/pacs/moo00/users/giga/doms/umfragen.gemeinsam-in-garching.de/htdocs-ssl/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 */

ollehar

ollehar

2020-04-24 15:44

administrator   ~57359

Can you checkout the branch "bug/16179-error-when-updating-db-from-403-to-426" and try again? It contains a fix to your issue. Thank you.

BastianMuc

BastianMuc

2020-04-24 18:44

reporter   ~57363

Confirming fix, positively tested.

pstelling

pstelling

2020-04-27 09:20

developer   ~57375

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

lime_release_bot

lime_release_bot

2020-04-28 10:12

administrator   ~57416

Fixed in Release 4.2.1+200428

Related Changesets

LimeSurvey: master c7cfa9ee

2020-04-24 15:15:07

pstelling

Details Diff
Fixed issue 16179: Update 3.20.2 -> 4.2.0 running into database error Affected Issues
16179
mod - application/helpers/update/updatedb_helper.php Diff File
mod - application/models/SurveysGroupsettings.php Diff File

Issue History

Date Modified Username Field Change
2020-04-24 12:22 BastianMuc New Issue
2020-04-24 12:52 ollehar Note Added: 57357
2020-04-24 12:59 ollehar Status new => feedback
2020-04-24 13:04 BastianMuc Note Added: 57358
2020-04-24 13:04 BastianMuc Status feedback => new
2020-04-24 14:26 ollehar Assigned To => ollehar
2020-04-24 14:26 ollehar Status new => assigned
2020-04-24 14:27 ollehar Assigned To ollehar => pstelling
2020-04-24 15:44 ollehar Note Added: 57359
2020-04-24 18:44 BastianMuc Note Added: 57363
2020-04-27 09:20 pstelling Changeset attached => LimeSurvey master c7cfa9ee
2020-04-27 09:20 pstelling Note Added: 57375
2020-04-27 09:20 pstelling Resolution open => fixed
2020-04-27 10:56 ollehar Status assigned => resolved
2020-04-28 10:12 lime_release_bot Note Added: 57416
2020-04-28 10:12 lime_release_bot Status resolved => closed