2

I'm trying to set up civicrm on a working drupal8 install and after the composer commands and a few of the suggested tweaks (like path setting), it seems to work ok. I can access the backend configuration and set everything.

However trying to view the main civi backend (/civicrm), php bails out:

PHP Fatal error: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 1036009472 bytes)

As you can see, I already tried with an absurdly high (1G) limit to no avail. -1 instead causes a 503, which I imagine is from the host killing it or something similarly gruesome.

Civi 5.17.4 works on the same server in a joomla3 install from which I wanted to port away, but checking if a brand new civi works on its own first seemed like a good idea. Any suggestions?

Thanks @Demerit, it appears the internal log is of some use, though I'm afraid to ask how a failed SQL query can leak into oblivion. civicrm_dashboard_contact is currently empty.

Sep 14 18:14:40  [info] $backTrace = #0 webroot/vendor/civicrm/civicrm-core/CRM/Core/Error.php(952): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 webroot/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 webroot/vendor/civicrm/civicrm-core/packages/DB.php(987): PEAR_Error->__construct("DB Error: constraint violation", -3, 16, (Array:2), "INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...")
#3 webroot/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-3, 16, (Array:2), "INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...")
#4 webroot/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -3, 16, (Array:2), "INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...", "DB_Error", TRUE)
#5 webroot/vendor/civicrm/civicrm-core/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
#6 webroot/vendor/civicrm/civicrm-core/packages/DB/mysqli.php(933): DB_common->raiseError(-3, NULL, NULL, "INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...", "1452 ** Cannot add or update a child row: a foreign key constraint fails (`eb...")
#7 webroot/vendor/civicrm/civicrm-core/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 webroot/vendor/civicrm/civicrm-core/packages/DB/common.php(1229): DB_mysqli->simpleQuery("INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...")
#9 webroot/vendor/civicrm/civicrm-core/packages/DB/DataObject.php(2415): DB_common->query("INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...")
#10 webroot/vendor/civicrm/civicrm-core/packages/DB/DataObject.php(1040): DB_DataObject->_query("INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active )...")
#11 webroot/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(572): DB_DataObject->insert()
#12 webroot/vendor/civicrm/civicrm-core/api/v3/utils.php(1363): CRM_Core_DAO->save()
#13 webroot/vendor/civicrm/civicrm-core/api/v3/utils.php(1305): _civicrm_api3_basic_create_fallback("CRM_Contact_BAO_DashboardContact", (Array:5))
#14 webroot/vendor/civicrm/civicrm-core/api/v3/DashboardContact.php(54): _civicrm_api3_basic_create("CRM_Contact_BAO_DashboardContact", (Array:5), "DashboardContact")
#15 webroot/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(101): civicrm_api3_dashboard_contact_create((Array:5))
#16 webroot/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(168): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#17 webroot/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(99): Civi\API\Kernel->runRequest((Array:9))
#18 webroot/vendor/civicrm/civicrm-core/api/api.php(44): Civi\API\Kernel->runSafe("dashboard_contact", "create", (Array:5))
#19 webroot/vendor/civicrm/civicrm-core/CRM/Core/BAO/Dashboard.php(211): civicrm_api3("dashboard_contact", "create", (Array:5))
#20 webroot/vendor/civicrm/civicrm-core/CRM/Core/BAO/Dashboard.php(147): CRM_Core_BAO_Dashboard::initializeDashlets()
#21 webroot/vendor/civicrm/civicrm-core/CRM/Core/BAO/Dashboard.php(159): CRM_Core_BAO_Dashboard::getContactDashlets()
#22 webroot/vendor/civicrm/civicrm-core/CRM/Contact/Page/DashBoard.php(47): CRM_Core_BAO_Dashboard::getContactDashletsForJS()
#23 webroot/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(290): CRM_Contact_Page_DashBoard->run((Array:1), NULL)
#24 webroot/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#25 webroot/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:1))
#26 webroot/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:1))
#27 webroot/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(75): Drupal\civicrm\Civicrm->invoke((Array:1))
#28 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:1), "")
#29 webroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2))
#30 webroot/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#31 webroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#32 webroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2))
#33 webroot/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#34 webroot/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#35 webroot/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#36 webroot/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#37 webroot/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#38 webroot/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#39 webroot/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#40 webroot/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#41 webroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#42 webroot/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#43 webroot/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#44 {main}

Disabling default dashlet addition gets me the dashboard, however there is still no civi menu or sidebar, so it remains useless.

  • 1
    Usually that error message is also followed by a filename and line number where it happened. You might need to look in apache's log or civi's ConfigAndLog folder. If you could edit your question and paste that in there, edited as desired to take out anything sensitive. – Demerit Sep 14 '19 at 20:49
  • The displayed filename is the generic error handler, so it's not useful, however the internal log shows another error, so it's at least something to go from. – lynxlynxlynx Sep 14 '19 at 21:54
  • Usually that means it's errored out because the error message itself is huge, so you can comment out the line trying to output it and put in your own debugging. – Demerit Sep 14 '19 at 22:03
  • Thanks for the help! I disabled the whole block and managed to track it down eventually. – lynxlynxlynx Sep 14 '19 at 22:49
2

Found the underlying issue:

  • you definitely need to do a CMS contact sync immediately after install
  • your CMS user also needs an email set or she will not get imported in the sync <-- this was key

Civi just doesn't think you're the admin that you are otherwise.

| improve this answer | |
  • Good job tracking it down. – Demerit Sep 14 '19 at 23:24
  • Is there a way to force this to happen again if the tables where not there when the upgrade was first initiated? – Josh Jun 10 at 19:12
  • I think it's Administer -> Users and Permissions -> Synchronize /.../. – lynxlynxlynx Jun 10 at 20:24
  • Sorry, let me rephrase that. If I have a 500 error, is there a way to do it from the command line with CV or another tool? Thanks. – Josh Jun 11 at 2:42
  • You can of course manually edit the db, but this is already a new question, so please ask it separately. – lynxlynxlynx Jun 11 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.