Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44
  1. #1
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

    ....don't even know what to ask.... but I'm getting this logs.

    What should I be looking for ? this DUPLICATE KEY UPDATE where is it coming from ?



    Code:
    [04-Jun-2016 10:17:22 Europe/Lisbon] 
    PHP Fatal error:  1048:Column 'value' cannot be null :: insert into sessions (sesskey, expiry, `value`)
                values ('skc7lplhr8mpjptu72b700uhh3', 1465033282, null)
                ON DUPLICATE KEY UPDATE `value`=null, expiry=1465033282 ==> (as called by) /home/xxxxxxxxxx/xxxx/includes/functions/sessions.php on line 69 <== in /home/xxxxxxxxxx/xxxx/includes/classes/db/mysql/query_factory.php on line 167
    Thanks
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    In some of the earlier versions of ZC, there was the possibility of a race condition existing (the sessions table being updated at the same time that the same session was to again be updated/insert) to prevent that race condition the session storage function was modified to use the update option for the operation. The alternative proposed was to use the replace command; however, that was found to perform two operations basically of removing the previous if found and then store the new data as compared to the update that would just revise the data.

    As to why the value portion of the data is null... That's something that at the moment doesn't come to mind as to why/how it could be. Generally speaking though the suggestion would be to review the server logs for the 5 minutes before to 5 minutes after that error to see what was going on at the time and try to identify what actions were occurring.

    Could you also provide information (already requested in the posting tips) such as php version, server information, mysql database version info, etc...

    As to specifically from where in the code it is coming: includes/functions/sessions.php on line 6
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    PHP Version: 5.6.18 (Zend: 2.6.0)
    Database: MySQL 5.5.49-cll

    I only have one log now.
    I' still in the process of migrating from my local machine to the server, and some issues still came up, and I've deleted a lot of log files.
    But for now, just this log file.

    Could I truncate the sessions table , to see if this has something to do with the "migration" ?
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  4. #4
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    Quote Originally Posted by mc12345678 View Post
    for the 5 minutes before to 5 minutes after that error to see what was going on at the time and try to identify what actions were occurring.
    So 5 minutes, the the session goes down, that's why you're saying 5 minutes ?
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  5. #5
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    I should had posted the entire log...lazy me.

    ....hum, and forgot to mentioned , that the site is on maintanance, and that IP is not mine...
    So, anyway, just one log file until now.

    Code:
    [04-Jun-2016 10:17:22 Europe/Lisbon] 
    
    Request URI: /historia/historia-geral/a-vida-quotidiana-da-mulher-na-roma-antiga, IP address: 173.252.115.165
    
    #1  trigger_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:167]
    #2  queryFactory->show_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:139]
    #3  queryFactory->set_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:266]
    #4  queryFactory->Execute() called at [/xxxxxxx/xxxxxxx/public_html/includes/functions/sessions.php:69]
    #5  _sess_write()
    #6  session_write_close() called at [/xxxxxxx/xxxxxxx/public_html/includes/functions/functions_general.php:45]
    #7  zen_redirect() called at [/xxxxxxx/xxxxxxx/public_html/includes/init_includes/init_customer_auth.php:97]
    #8  require(/xxxxxxx/xxxxxxx/public_html/includes/init_includes/init_customer_auth.php) called at [/home/xxxxxxx/xxxxxxx/includes/autoload_func.php:48]
    #9  require(/xxxxxxx/xxxxxxx/public_html/includes/autoload_func.php) called at [/xxxxxxx/xxxxxxx/public_html/includes/application_top.php:170]
    #10 require(/xxxxxxx/xxxxxxx/public_html/includes/application_top.php) called at [/xxxxxxx/xxxxxxx/public_html/index.php:26]
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    That's Facebook checking you out!

    Now I'm wondering if that log you're receiving is because it's a robot visit during Maintenance Mode. What I'd suggest, just to capture some information if this occurs in the future, is to update your copy of /includes/init_includes/init_customer_auth.php (around line 97), adding the line in red:
    Code:
      case ($down_for_maint_flag && DOWN_FOR_MAINTENANCE_TYPE == 'strict'):
        // if DFM is in strict mode, then block access to all pages:
        zen_redirect(zen_href_link(DOWN_FOR_MAINTENANCE_FILENAME));
      break;
    
      case ((DOWN_FOR_MAINTENANCE == 'true') && !in_array($_GET['main_page'], array(FILENAME_LOGOFF, FILENAME_PRIVACY, FILENAME_CONTACT_US, FILENAME_CONDITIONS, FILENAME_SHIPPING))):
        // on special pages, if DFM mode is "relaxed", allow access to these pages
        if ($down_for_maint_flag && DOWN_FOR_MAINTENANCE_TYPE == 'relaxed') {
          trigger_error (var_export ($_SESSION, true), E_USER_WARNING);
          zen_redirect(zen_href_link(DOWN_FOR_MAINTENANCE_FILENAME));  // <-- This is the "old" line 97
        }
      break;
    That teeny addition will create a PHP Warning in a myDEBUG*.log file, including the line where it came from so that you can easily find it in the future, that contains the contents of the session at the time the redirect is requested.

    If you find such a log that is followed by the database error, we'll have some more information to determine what is going on!

  7. #7
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    ok , I've added to the file.
    Thanks
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    Quote Originally Posted by mesnitu View Post
    ok , I've added to the file.
    Thanks
    Excellent! If you find one of those logs again, we'll have some additional information that can be used to fully diagnose the issue.

  9. #9
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    Quote Originally Posted by mesnitu View Post
    So 5 minutes, the the session goes down, that's why you're saying 5 minutes ?
    5 minutes on each side (when reviewing the server access logs) has been the suggested time as I recall for chasing down an "access" issue that gets logged like this. It also gives an idea of what is/was going on during that time in a bigger view. In this case, since lat9 identified the "visitor" as a bot of sorts, would likely see that "random" pages were being visited. Had that part not been known, it would be an indicator that the visitor had some "familiarity" with what was on the site and was just trying to get to something. This would be different than say a customer that is more likely to try the product then maybe a login or other "readily" available options that might be displayed on a main screen.

    The frequent thought is also that the error was logged at the exact time when the visitor was seen in the logs and on a busy site, that may hide what is truly going on.

    Looks like going down the right path though to resolving this. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey

    Well, I've placed the site online and pinged with sitemap, and a lot of logs were generated
    They are all related with that trigger erro, and crawl bots:

    Code:
    [04-Jun-2016 16:10:05 Europe/Lisbon] Request URI: /index.php?main_page=index&manufacturers_id=47&sort=3a&page=3, IP address: 66.249.64.193
    #1  trigger_error() called at [/xxxxxx/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php:97]
    #2  require(/xxxxxx/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php) called at [/home/xxxxxx/xxxxxx/includes/autoload_func.php:48]
    #3  require(/home/xxxxxx/xxxxxx/includes/autoload_func.php) called at [/home/xxxxxx/xxxxxx/includes/application_top.php:170]
    #4  require(/home/xxxxxx/xxxxxx/includes/application_top.php) called at [/home/xxxxxx/xxxxxx/index.php:26]
    
    [04-Jun-2016 16:10:05 Europe/Lisbon] PHP Warning:  array (
      'customers_host_address' => 'crawl-66-249-64-193.googlebot.com',
      'cartID' => '',
      'cart' => 
      shoppingCart::__set_state(array(
         'contents' => 
        array (
        ),
         'total' => 0,
         'weight' => 0,
         'content_type' => false,
         'free_shipping_item' => 0,
         'free_shipping_weight' => 0,
         'free_shipping_price' => 0,
         'download_count' => 0,
         'total_before_discounts' => 0,
         'display_debug_messages' => false,
         'flag_duplicate_msgs_set' => false,
      )),
      'language' => 'portugues',
      'languages_id' => '2',
      'languages_code' => 'pt',
      'securityToken' => 'f9962743c5b1697d9230e826a0c43950',
      'check_valid' => 'true',
      'navigation' => 
      navigationHistory::__set_state(array(
         'path' => 
        array (
          0 => 
          array (
            'page' => 'index',
            'mode' => 'NONSSL',
            'get' => 
            array (
              'manufacturers_id' => '47',
              'sort' => '3a',
              'page' => '3',
            ),
            'post' => 
            array (
            ),
          ),
        ),
         'snapshot' => 
        array (
        ),
      )),
      'currency' => 'EUR',
    ) in /home/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php on line 97
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. v153 PHP Fatal error: Duplicate entry for key insert into sessions
    By carlwhat in forum General Questions
    Replies: 2
    Last Post: 6 Jan 2015, 02:32 AM
  2. Replies: 2
    Last Post: 11 Dec 2012, 03:58 AM
  3. v151 How to insert a NULL value when using zen_db_perform() ?
    By retched in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 17 Nov 2012, 02:04 AM
  4. Fatal Error - Cannot log into Admin Panel
    By featured in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 14 Aug 2008, 10:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR