System Offline with error DBAL/Driver/Mysqli/MysqliStatement.php:101

Run into an error that I’m not sure how I caused and not sure how to fix. (Not a programmer, just a user.)



New install this week, was working fine, created some emails and landing pages and campaigns. Mautic 2.10.1, siteground hosting, PHP 7

When I checked the install on Softaculous just now, it said, “Hmm, looks like you’re actually runnning Mautic 2.11.0 not 2.10.1. Update records?” I DID try to update Mautic but the update hung up on the fourth step and I eventually just exited the update, figuring it was a display issue. Everything did appear to be okay after that and I was able to create and access evertying.



Late last night – of course late at night – I broke it.



I can access my contacts and a few other things, but not my components, emails, Landing pages. When I try to, I get this:



The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

System administrators, check server logs for errors.



At the time, I was implementing the solution on https://www.mautic.org/community/index.php/8154-form-is-hang-on-submit-button-after-hit-submit/. I made copies of the file before making changes and restoring those did not work. I was also updating .htaccess files to block a bad bot, but restored the previous .htaccess trying to fix this problem.





The error log says this: [2017-10-30 23:13:52] mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionInvalidFieldNameException: “An exception occurred while executing ‘SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.title AS title_11, m0_.alias AS alias_12, m0_.template AS template_13, m0_.custom_html AS custom_html_14, m0_.content AS content_15, m0_.publish_up AS publish_up_16, m0_.publish_down AS publish_down_17, m0_.hits AS hits_18, m0_.unique_hits AS unique_hits_19, m0_.variant_hits AS variant_hits_20, m0_.revision AS revision_21, m0_.meta_description AS meta_description_22, m0_.redirect_type AS redirect_type_23, m0_.redirect_url AS redirect_url_24, m0_.is_preference_center AS is_preference_center_25, m0_.lang AS lang_26, m0_.variant_settings AS variant_settings_27, m0_.variant_start_date AS variant_start_date_28 FROM mauhl_pages m0_ LEFT JOIN mauhl_categories m1_ ON m0_.category_id = m1_.id WHERE m0_.variant_parent_id IS NULL AND m0_.translation_parent_id IS NULL ORDER BY m0_.title DESC) dctrn_result) dctrn_table’: Unknown column ‘m0_.is_preference_center’ in ‘field list’" at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.title AS title_11, m0_.alias AS alias_12, m0_.template AS template_13, m0_.custom_html AS custom_html_14, m0_.content AS content_15, m0_.publish_up AS publish_up_16, m0_.publish_down AS publish_down_17, m0_.hits AS hits_18, m0_.unique_hits AS unique_hits_19, m0_.variant_hits AS variant_hits_20, m0_.revision AS revision_21, m0_.meta_description AS meta_description_22, m0_.redirect_type AS redirect_type_23, m0_.redirect_url AS redirect_url_24, m0_.is_preference_center AS is_preference_center_25, m0_.lang AS lang_26, m0_.variant_settings AS variant_settings_27, m0_.variant_start_date AS variant_start_date_28 FROM mauhl_pages m0_ LEFT JOIN mauhl_categories m1_ ON m0_.category_id = m1_.id WHERE m0_.variant_parent_id IS NULL AND m0_.translation_parent_id IS NULL ORDER BY m0_.title DESC) dctrn_result) dctrn_table’:nnUnknown column ‘m0_.is_preference_center’ in ‘field list’ at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘m0_.is_preference_center’ in ‘field list’ at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)”} []





The code in question says this:



public function __construct(mysqli $conn, $prepareString)

{

$this->_conn = $conn;

$this->_stmt = $conn->prepare($prepareString);

if (false === $this->_stmt) {

throw new MysqliException($this->_conn->error, $this->_conn->sqlstate, $this->_conn->errno);

}



$paramCount = $this->_stmt->param_count;

if (0 < $paramCount) {

$this->types = str_repeat(‘s’, $paramCount);

$this->_bindedValues = array_fill(1, $paramCount, null);

}

}



The “throw new MysqliException…” line is 101.



Could anyone enlighten me? Thank you in advance for any time or advice!

Cyn Mobley

Run into an error that I’m not sure how I caused and not sure how to fix. (Not a programmer, just a user.)

