If I clear the cache, the error re-occurs but with a slightly different filepath.
It might have been a permissions error on the plugins/CustomObjectsBundle/Security/Permissions/CustomObjectPermissions.php file. I’ve chmodded the file to 755, and it the log message has stopped.
I’m still getting Internal Server Errors when I try to access Mautic, but this time with this error in Mautic’s log:
[2022-05-24 16:00:32] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing 'SELECT c0_.is_published AS is_published_0, c0_.date_added AS date_added_1, c0_.created_by AS created_by_2, c0_.created_by_user AS created_by_user_3, c0_.date_modified AS date_modified_4, c0_.modified_by AS modified_by_5, c0_.modified_by_user AS modified_by_user_6, c0_.checked_out AS checked_out_7, c0_.checked_out_by AS checked_out_by_8, c0_.checked_out_by_user AS checked_out_by_user_9, c0_.id AS id_10, c0_.alias AS alias_11, c0_.name_singular AS name_singular_12, c0_.name_plural AS name_plural_13, c0_.description AS description_14, c0_.lang AS lang_15, c0_.type AS type_16, c0_.category_id AS category_id_17, c0_.relationship_object AS relationship_object_18, c0_.master_object AS master_object_19 FROM custom_object c0_ LEFT JOIN categories c1_ ON c0_.category_id = c1_.id WHERE c0_.is_published = ?' with params [1]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.custom_object' doesn't exist" at /usr/share/nginx/example.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 61 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 0): An exception occurred while executing 'SELECT c0_.is_published AS is_published_0, c0_.date_added AS date_added_1, c0_.created_by AS created_by_2, c0_.created_by_user AS created_by_user_3, c0_.date_modified AS date_modified_4, c0_.modified_by AS modified_by_5, c0_.modified_by_user AS modified_by_user_6, c0_.checked_out AS checked_out_7, c0_.checked_out_by AS checked_out_by_8, c0_.checked_out_by_user AS checked_out_by_user_9, c0_.id AS id_10, c0_.alias AS alias_11, c0_.name_singular AS name_singular_12, c0_.name_plural AS name_plural_13, c0_.description AS description_14, c0_.lang AS lang_15, c0_.type AS type_16, c0_.category_id AS category_id_17, c0_.relationship_object AS relationship_object_18, c0_.master_object AS master_object_19 FROM custom_object c0_ LEFT JOIN categories c1_ ON c0_.category_id = c1_.id WHERE c0_.is_published = ?' with params [1]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.custom_object' doesn't exist at /usr/share/nginx/example/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:61, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.custom_object' doesn't exist at /usr/share/nginx/example.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.custom_object' doesn't exist at /usr/share/nginx/example.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)"} {"hostname":"example","pid":12345}
So I need to apply some database migrations before the plugin will function. How do I go about doing this?
php bin/console doctrine:migration:status
returns no new migrations.
EDIT: I’ve just tried running php bin/console mautic:plugins:install
and get an error message about the leads table not existing (it does exist!). Seems related to GitHub issue 11163.