We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3677
    • 130 Posts
    I am getting this obscure error in the modx error log of Revo 2.2.14 (Modx Cloud instance):

    [2014-05-29 11:53:59] (ERROR @ /paas/c####/www/core/xpdo/om/xpdoobject.class.php : 236) PHP warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
    [2014-05-29 11:53:59] (ERROR @ /index.php) Error HY093 executing statement:
    Array
    (
    [0] => HY093
    [1] =>
    [2] =>
    )

    Can anyone advise on what this could be or what steps I should take to try to get better information on what piece of custom code is causing the problem since this is associated with "index.php"?

    Thanks,

    -Brian [ed. note: bmilton last edited this post 9 years, 10 months ago.]
    • Well, everything originates with the index.php file, everything else being included as needed, so that's not much help. The line in the xpdoobject file is a generic function to return a list of query results. Again, not much help.

      Try disabling all plugins, and loading a page with a simple "hello, world" resource with no template. That should generate with no errors. Then gradually add whatever snippets you're using, and enabling plugins one at a time until you get to the one that causes the problem.
        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
        • 3677
        • 130 Posts
        Unfortunately this is a very intermittent error happening only 4-5 times a day. It is unlikely that I can even get it to trigger on demand by anything I would do.

        -Brian
        • Well, it's obviously being caused by a snippet or a plugin that has a badly-formed query. Without a more comprehensive error message, the only way you can track it down is to use an otherwise empty page, and test your custom plugins and snippets. I doubt if it's being caused by any of the commonly used snippets or plugins, or we'd hear about it.

          You might be able to narrow things down by checking the error logs and the access logs, and finding out what pages were requested at the same time the error was generated.

          Do you have any idea when this started? If so, what was added to the site just previously? Was the PHP or MySQL upgraded? Any other recent changes?
            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