Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Fatal Error in class.database.php

edited December 2015 in Vanilla 2.0 - 2.8

Hello there,
I've got a fresh installation of Vanilla 2.2 without any Users, Discussions or Plugins enabled but when I try to edit for example the Roles&Permissions or the Categories I get a fatal error. I enabled debug-Mode in my config.php and this is the Message I get:

Fatal Error in PHP.trigger_error();

The error occurred on or near: /srv/www/xxxxxde/vanilla/library/database/class.database.php
418:                     $this->closeConnection();
419:                     continue;
420:                 }
421: 
422:                 trigger_error($message, E_USER_ERROR);
423:             }
424: 
425:         }
426: 


Backtrace:
/srv/www/xxxxxde/vanilla/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/srv/www/xxxxxde/vanilla/library/database/class.database.php:422] PHP::trigger_error();
[/srv/www/xxxxxde/vanilla/library/database/class.sqldriver.php:1663] Gdn_Database->query();
[/srv/www/xxxxxde/vanilla/library/database/class.sqldriver.php:1083] Gdn_SQLDriver->query();
[/srv/www/xxxxxde/vanilla/library/core/class.model.php:272] Gdn_SQLDriver->insert();
[/srv/www/xxxxxde/vanilla/applications/vanilla/models/class.categorymodel.php:1715] Gdn_Model->insert();
[/srv/www/xxxxxde/vanilla/library/core/class.form.php:2224] CategoryModel->save();
[/srv/www/xxxxxde/vanilla/applications/vanilla/controllers/class.settingscontroller.php:292] Gdn_Form->save();
[/srv/www/xxxxxde/vanilla/applications/vanilla/controllers/class.settingscontroller.php:292] SettingsController->addCategory();
[/srv/www/xxxxxde/vanilla/library/core/class.dispatcher.php:329] PHP::call_user_func_array();
[/srv/www/xxxxxde/vanilla/index.php:44] Gdn_Dispatcher->dispatch();


Variables in local scope:
[Sql] 'insert GDN_Category 
(`UrlCode`, `AllowDiscussions`, `Name`, `Description`, `InsertUserID`, `UpdateUserID`, `DateInserted`, `DateUpdated`, `AllowFileUploads`) 
values (:UrlCode, :AllowDiscussions, :Name, :Description, :InsertUserID, :UpdateUserID, :DateInserted, :DateUpdated, :AllowFileUploads)'
[InputParameters] array (
  ':UrlCode' => 'test',
  ':AllowDiscussions' => '1',
  ':Name' => 'test',
  ':Description' => 'test',
  ':InsertUserID' => '2',
  ':UpdateUserID' => '2',
  ':DateInserted' => '2015-12-12 15:35:35',
  ':DateUpdated' => '2015-12-12 15:35:35',
  ':AllowFileUploads' => false,
)
[Options] array (
  'Type' => 'insert',
  'Slave' => NULL,
  'ReturnType' => 'ID',
)
[ReturnType] 'ID'
[tries] 2
[try] 0
[PDO] array (
)
[PDOStatement] array (
  'queryString' => 'insert GDN_Category 
(`UrlCode`, `AllowDiscussions`, `Name`, `Description`, `InsertUserID`, `UpdateUserID`, `DateInserted`, `DateUpdated`, `AllowFileUploads`) 
values (:UrlCode, :AllowDiscussions, :Name, :Description, :InsertUserID, :UpdateUserID, :DateInserted, :DateUpdated, :AllowFileUploads)',
)
[ex] array (
)
[message] NULL
[code] NULL
[state] '00000'


Application: Vanilla
Application Version: 2.2
PHP Version: 5.6.9
Operating System: Linux
Server Software: Apache
Referer: http://xxxxx.de/vanilla/index.php?p=/vanilla/settings/addcategory
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Iron/37.0.2000.0 Chrome/37.0.2000.0 Safari/537.36
Request Uri: /vanilla/index.php?p=/vanilla/settings/addcategory&
Controller: PHP
Method: trigger_error

The Database is on a MariaDB 5.5.45 server and things like creating and editing Disscussions works perfectly fine.

It would be nice if somebody could tell me what the source of this problem is.

PS: Sorry for my bad english.

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Got caught in spam filter, sorry.

    Are you running in STRICT mode?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    edited December 2015

    No Problem.
    If you are refering to the mode Mariadb is running in, the STRICT_TRANS_TABLES mode is set globally.
    From the Mariadb Knowledge Base:

    Strict mode. Statements with invalid or missing data are aborted and rolled back, except that for non-transactional storage engines and statements affecting multiple rows where the invalid or missing data is not the first row, MariaDB will convert the invalid value to the closest valid value, or, if a value is missing, insert the column default value.

    I hope this helps.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Try disabling strict mode and report back if it works.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    LincLinc Detroit Admin
    edited December 2015

    We just discovered this strict-mode error recently on edit category and patched in master, but had missed the add case.

    https://github.com/vanilla/vanilla/pull/3294
    https://github.com/vanilla/vanilla/pull/3391

    I'll get them backported for 2.2.1.

Sign In or Register to comment.