Last modified: 2013-01-18 11:32:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45969, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43969 - The property id to add must be a positive integer
The property id to add must be a positive integer
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Highest major (vote)
: ---
Assigned To: Nischay Nahata
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-14 20:41 UTC by s7eph4n
Modified: 2013-01-18 11:32 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description s7eph4n 2013-01-14 20:41:28 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
Comment 1 Jeroen De Dauw 2013-01-15 08:38:38 UTC
As mentioned on the list, we need to track down where this invalid id is coming from.
Comment 2 Jeroen De Dauw 2013-01-15 08:39:06 UTC
I don't have this error on my wiki, so can't easily look at it myself.
Comment 3 Nischay Nahata 2013-01-15 08:59:46 UTC
Agree with Jeroen, this can be corrected only if able to reproduce. Removing myself as assignee...
Comment 4 Jeroen De Dauw 2013-01-15 09:31:12 UTC
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.
Comment 5 Nischay Nahata 2013-01-15 09:36:06 UTC
> 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
Comment 6 Jeroen De Dauw 2013-01-15 12:19:34 UTC
> 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.
Comment 7 s7eph4n 2013-01-15 14:52:09 UTC
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?
Comment 8 s7eph4n 2013-01-15 14:56:12 UTC
Changing line 258 to
	$updates[$propertyTable->getName()][] = $insertValues;
makes it run again.
Is this also the fix?
Comment 9 Nischay Nahata 2013-01-15 17:51:30 UTC
(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/
Comment 10 Jeroen De Dauw 2013-01-18 11:32:05 UTC
Think this got fixed...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links