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

    I have finally moved my homepage from an older server to a new one. Everything seems to work well after the import except of a little error when logging in or out as regular web user.

    A MODx error page is shown for a sec when I logout for example, but it’s then redirected to the standard page.

    The error is:
    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 '2147483647' for key 1
    INSERT INTO `frozenminds_com`.modx_log_hosts(id, data) VALUES('3458913912', 'abc.def.ghi.jkl')


    Any ideea how to fix this? I don’t know what to remove from the modx_log_hosts table without braking anything else.

    Thank you!
    Boby
      ...my Photo Gallery on Flickr...
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Is there some reason why you are keeping your logs for so long? Go to the backup manager and empty them from time to time. I believe that the function uses "truncate", which will reset the auto_increment value to 1.

      Your problem is that that is an "int" field, and an "int" can only go up to 2147483647.

      http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
        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
        • 3763
        • 155 Posts
        Thanks Susan for the reply smiley

        I have cleared now the logs tables, when I logged the first time in no errors were shown. However on logging out or logging in again the same errors showed up.

        It’s always this 2147483647

        There’s no auto_increment, the table is InnoDB. You are right about the maximum value, how can I change the log to start from 0 again?

        Thanks, Boby.
          ...my Photo Gallery on Flickr...
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Go in with your phpMyAdmin, and in the "Operations" tab, there will be a field for setting the auto_increment value. Empty the table, then make sure that is set to 1.
            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
            • 3763
            • 155 Posts
            There is no auto_increment for this table huh

            I have defragmented the tabled and flushed it, same thing sad

            Probably it’s stored somewhere else, any ideea where?
              ...my Photo Gallery on Flickr...
              • 22303 MODX Staff
              • 10,725 Posts
              Sounds like you may have exported and imported using slightly incompatible syntaxes or versions of MySQL or phpMyAdmin. I’ve had this problem before when moving from MySQL 4.x to 3.x especially -- none of the auto_increment fields have the auto_increment attribute specified on the field definition after the import. It’s easy to go into the structure definition and simply change the field definition to be auto_increment (and make sure it is specified as the primary key, as well).
                • 3763
                • 155 Posts
                Yep, I upgraded from MySQL 3.2 to 5 laugh

                Do I have to add more auto_increment attributes to the other "modx_log_xyz" tables?

                Thank you!
                  ...my Photo Gallery on Flickr...
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  No, looking at the installation setup files, these tables don’t have an auto_increment. But that value has to be coming from somewhere.
                    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
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Ok, that’s not any kind of incremented value, it’s a crc32 hash of your hostname.
                      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
                      • 3763
                      • 155 Posts
                      Hi again!

                      I have now reinstalled these tables. The error persists if I have Log Visits turned on.
                      Could it be because my homepage is www.frozenminds.com and the hostname of my computer at home is frozenminds ?

                      Another question, I have in config.inc.php a variable:
                      $site_sessionname = "SNabcdefghijlmn";

                      and in my modx_system_settings DB table I have a field site_id that is different. Do these two values have to match or not?

                      Boby
                        ...my Photo Gallery on Flickr...