core icon indicating copy to clipboard operation
core copied to clipboard

MDB2 Error: null value violates not-null constraint

Open ghost opened this issue 13 years ago • 26 comments

System environment:

IIS 7.5 on Server 2008 R2, PHP 5.4.22 using Wincache ext., MySQL 5.6

MDB2 Error occures intermittendly but regularly. The context varies:

{"app":"hook","message":"error while running hook (\OC\Files\Cache\Shared_Updater::writeHook): Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""]","level":3,"time":"2013-11-15T10:48:06+00:00"}

{"app":"hook","message":"error while running hook (\OC\Files\Cache\Updater::writeHook): Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""]","level":3,"time":"2013-11-15T08:11:03+00:00"}

{"app":"PHP","message":"Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""] at E:\Programme\owncloud\lib\db.php#1073","level":4,"time":"2013-11-15T08:59:27+00:00"}

ghost avatar Nov 17 '13 12:11 ghost

Same error, now with a module reference:

{"app":"PHP","message":"Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""] at E:\Programme\owncloud\lib\db.php#1073","level":4,"time":"2013-11-18T08:18:58+00:00"}

ghost avatar Nov 18 '13 18:11 ghost

@ringmaster is this a known issue ?

PVince81 avatar Nov 19 '13 09:11 PVince81

This error means "I tried to write a null value into a column that is defined as not allowing null." Since the database is MySQL and not MSSQL, I think may not be limited to a Windows-specific issue. That said, I certainly don't know anything about it.

Is there any symptom to the issue? What is the operation in progress when the issue occurs? On what page is the error seen? These errors are clearly from the log; is there anything displayed on screen?

A full error report would be useful.

ringmaster avatar Nov 20 '13 13:11 ringmaster

After upgrading the Windows client from 1.4.1 to 1.4.2, I also have this problem. Very annoying, this software

  • MySQL server database
  • LINUX server
  • ownCloud 5.0.13 (aktuell)
Could not execute statement, 
Root cause:-29: 
MDB2 Error: null value violates not-null constraint, params: [""] at /srv/owncloud/lib/db.php#1073 

Wikinaut avatar Nov 29 '13 00:11 Wikinaut

@karlitschek please assist.

Wikinaut avatar Nov 29 '13 00:11 Wikinaut

Client message:

CSync Verarbeitungsschritt:
Aktualisierung fehlgeschlagen.
Systemnachricht 500 Internal Server Error 

Server Apache stop / start : no effect

Wikinaut avatar Nov 29 '13 00:11 Wikinaut

@karlitschek please assist

Wikinaut avatar Nov 29 '13 00:11 Wikinaut

for some reasons this happened after I uploaded (unsuccessfully, but the file exists then on my server) a file ownCloud-1.4.2-setup.exe to my folder "\owncloud clients".

Navigating with the browser web client to the subdirectoy "\owncloud clients" shows an empty screen!

After deleting the file manually on the server, the error disappeared.

The issue is reproducible. Virus in the exe ?

Wikinaut avatar Nov 29 '13 01:11 Wikinaut

The filesize and sha1/md5 hash of the uploaded file (checked at the server) are correct, the file was correctly uploaded to the /owncloud/data subdirectoy on the server, but we have this error at the Windows client 1.4.1, see screenshot .

Android client shows: "Synchronisation fehlgeschlagen"

After deleting the file manually on the client and on the server, the error disappeared.

The issue is strictly reproducible. Filesize is ~18MB.

Wikinaut avatar Nov 29 '13 07:11 Wikinaut

further analysis shows, that

  • upload of this file using the web client: same results (after upload, the sync failed)
  • after upload, trying to access the directory "/owncloud clients" results in empty server response to https://server/owncloud/index.php/apps/files?dir=//owncloud%20clients
  • Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""] at /srv/owncloud/lib/db.php#1073
  • upload of different (much bigger) file ~40MB works
  • fully reproducible

Wikinaut avatar Nov 29 '13 07:11 Wikinaut

