Jump to:

21489 Posts in 5783 Topics by 2622 members

General Questions

SilverStripe Forums » General Questions » Succession of 4 MySQL errors from multiple SS sites

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 462 Views
  • vwd
    Avatar
    Community Member
    123 Posts

    Succession of 4 MySQL errors from multiple SS sites Link to this post

    Hi,

    I periodically would receive a burst of emails from one of our SS (2.4.6) sites. But now I'm receiving it more frequently (fortnightly) from more of our SS sites.

    I get the following 4 errors in quick succession:

    Warning/Error #1

    Warning: mysql_query() expects parameter 2 to be resource, boolean given
    At line 116 in /home/site1/public_html/sapphire/core/model/MySQLDatabase.php

    mysql_query(SET CHARACTER SET 'utf8',)
    Line 116 of MySQLDatabase.php
    MySQLDatabase->query(SET CHARACTER SET 'utf8')
    Line 60 of MySQLDatabase.php
    MySQLDatabase->__construct(Array)
    Line 97 of DB.php
    DB::connect(<filtered>)
    Line 121 of main.php

    Warning/Error #2

    Warning: mysql_error() expects parameter 1 to be resource, boolean given
    At line 123 in /home/site1/public_html/sapphire/core/model/MySQLDatabase.php

    mysql_error()
    Line 123 of MySQLDatabase.php
    MySQLDatabase->query(SET CHARACTER SET 'utf8')
    Line 60 of MySQLDatabase.php
    MySQLDatabase->__construct(Array)
    Line 97 of DB.php
    DB::connect(<filtered>)
    Line 121 of main.php

    Warning/Error #3

    Error: Couldn't run query: SET CHARACTER SET 'utf8'
    At line 525 in /home/site1/public_html/sapphire/core/model/MySQLDatabase.php

    Couldn't run query: SET CHARACTER SET 'utf8'
    Line 525 of MySQLDatabase.php
    MySQLDatabase->databaseError(Couldn't run query: SET CHARACTER SET 'utf8' | ,256)
    Line 123 of MySQLDatabase.php
    MySQLDatabase->query(SET CHARACTER SET 'utf8')
    Line 60 of MySQLDatabase.php
    MySQLDatabase->__construct(Array)
    Line 97 of DB.php
    DB::connect(<filtered>)
    Line 121 of main.php

    Warning/Error #4

    Warning: mysql_connect() [function.mysql-connect]: User site1_ss more than 'max_user_connections' active connections
    At line 57 in /home/site1/public_html/sapphire/core/model/MySQLDatabase.php

    mysql_connect(<filtered>,<filtered>,<filtered>,<filtered>)
    Line 57 of MySQLDatabase.php
    MySQLDatabase->__construct(Array)
    Line 97 of DB.php
    DB::connect(<filtered>)
    Line 121 of main.php

    What looked suspicious was the warning User site1_ss more than 'max_user_connections' active connections. I enquired of the web host who suggested that it was due to the code not closing mysql connections cleanly.

    What do you think? These sites aren't even experiencing an enormous traffic spike at the times that the errors are being experienced.

    Thank you very much.
    VWD.

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Succession of 4 MySQL errors from multiple SS sites Link to this post

    Hi,

    You are not alone: I also get it all the time and it has been so for ages, no idea why.

    Best regards,
    Juan

  • vwd
    Avatar
    Community Member
    123 Posts

    Re: Succession of 4 MySQL errors from multiple SS sites Link to this post

    Hi Juan,

    Thanks for letting me know - it's reassuring to know that I what I'm experiencing is not unique.

    My web host confirms that the max_user_connections figure is 30. And the sites are not receiving anywhere near that figure in traffic. It's looking like SS isn't cleanly closing off MySQL connections?

    What version of SS are you using Juan?

    Thank you.
    VWD.

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Succession of 4 MySQL errors from multiple SS sites Link to this post

    It happens both with 2.4.7 and 2.3.13 sites. I have not so many of them, so I don’t know if it’s also related to the host, but it only happens in one of them.

    462 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.