Last modified: 2014-10-08 11:45:28 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 T72927, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70927 - With SQLite only first consumer can be created
With SQLite only first consumer can be created
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
OAuth (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: sqlite
  Show dependency treegraph
 
Reported: 2014-09-17 06:49 UTC by Mitar
Modified: 2014-10-08 11:45 UTC (History)
3 users (show)

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


Attachments

Description Mitar 2014-09-17 06:49:24 UTC
For next consumer MediaWiki reports a query error. (Not sure how to get details of it.)
Comment 1 Sam Reed (reedy) 2014-09-17 15:47:28 UTC
If you could set the code below in your LocalSettings, then report back with the actual SQL error, that'd be really helpful

$wgShowSQLErrors = true;
$wgDebugDumpSql  = true;
$wgShowDBErrorBacktrace = true;
Comment 2 Mitar 2014-09-17 15:51:08 UTC
Query:
INSERT INTO oauth_registered_consumer (oarc_id,oarc_consumer_key,oarc_name,oarc_user_id,oarc_version,oarc_callback_url,oarc_callback_is_prefix,oarc_description,oarc_email,oarc_email_authenticated,oarc_wiki,oarc_grants,oarc_registration,oarc_secret_key,oarc_rsa_key,oarc_restrictions,oarc_stage,oarc_stage_timestamp,oarc_deleted) VALUES ('0','9059fa99ba97e07b0c7f1933b9866ff0','Foo','1','1.0','http://localhost',0,'Foo','mitar@example.com','20140917154912','*','["useoauth"]','20140917154912','46dcd00794246f24ebc649acdf2eac55','','{"IPAddresses":["0.0.0.0/0","::/0"]}','0','20140917154912','0')
Function: MediaWiki\Extensions\OAuth\MWOAuthDAO::save/single-row
Error: 19 PRIMARY KEY must be unique

#0 ./Temp/mediawiki-1.23.2/includes/db/Database.php(1123): DatabaseBase->reportQueryError('PRIMARY KEY mus...', 19, 'INSERT  INTO oa...', 'MediaWiki\\Exten...', false)
#1 ./Temp/mediawiki-1.23.2/includes/db/Database.php(1920): DatabaseBase->query('INSERT  INTO oa...', 'MediaWiki\\Exten...')
#2 ./Temp/mediawiki-1.23.2/includes/db/DatabaseSqlite.php(579): DatabaseBase->insert('oauth_registere...', Array, 'MediaWiki\\Exten...', Array)
#3 [internal function]: DatabaseSqlite->insert('oauth_registere...', Array, 'MediaWiki\\Exten...')
#4 ./Temp/mediawiki-1.23.2/includes/db/LoadBalancer.php(1186): call_user_func_array(Array, Array)
#5 ./Temp/OAuth/backend/MWOAuthDAO.php(179): DBConnRef->__call('insert', Array)
#6 ./Temp/OAuth/backend/MWOAuthDAO.php(179): DBConnRef->insert('oauth_registere...', Array, 'MediaWiki\\Exten...')
#7 ./Temp/OAuth/control/MWOAuthConsumerSubmitControl.php(204): MediaWiki\Extensions\OAuth\MWOAuthDAO->save(Object(DBConnRef))
#8 ./Temp/OAuth/control/MWOAuthSubmitControl.php(76): MediaWiki\Extensions\OAuth\MWOAuthConsumerSubmitControl->processAction('propose')
#9 ./Temp/OAuth/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php(193): MediaWiki\Extensions\OAuth\MWOAuthSubmitControl->submit()
#10 [internal function]: MediaWiki\Extensions\OAuth\SpecialMWOAuthConsumerRegistration->MediaWiki\Extensions\OAuth\{closure}(Array, Object(HTMLForm))
#11 ./Temp/mediawiki-1.23.2/includes/htmlform/HTMLForm.php(470): call_user_func(Object(Closure), Array, Object(HTMLForm))
#12 ./Temp/mediawiki-1.23.2/includes/htmlform/HTMLForm.php(412): HTMLForm->trySubmit()
#13 ./Temp/mediawiki-1.23.2/includes/htmlform/HTMLForm.php(427): HTMLForm->tryAuthorizedSubmit()
#14 ./Temp/OAuth/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php(201): HTMLForm->show()
#15 ./Temp/mediawiki-1.23.2/includes/specialpage/SpecialPage.php(379): MediaWiki\Extensions\OAuth\SpecialMWOAuthConsumerRegistration->execute('propose')
#16 ./Temp/mediawiki-1.23.2/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run('propose')
#17 ./Temp/mediawiki-1.23.2/includes/Wiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#18 ./Temp/mediawiki-1.23.2/includes/Wiki.php(588): MediaWiki->performRequest()
#19 ./Temp/mediawiki-1.23.2/includes/Wiki.php(447): MediaWiki->main()
#20 ./Temp/mediawiki-1.23.2/index.php(46): MediaWiki->run()
#21 {main}
Comment 3 Sam Reed (reedy) 2014-09-17 16:08:22 UTC
CREATE UNIQUE INDEX /*i*/oarc_consumer_key
    ON /*_*/oauth_registered_consumer (oarc_consumer_key);
CREATE UNIQUE INDEX /*i*/oarc_name_version_user
    ON /*_*/oauth_registered_consumer (oarc_name,oarc_user_id,oarc_version);



The extensions should handle it better, but it seems like you're reusing something that causes a conflict with the indexes above
Comment 4 Mitar 2014-09-17 16:17:02 UTC
I removed all indexes and it is still failing. I think the issue is that you are explicitly setting oarc_id to '0'. I think it should be NULL to be autogenerated/autoincremented.

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


Navigation
Links