Last modified: 2013-01-18 11:32:05 UTC
I got the below error first when after changing a template I ran runJobs.php to update all affectted pages. Since I was not completely sure that I updated to the new store correctly, I repeated the upgrade steps on [1] and got until the first call to SMW_refreshData when I got the error again. Did I miss some setting? Is there a workaround? (143) Processing ID 208 ... The property id to add must be a positive integer Backtrace: #0 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\PropertyStatisticsTable.php(113): SMW\SQLStore\PropertyStatisticsTable->addToUsageCount('', 3) #1 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3_Writers.php(464): SMW\SQLStore\PropertyStatisticsTable->addToUsageCounts(Array) #2 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3_Writers.php(158): SMWSQLStore3Writers->writePropertyTableUpdates(77, Array, Array, Array, Object(DatabaseMysql)) #3 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3_Writers.php(85): SMWSQLStore3Writers->doFlatDataUpdate(Object(SMWSemanticData), Object(DatabaseMysql)) #4 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3.php(333): SMWSQLStore3Writers->doDataUpdate(Object(SMWSemanticData)) #5 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SMW_Store.php(234): SMWSQLStore3->doDataUpdate(Object(SMWSemanticData)) #6 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\SMW_ParseData.php(374): SMWStore->updateData(Object(SMWSemanticData)) #7 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\jobs\SMW_UpdateJob.php(64): SMWParseData::storeData(Object(ParserOutput), Object(Title), false) #8 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3_SetupHandlers.php(390): SMWUpdateJob->run() #9 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\includes\storage\SQLStore\SMW_SQLStore3.php(404): SMWSQLStore3SetupHandlers->refreshData('208', 1, Array, false) #10 C:\xampp\htdocs\w\extensions\SemanticMediaWiki\maintenance\SMW_refreshData.php(147): SMWSQLStore3->refreshData('208', 1, Array, false) #11 {main} MediaWiki 1.21alpha (d725901) PHP 5.3.10-1ubuntu3.4 (apache2handler) MySQL 5.5.28-0ubuntu0.12.04.3 Semantic MediaWiki (Version 1.9 alpha) (5f3aebc) DataValues (Version 0.1 alpha) (43a5883) Validator (ParamProcessor) (Version 1.0 alpha) (1a1d502) [1] http://semantic-mediawiki.org/wiki/Help:Installation#Upgrading_existing_installations
As mentioned on the list, we need to track down where this invalid id is coming from.
I don't have this error on my wiki, so can't easily look at it myself.
Agree with Jeroen, this can be corrected only if able to reproduce. Removing myself as assignee...
Changing a value on http://www.semantic-mediawiki.org/w/index.php?title=Demo:Event_calendar:2012/09/14&action=edit will do the trick. Nischay, I would be very happy if you could have a look at it.
> Nischay, I would be very happy if you could have a look at it. You shouldn't have made that merge so quickly. I can't review this until I see it on a wiki I have server access to
> You shouldn't have made that merge so quickly. There is still at least one serious issue in the code. Pointing fingers is not very constructive and makes people feel not very appreciated.
Seems to originate in SMWSQLStore3Writers. line 158: deleteRows and insertRows seem to be interchanged w.r.t. the method declaration. Does not matter though, they are interchanged on line 157, too. The real problem seems to be somewhere in SMWSQLStore3Writers::preparePropertyTableInserts or somewhere along its calling chain. A var_dump($updates) just before the return returns something that looks like an array relating table names to rows. I would expect an array relating table names to arrays of rows. array(2) { 'smw_di_wikipage' => array(3) { 's_id' => int(51) 'p_id' => int(22) 'o_id' => int(1) } 'smw_fpt_mdat' => array(3) { 's_id' => int(51) 'o_serialized' => string(18) "1/2010/8/12/8/23/4" 'o_sortkey' => double(2455420.8493519) } } This leads in writePropertyTableRowUpdates to $row being a scalar (int or string or double or whatever), $pid = $row['p_id'] therefore being NULL, which is finally in line 515 transformed into an array key of "". Does that help?
Changing line 258 to $updates[$propertyTable->getName()][] = $insertValues; makes it run again. Is this also the fix?
(In reply to comment #8) > Changing line 258 to > $updates[$propertyTable->getName()][] = $insertValues; > makes it run again. > Is this also the fix? I think one more change is needed, see https://gerrit.wikimedia.org/r/#/c/44073/
Think this got fixed...