New install this week, was working fine, created some emails and landing pages and campaigns. Mautic 2.10.1, siteground hosting, PHP 7
When I checked the install on Softaculous just now, it said, “Hmm, looks like you’re actually runnning Mautic 2.11.0 not 2.10.1. Update records?” I DID try to update Mautic but the update hung up on the fourth step and I eventually just exited the update, figuring it was a display issue. Everything did appear to be okay after that and I was able to create and access evertying.

Late last night – of course late at night – I broke it.

I can access my contacts and a few other things, but not my components, emails, Landing pages. When I try to, I get this:

The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.
System administrators, check server logs for errors.

At the time, I was implementing the solution on https://www.mautic.org/community/index.php/8154-form-is-hang-on-submit-button-after-hit-submit/. I made copies of the file before making changes and restoring those did not work. I was also updating .htaccess files to block a bad bot, but restored the previous .htaccess trying to fix this problem.

The error log says this: [2017-10-30 23:13:52] mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionInvalidFieldNameException: “An exception occurred while executing ‘SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.title AS title_11, m0_.alias AS alias_12, m0_.template AS template_13, m0_.custom_html AS custom_html_14, m0_.content AS content_15, m0_.publish_up AS publish_up_16, m0_.publish_down AS publish_down_17, m0_.hits AS hits_18, m0_.unique_hits AS unique_hits_19, m0_.variant_hits AS variant_hits_20, m0_.revision AS revision_21, m0_.meta_description AS meta_description_22, m0_.redirect_type AS redirect_type_23, m0_.redirect_url AS redirect_url_24, m0_.is_preference_center AS is_preference_center_25, m0_.lang AS lang_26, m0_.variant_settings AS variant_settings_27, m0_.variant_start_date AS variant_start_date_28 FROM mauhl_pages m0_ LEFT JOIN mauhl_categories m1_ ON m0_.category_id = m1_.id WHERE m0_.variant_parent_id IS NULL AND m0_.translation_parent_id IS NULL ORDER BY m0_.title DESC) dctrn_result) dctrn_table’: Unknown column ‘m0_.is_preference_center’ in ‘field list’" at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.title AS title_11, m0_.alias AS alias_12, m0_.template AS template_13, m0_.custom_html AS custom_html_14, m0_.content AS content_15, m0_.publish_up AS publish_up_16, m0_.publish_down AS publish_down_17, m0_.hits AS hits_18, m0_.unique_hits AS unique_hits_19, m0_.variant_hits AS variant_hits_20, m0_.revision AS revision_21, m0_.meta_description AS meta_description_22, m0_.redirect_type AS redirect_type_23, m0_.redirect_url AS redirect_url_24, m0_.is_preference_center AS is_preference_center_25, m0_.lang AS lang_26, m0_.variant_settings AS variant_settings_27, m0_.variant_start_date AS variant_start_date_28 FROM mauhl_pages m0_ LEFT JOIN mauhl_categories m1_ ON m0_.category_id = m1_.id WHERE m0_.variant_parent_id IS NULL AND m0_.translation_parent_id IS NULL ORDER BY m0_.title DESC) dctrn_result) dctrn_table’:nnUnknown column ‘m0_.is_preference_center’ in ‘field list’ at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘m0_.is_preference_center’ in ‘field list’ at /home/lawyerma/public_html/cynmobleylaw.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)”} []

The code in question says this:

public function __construct(mysqli $conn, $prepareString)
{
    $this->_conn = $conn;
    $this->_stmt = $conn->prepare($prepareString);
    if (false === $this->_stmt) {
        throw new MysqliException($this->_conn->error, $this->_conn->sqlstate, $this->_conn->errno);
    }

    $paramCount = $this->_stmt->param_count;
    if (0 < $paramCount) {
        $this->types = str_repeat('s', $paramCount);
        $this->_bindedValues = array_fill(1, $paramCount, null);
    }
}

The “throw new MysqliException…” line is 101.

Could anyone enlighten me? Thank you in advance for any time or advice!
Cyn Mobley

Okay, this is very odd. I have not done anything else and suddenly it’s working again. I am missing four emails and an entire campaign, but that I can regenerate pretty easily. I’m thinking that this must have been on siteground’s end of things and they’ve rolled my site back to a slightly earlier backup? It’s about two hours of work lost.