Hello,

I am making application with Phalcon and now I have problem. I am not sure if this is 1.3 -> 2.0 update related, but it is possible.

This problem occurs randomly, not every page refresh. Problem is simple - when I use querybuilder, sometimes I get exception "Wrong number of parameters".

Trace:

#0 [internal function]: Phalcon\Mvc\Model\Resultset\Complex->__construct(Array, Object(Web\Frontend\Models\Files), Object(Phalcon\Db\Result\Pdo), NULL, false)
#1 [internal function]: Phalcon\Mvc\Model\Query->_executeSelect(Array, Array, NULL)
#2 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL)
#3 /Users/herb/Sites/web34/apps/frontend/models/Files.php(135): Phalcon\Mvc\Model::findFirst(Array)
#4 /Users/herb/Sites/web34/apps/backend/controllers/FileController.php(23): Web\Frontend\Models\Files::findFirst(Array)
#5 [internal function]: Web\Backend\Controllers\FileController->indexAction('7')
#6 [internal function]: Phalcon\Dispatcher->dispatch()
#7 /Users/herb/Sites/web34/public/index.php(50): Phalcon\Mvc\Application->handle()
#8 {main}

add 3) - model Files.php line 135

/**
 * @return Files
 */
public static function findFirst($parameters = array())
{
    return parent::findFirst($parameters);
}

add 4) - controller line 23

$file = Files::findFirst(array(
    "id = :file_id:",
    "bind" => array(
        "file_id" => $file_id
    )
));

I found similar topic (exactly the same problem) here https://forum.phalcon.io/discussion/6566/20-complex-resultset-throws-error but there is no solution and I can`t figure it out.

I'd really appreciate any help!