Last modified: 2012-08-04 20:49:12 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 T12620, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10620 - Postgresql: Query failed: ERROR: duplicate key violates unique constraint "image_pkey"
Postgresql: Query failed: ERROR: duplicate key violates unique constraint "i...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.8.x
All Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2007-07-17 23:54 UTC by Joel Osburn
Modified: 2012-08-04 20:49 UTC (History)
1 user (show)

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


Attachments

Description Joel Osburn 2007-07-17 23:54:38 UTC
Clean setup with Postgresql-8.1.9, php-5.2.2

To reproduce:  As a superuser, using Mediawiki, upload an image.  Then try to update the image, either by clicking "Upload" again and specifying a file with the same name, or by going to the image's wiki page and clicking on "Upload a new version of the file".  The following error is generated:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key violates unique constraint "image_pkey" in /var/www/localhost/htdocs/pivotwiki/includes/DatabasePostgres.php on line 381
Internal error

A database error has occurred Query: INSERT INTO image (img_name,img_size,img_width,img_height,img_bits,img_media_type,img_major_mime,img_minor_mime,img_timestamp,img_description,img_user,img_user_text,img_metadata) VALUES ('Logo_blk_on_wht.gif','3801','140','72','8','BITMAP','image','gif','2007-07-17 23:44:17 GMT','','1','Jtosburn','a:0:{}') Function: Image::recordUpload Error: 1 ERROR: duplicate key violates unique constraint "image_pkey"

Backtrace:

#0 /var/www/localhost/htdocs/pivotwiki/includes/Database.php(651): DatabasePostgres->reportQueryError('ERROR: duplica...', 1, 'INSERT INTO im...', 'Image::recordUp...', false)
#1 /var/www/localhost/htdocs/pivotwiki/includes/Database.php(1251): Database->query('INSERT INTO im...', 'Image::recordUp...')
#2 /var/www/localhost/htdocs/pivotwiki/includes/DatabasePostgres.php(498): Database->insert('image', Array, 'Image::recordUp...', Array)
#3 /var/www/localhost/htdocs/pivotwiki/includes/Image.php(1605): DatabasePostgres->insert('image', Array, 'Image::recordUp...', 'IGNORE')
#4 /var/www/localhost/htdocs/pivotwiki/includes/SpecialUpload.php(434): Image->recordUpload('20070717234417!...', '', '', '', '', false)
#5 /var/www/localhost/htdocs/pivotwiki/includes/SpecialUpload.php(234): UploadForm->processUpload()
#6 /var/www/localhost/htdocs/pivotwiki/includes/SpecialUpload.php(15): UploadForm->execute()
#7 /var/www/localhost/htdocs/pivotwiki/includes/SpecialPage.php(522): wfSpecialUpload(NULL, Object(SpecialPage))
#8 /var/www/localhost/htdocs/pivotwiki/includes/SpecialPage.php(391): SpecialPage->execute(NULL)
#9 /var/www/localhost/htdocs/pivotwiki/includes/Wiki.php(156): SpecialPage::executePath(Object(Title))
#10 /var/www/localhost/htdocs/pivotwiki/includes/Wiki.php(47): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#11 /var/www/localhost/htdocs/pivotwiki/index.php(47): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#12 {main}
Comment 1 Greg Sabino Mullane 2007-07-18 00:24:30 UTC
Fairly sure this has been fixed already in newer versions: please try out 1.10 and see if the problem still occurs.

Comment 2 Joel Osburn 2007-07-18 03:28:47 UTC
Indeed, you are correct;  1.10 does not exhibit this behavior.  Perhaps my bugzilla search skills need work.  Thanks very much for your quick response, and my apologies for wasting your time.  I'll post a bug in my distro's (Gentoo) bugzilla advocating moving 1.10 to stable status.

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


Navigation
Links