We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    After moving to a new server I get this error when i do something in the manager:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - Duplicate entry '0' for key 1 »
          SQL: INSERT INTO minmenz.`modx_manager_log` (timestamp, internalKey, username, action, itemid, itemname, message) VALUES('1191568905', '1', 'admin', '17', '-', '-', 'Editing settings')
    


    I emptyed the modx_manager_log, fixed the table etc. still the same error.

    its running modx 0.9.6-RC3 and the server is running php5 and mysql 5 (was php 4.3.2 and mysql 4.10)
    same error on MODx 0.9.2.1 (rev 1005) (I know its old needs upgrade but it needs to run for now I can not upgrade 70 sites in 1 day)
    in 0.9.5 I only get this error when I delete the event log. its not popuped anywhere els yet.

    I could update to the latest 096 but I also like to know why I get this error. I am moving 289 domains with at least 70 modx installations, and it would be nice if I do not need to upgrade all those versions.

    I Get this error also on a fresh install of 096 aahhh not tru it was an old install I deleted the db and installed the db now it works on this 0.9.6

    I think that the Plesk migration manager that imported all the db’s, maybe made some errors? setting the id field on not auto increment maybe? man this sucks.
    maybe I need to export db en import them by hand myself


    Dimmy

      follow me on twitter: @dimmy01
      • 7455
      • 2,204 Posts
      Man now I get this: "Error while inserting event log into database."
      when does the hurting stop?
        follow me on twitter: @dimmy01
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: Dimmy at Oct 05, 2007, 03:44 AM

        Man now I get this: "Error while inserting event log into database."
        when does the hurting stop?
        Probably when you learn not to depend on Plesk...

        I always use mysqldump and mysql from the command line to make sure things get exported and imported properly to and from the database. I can only imagine how bad Plesk is mutilating your tables. A lot of this sounds like it did not add the auto_increment fields back to the tables in particular though. Double-check that...
          • 13577
          • 302 Posts
          Thought I’d toss in my $0.02 on this subject since the same thing happened to me today. Here was my process:

          First I commented out the exit statement on line ~1298 of document.parser.class.inc.php
          if (!$ds) {
              echo "Error while inserting event log into database. ";
              //exit();
          }
          

          Then I added the $sql string to the end so I could see WHAT MODx was trying to log - thinking this might help me find out what I had undoubtedly done wrong in my snippet:
          if (!$ds) {
              echo "Error while inserting event log into database. ($sql)";
              //exit();
          }
          

          Incidentally, by commenting out the exit(), the page worked fine... well except for the error message at the top. Then I got this SQL statement which proved very interesting. Not at all what I expected:

          INSERT INTO
          `dbname`.`prefix_event_log`
          (eventid,type,createdon,source,description,user)
          VALUES(1,3,1231255526,’snippetname - Snippet’,’It is not safe to rely on the system\’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected \’America/New_York\’ for \’EST/-5.0/no DST\’ instead

          ’,’1’)
          * Some data (in italics) altered to protect the innocent.

          Weird. A timezone issue? [... Jared hits Google for a while ...]

          Sure enough, even though the phpInfo shows:
          Default timezone America/New_York
          It also shows no setting has been explicitly defined:
          date.timezone no value no value
          As it turns out, moving from PHP 4 to PHP 5 brings some changes in how error reporting happens with time settings. This was a case in point. A little more Googling showed me I needed to explicitly set the date.timezone setting in php.ini - which had previously commented out. It now looks like this:
          [Date]
          ; Defines the default timezone used by the date functions
          date.timezone = America/New_York
          

          I restarted Apache, and almost like magic, the error was gone. I removed my modifications to document.parser.class.inc.php (because failure to do so immediately means I’llf orget for sure). And now everything is running smoothly again.
            Standard Disclaimer
            I could be totally wrong.