Page MenuHomePhabricator

[DBQuery] SQL ERROR: NOT NULL constraint failed: oldimage.oi_metadata
Open, Needs TriagePublic

Description

Problem
When uploading a new version of ZIP file to an existing File: page, DB crashes with exception [DBQuery] SQL ERROR: NOT NULL constraint failed: oldimage.oi_metadata

Log

[DBConnection] Wikimedia\Rdbms\LoadBalancer::openConnection: calling initLB() before first connection.
[DBConnection] Connected to database 0 at 'localhost'.
UploadBase::createFromRequest: class name: UploadFromFile
[Mime] MimeAnalyzer::loadFiles: loading mime types from D:\Wiki\includes/libs/mime/mime.types

[Mime] MimeAnalyzer::loadFiles: loading mime info from D:\Wiki\includes/libs/mime/mime.info

[Mime] MimeAnalyzer::doGuessMimeType: analyzing head and tail of C:\Windows\Temp\phpF9CC.tmp for magic numbers.

[Mime] MimeAnalyzer::doGuessMimeType: ZIP header present in C:\Windows\Temp\phpF9CC.tmp

[Mime] MimeAnalyzer::detectZipType: unable to identify type of ZIP archive

[Mime] MimeAnalyzer::guessMimeType: guessed mime type of C:\Windows\Temp\phpF9CC.tmp: application/zip

[Mime] MimeAnalyzer::improveTypeFromExtension: improved mime type for .zip: application/zip

MediaHandlerFactory::getHandler: no handler found for application/zip.
mime: <application/zip> extension: <zip>
UploadBase::detectScript: checking for embedded scripts and HTML stuff
UploadBase::detectScript: no scripts found
UploadBase::detectVirus: virus scanner disabled
[Mime] MimeAnalyzer::doGuessMimeType: analyzing head and tail of C:\Windows\Temp\phpF9CC.tmp for magic numbers.

[Mime] MimeAnalyzer::doGuessMimeType: ZIP header present in C:\Windows\Temp\phpF9CC.tmp

[Mime] MimeAnalyzer::detectZipType: unable to identify type of ZIP archive

[Mime] MimeAnalyzer::guessMimeType: guessed mime type of C:\Windows\Temp\phpF9CC.tmp: application/zip

[Mime] MimeAnalyzer::improveTypeFromExtension: improved mime type for .zip: application/zip

UploadBase::verifyExtension: mime type application/zip matches extension zip, passing file
UploadBase::verifyFile: all clear; passing.
Title::getRestrictionTypes: applicable restrictions to [[File:Logo Package.zip]] are {edit,move,upload}
[FileOperation] FileBackendStore::getFileStat: File mwstore://local-backend/local-public/archive/b/b9/20180221132749!Logo_Package.zip does not exist.

[DBQuery] SQL ERROR: NOT NULL constraint failed: oldimage.oi_metadata

[exception] [915463c1acb68b4778307394] /wiki/index.php?title=Special%3AUpload   Wikimedia\Rdbms\DBQueryError from line 1149 of D:\Wiki\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: INSERT  INTO oldimage (oi_name,oi_archive_name,oi_size,oi_width,oi_height,oi_bits,oi_timestamp,oi_user,oi_user_text,oi_metadata,oi_media_type,oi_major_mime,oi_minor_mime,oi_sha1,oi_description) VALUES ('Logo_Package.zip','20180221132749!Logo_Package.zip','2871684','0','0','0','20180117081611','1','Master',NULL,'ARCHIVE','application','zip','drwbrj3mkv1ak6zmyqksw0j377ak81p','All variants of logo')
Function: LocalFile::recordUpload2/multi-row
Error: 19 NOT NULL constraint failed: oldimage.oi_metadata

#0 D:\Wiki\includes\libs\rdbms\database\Database.php(979): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#1 D:\Wiki\includes\libs\rdbms\database\Database.php(1589): Wikimedia\Rdbms\Database->query(string, string)
#2 D:\Wiki\includes\libs\rdbms\database\DatabaseSqlite.php(621): Wikimedia\Rdbms\Database->insert(string, array, string, string)
#3 D:\Wiki\includes\libs\rdbms\database\Database.php(2412): Wikimedia\Rdbms\DatabaseSqlite->insert(string, array, string, array)
#4 D:\Wiki\includes\filerepo\file\LocalFile.php(1441): Wikimedia\Rdbms\Database->insertSelect(string, array, array, array, string, array, array, array)
#5 D:\Wiki\includes\filerepo\file\LocalFile.php(1246): LocalFile->recordUpload2(string, string, boolean, array, string, User, array)
#6 D:\Wiki\includes\upload\UploadBase.php(861): LocalFile->upload(string, string, boolean, integer, array, boolean, User, array)
#7 D:\Wiki\includes\specials\SpecialUpload.php(567): UploadBase->performUpload(string, boolean, boolean, User, array)
#8 D:\Wiki\includes\specials\SpecialUpload.php(207): SpecialUpload->processUpload()
#9 D:\Wiki\includes\specialpage\SpecialPage.php(522): SpecialUpload->execute(NULL)
#10 D:\Wiki\includes\specialpage\SpecialPageFactory.php(578): SpecialPage->run(NULL)
#11 D:\Wiki\includes\MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#12 D:\Wiki\includes\MediaWiki.php(851): MediaWiki->performRequest()
#13 D:\Wiki\includes\MediaWiki.php(523): MediaWiki->main()
#14 D:\Wiki\index.php(43): MediaWiki->run()
#15 {main}
User: loading options for user 1 from database.
OutputPage::sendCacheControl: no caching **
Request ended normally
[session] Saving all sessions on shutdown
[DBConnection] Closing connection to database ''.

DB structure

Environment
MW: 1.30 stable
DB: SQLite
PHP: 7.1.14 (windows binaries)
OS: Windows Server 2008 R2

Event Timeline

Restricted Application added projects: Commons, Multimedia. · View Herald TranscriptFeb 21 2018, 2:10 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript