We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23819
    • 37 Posts
    I am working a site that uses a lot of migx, and am concerned I might have tried to do too much with it. I have a template with 7 different MIGX TVs, and sometimes each one of them can contain over a hundred lines.

    In Firefox I've suddenly started experiencing xpdo problems when editing pages that have large amounts of data stored in the MIGX Tvs.

    Strangely, in Chrome and Safari I can still edit these pages without any errors.

    Site is on shared hosting with:

    Apache 2.4.29
    PHP 7.0.27
    MySQL 10.0.34-MariaDB
    MODX Revolution 2.6.1-pl

    On client side, I'm on Mac Os 10.10,
    and problem is only occurring in Firefox 58.0.1

    When I try to edit a page that has a large amount of data in MIGC TVs, I get hundreds of these kind of errors, the resource tree fails to load, and I'm asked to log back in again.

    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoquery.class.php : 653) Could not construct or prepare query because it is invalid or could not connect: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ? 
    [2018-02-03 12:49:38] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
    [2018-02-03 12:49:38] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoobject.class.php : 263) Error preparing statement for query: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ?  - 
    [2018-02-03 12:49:38] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoobject.class.php : 1452) Error 23000 executing statement:
    INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('5a6dt9qvs58de7jfu7hd8fppf5', 1517658578, '')
    Array
    (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry '5a6dt9qvs58de7jfu7hd8fppf5' for key 'PRIMARY'
    )
    
    


    Can anybody suggest where to start as far as finding what is causing this, and creating a solution ?

    I am more than a little worried I may have designed a site that relies too heavily on MIGX TV's.

    Thank you so much for your suggestions.



    [ed. note: pranawebdesign last edited this post 6 years, 2 months ago.]
      • 23819
      • 37 Posts
      So I found what was causing this:

      I was logging in with a https security exception, but MODX is not fully configured to run on HTTPS, and Firefox was therefore blocking some of my requests.

        • 4172
        • 5,888 Posts
        glad, you found the cause.
        Maybe you should think about putting this items into a custom-table and replace the MIGX - TVs with MIGXdb - TVs and the getImageList - calls with migxLoopCollection - calls.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 23819
          • 37 Posts
          A slightly different version of this error is back, and this time it's not browser related.

          The whole site was moved on to a new domain name for launch, and it's served with SSL only: all connections are rewritten with an .htaccess file.

          This site has 60+ limited manager accounts. And sometimes ( I'm trying to figure out a pattern here, but so far I can't) when some of these clients edit a ressource it will cause a "mysql has too many connections error":

          2018-03-12 18:01:13] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User user_modx already has more than 'max_user_connections' active connections
          


          Which then in turn seems to trigger a huge number of XPDO errors:

          [2018-03-12 18:01:13] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoquery.class.php : 653) Could not construct or prepare query because it is invalid or could not connect: SELECT `modExtensionPackage`.`id`, `modExtensionPackage`.`namespace`, `modExtensionPackage`.`name`, `modExtensionPackage`.`path`, `modExtensionPackage`.`table_prefix`, `modExtensionPackage`.`service_class`, `modExtensionPackage`.`service_name`, `modExtensionPackage`.`created_at`, `modExtensionPackage`.`updated_at`, Namespace.path AS namespace_path FROM `modx_extension_packages` AS `modExtensionPackage` JOIN `modx_namespaces` `Namespace` ON `modExtensionPackage`.`namespace` =  `Namespace`.`name` ORDER BY namespace ASC 
          
          [2018-03-12 18:01:13] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
          
          [2018-03-12 18:01:13] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoquery.class.php : 653) Could not construct or prepare query because it is invalid or could not connect: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ? 
          
          [2018-03-12 18:01:13] (ERROR in xPDOConnection::connect @ /home/arda/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [1203] User arda_modx already has more than 'max_user_connections' active connections
          
          [2018-03-12 18:01:13] (ERROR @ /home/arda/public_html/core/xpdo/om/xpdoobject.class.php : 263) Error preparing statement for query: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ?  - 
          
          


          This has happened to 2 different people today in both Safari and Chrome.

          The strange thing is, when I login with these browsers and the same credentials from my computer I don't get the errors. Could this mean it's cache related?

          I would immensely appreciate any help, insights, or ideas anybody may have on this as I need to find a real solution as soon as possible.

          P.S. @Bruno17 I started learning MIGX DB and experimenting with a custom table version of the site but was not able to get far enough to replace the system before launch (there was a fixed go live date). Do you think using MIGX too heavily is responsible for this? Is there any reason why this would be? If the only way out is to switch to a custom table, then I will put in the work and do that.


            • 4172
            • 5,888 Posts
            No, I don't think this has anything todo with MIGX.
            MIGX usually doesn't do additional db- connections.

            This error means just, what it says. There are currently to many db - connections.
            For what ever reason.
            Maybe not enough db-connections are allowed at the same time on that server?
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 23819
              • 37 Posts
              Quote from: Bruno17 at Mar 14, 2018, 12:59 PM
              No, I don't think this has anything todo with MIGX.
              MIGX usually doesn't do additional db- connections.

              This error means just, what it says. There are currently to many db - connections.
              For what ever reason.
              Maybe not enough db-connections are allowed at the same time on that server?

              Ok perfect, thank you for confirming this. And thank you for your time, and for building MIGX which is awesome smiley

              Yes, it seems I under-estimated my hosting requirements for this particular project: there are over 60 users with limited manager access, and only 25 connections per database user allowed by web host.