@DeepDiver1975 @bartv2 Any idea?

karlitschek avatar Nov 29 '13 09:11 karlitschek

@Wikinaut @adapter could you add

$orig_stmt = $stmt;

after the line with

static public function executeAudited

this is around line 440 in lib/db.php and change

self::raiseExceptionOnError($result, 'Could not execute statement', $parameters);

around line 468, to

self::raiseExceptionOnError($result, 'Could not execute statement'.var_export($orig_stmt, true), $parameters);

and report the results here?

bartv2 avatar Nov 29 '13 20:11 bartv2

@bartv2:

After having uploaded (the file now being present on the server!) a small *.exe file Checksum-windows-kb841290-x86-enu.exe , I got these log lines (be reminded: previously, with older oc server and client versions, I could upload *.exe files without any problem)

{"app":"hook","message":"error while running hook (\\OC\\Files\\Cache\\Updater::writeHook): 
Could not execute statement'INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)', 
Root cause:-29: MDB2 Error: null value violates not-null constraint, 
params: [\"\"]","level":3,"time":"2013-11-29T20:13:29+00:00"}

{"app":"hook","message":"error while running hook (\\OC\\Files\\Cache\\Shared_Updater::writeHook):
Could not execute statement'INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)',
Root cause:-29: MDB2 Error: null value violates not-null constraint, 
params: [\"\"]","level":3,"time":"2013-11-29T20:13:29+00:00"}

Wikinaut avatar Nov 29 '13 20:11 Wikinaut

I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

jancborchardt avatar Feb 26 '14 12:02 jancborchardt

Still an issue with 5.0.14a. @DeepDiver1975 @bartv2

felixboehm avatar Mar 04 '14 14:03 felixboehm

I am experiencing blank pages with ownCloud Enterprise Edition 5.0.14a.

System Environment: RedHat 6.5 - PHP 5.5.7 - MySQL 5.5.17 - Apache 2.2.15.

I get a blank page when I browse to a folder containing a file that has a .exe extension. This happens regardless on how the .exe file was uploaded, through the browser or through the ownCloud sync app and with any browser on any OS (Mac OSX, Windows, UBUNTU, etc.)

I also get a blank page if I go to my folder through a terminal session and rename any file by giving it a .exe extension.

The error message on the own cloud log when browsing to a folder containing a .exe file is:

{"app":"PHP","message":"Could not execute statement, Root cause:-29: MDB2 Error: null value violates not-null constraint, params: [""] at /var/www/owncloud/lib/db.php#1093","level":4,"time":"2014-03-03T13:43:05+00:00"}

My config.php is:

'5134e0be2ac1c', 'passwordsalt' => '*** Removed for security reasons', 'datadirectory' => '/box_data/', 'dbtype' => 'mysql', 'version' => '5.0.28', 'dbname' => 'XXXXXXXXXX', 'dbhost' => 'XXXXXXXXX', 'dbtableprefix' => 'oc_', 'dbuser' => 'XXXXXXXXXX', 'dbpassword' => 'XXXXXXX', 'installed' => true, 'ldapIgnoreNamingRules' => false, 'loglevel' => '0', 'mail_smtpmode' => 'smtp', 'mail_smtphost' => 'smtprelay.XXX.XXX.XXX', 'mail_smtpauth' => false, 'theme' => '', 'maintenance' => false, );

eliorusso avatar Mar 05 '14 09:03 eliorusso

@icewind1991 @bantu Can you look into that?

karlitschek avatar Mar 07 '14 17:03 karlitschek

please retest with 5.0.15. That contains a fix for empty mimetypes: https://github.com/owncloud/core/pull/6821

butonic avatar Apr 11 '14 12:04 butonic

ping

karlitschek avatar Apr 22 '14 12:04 karlitschek

We are running a production server, I haven't been able to upgrade it to 5.0.15 as suggested yet. I will try to do it soon.

eliorusso avatar Apr 22 '14 13:04 eliorusso