We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9900
    • 17 Posts
    Hi everyone,

    I’ve recently set up MODx on a client site after developing it locally, but I’m getting a parse error when trying to login:

    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 `camcms`.modx_manager_log(timestamp, internalKey, username, action, itemid, itemname, message) VALUES(’1154943446’, ’1’, ’admin’, ’58’, ’-’, ’MODx’, ’Logged in’)


    However, if I then delete "processors/login.processor.php" from the url I’m able to access the Manager?!

    But.....once I’m in and attempting to view Manage resources, System configuration etc I’m still receiving the same error message at the bottom of each page.

    Also (yep, there’s more...), when I click on each page in the document tree on the left it comes up with a 404 error, even though I’ve tested the site and it’s definitely there!

    I’ve been reading through a few posts regarding parse error in the forums and have (a) disabled visitor logging, and (b) asked the host to change the necessary permissions to 777. However, the problems still persist.

    The weird thing is that the client currently has MODx installed in a subfolder to update a specific section of the site, and this works fine. Would this be conflicting with the new installation? Is this a MODx issue or a server configuration issue?

    Any help would be greatly appreciated - thanks,

    Dan
    • Check your new config.inc.php file and make sure you set everything to the proper values for the new server. If you just copied over the files from your dev server to your production server, that file will not be relevant for the production server. You’ll also need to mofidy the .htaccess in the modx folder to reflect the fact that your index.php file is now in /modx, not /
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 9900
        • 17 Posts
        Hi there Susan,

        Thanks for your swift reply - much appreciated.

        I’ve checked the config.inc.php file and the settings seem to be correct (I’ve double-checked with the host to make sure), and the .htaccess file reflects the root folder, but still the same problems remain. I’ll see what the host says before continuing.

        Thanks again,

        Dan
          • 7455
          • 2,204 Posts
          Try deleting all the file in the cache directory exept for the index.html
            follow me on twitter: @dimmy01
            • 9900
            • 17 Posts
            Hi Dimmy,

            Thanks for that - I’ve deleted the files you mentioned but I’m still receiving the same error message. I’ve contacted the host to see if it’s a problem their end, and I’ll let you know what they say.

            Cheers,

            Dan
              • 9900
              • 17 Posts
              Hi everyone,

              I’ve contacted the host and their reply was:

              "The error you are receiving (« Execution of a query to the database failed - Duplicate entry ’0’ for key 1 ») indicates the software is able to connect to the MySQL database, however there is a problem either with the database structure or the CMS installation."

              Stumped.......any ideas?

              Thanks a lot,

              Dan
              • Try emptying the manager_log table from phpMyAdmin.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 9900
                  • 17 Posts
                  Hi again Susan,

                  Tried that, but still receiving the same error message (and from within MODx when I do eventually manage to login).

                  What makes it all the stranger is that, as I mentoned previously, a subfolder on the site has MODx installed and this works like a charm. I’ve checked all the settings I can think of but these damned error messages keep appearing.

                  *Tears hair out!*

                  Thanks again for your help,

                  Dan
                  • There is something wrong with that table. Check to make sure that the first field, "id", is set to "auto_increment".
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 9900
                      • 17 Posts
                      Hellelujah!!

                      It works - no error messages at all. Thanks Susan - you’re a star!

                      Cheers,

                      Dan