Answers.Body: <p>Found the underlying issue:</p>
  
  <ul>
  <li>you definitely need to do a CMS contact sync immediately after install</li>
  <li>your CMS user also needs an email set or she will not get imported in the sync &lt;-- this was key</li>
  </ul>
  
  <p>Civi just doesn't think you're the admin that you are otherwise.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-14T23:24:03.853Z
Answers.Text: Good job tracking it down.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T19:12:52.853Z
Answers.Text: Is there a way to force this to happen again if the tables where not there when the upgrade was first initiated?
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:24:16.057Z
Answers.Text: I think it's `Administer -> Users and Permissions -> Synchronize /.../`.
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-11T02:42:07.987Z
Answers.Text: 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.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-11T07:02:07.027Z
Answers.Text: You can of course manually edit the db, but this is already a new question, so please ask it separately.
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-14T22:49:07.690Z
Answers.LastActivityDate: 2020-04-05T09:47:05.877Z
Answers.LastEditDate: 2020-04-05T09:47:05.877Z
Answers.UserDisplayName: lynxlynxlynx
Body: <p>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 <em>seems</em> to work ok. I can access the backend configuration and set everything.</p>
  
  <p>However trying to view the main civi backend (/civicrm), php bails out:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Allowed memory size of 1048576000 bytes exhausted (tried to allocate 1036009472 bytes)</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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. <code>civicrm_dashboard_contact</code> is currently empty.</p>
  
  <pre><code>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-&gt;__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-&gt;__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-&gt;_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-&gt;__call("raiseError", (Array:7))
  #6 webroot/vendor/civicrm/civicrm-core/packages/DB/mysqli.php(933): DB_common-&gt;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-&gt;mysqliRaiseError()
  #8 webroot/vendor/civicrm/civicrm-core/packages/DB/common.php(1229): DB_mysqli-&gt;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-&gt;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-&gt;_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-&gt;insert()
  #12 webroot/vendor/civicrm/civicrm-core/api/v3/utils.php(1363): CRM_Core_DAO-&gt;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-&gt;invoke((Array:9))
  #17 webroot/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(99): Civi\API\Kernel-&gt;runRequest((Array:9))
  #18 webroot/vendor/civicrm/civicrm-core/api/api.php(44): Civi\API\Kernel-&gt;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-&gt;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-&gt;invoke((Array:1))
  #28 [internal function](): Drupal\civicrm\Controller\CivicrmController-&gt;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-&gt;Drupal\Core\EventSubscriber\{closure}()
  #31 webroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
  #32 webroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext((Array:2), (Array:2))
  #33 webroot/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()
  #34 webroot/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
  #35 webroot/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #36 webroot/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #37 webroot/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle-&gt;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-&gt;pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #39 webroot/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #40 webroot/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #41 webroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #42 webroot/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
  #43 webroot/web/index.php(19): Drupal\Core\DrupalKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request))
  #44 {main}
  </code></pre>
  
  <p>Disabling default dashlet addition gets me the dashboard, however there is still no civi menu or sidebar, so it remains useless.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-14T20:49:16.340Z
Comments.Text: 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.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-14T21:54:36.013Z
Comments.Text: 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.
Comments.UserDisplayName: lynxlynxlynx
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-14T22:03:48.943Z
Comments.Text: 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.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-14T22:49:49.600Z
Comments.Text: Thanks for the help! I disabled the whole block and managed to track it down eventually.
Comments.UserDisplayName: lynxlynxlynx
Tags: <php><drupal-8>
Title: Only configuration works — Fatal memory error on Drupal8 install
ThreadText: # Only configuration works — Fatal memory error on Drupal8 install
  
  (Asked by: username_0 on 2019-09-14)
  
  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 @username_1, 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.
  
  **Tags:** php, drupal-8
  
  > **Comments:**
  > **username_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.  
  > **username_0**: 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.  
  > **username_1**: 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.  
  > **username_0**: Thanks for the help! I disabled the whole block and managed to track it down eventually.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-09-14. Score: 2 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_1**: Good job tracking it down.  
  > **username_2**: Is there a way to force this to happen again if the tables where not there when the upgrade was first initiated?  
  > **username_0**: I think it's `Administer -> Users and Permissions -> Synchronize /.../`.  
  > **username_2**: 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.  
  > **username_0**: You can of course manually edit the db, but this is already a new question, so please ask it separately.  
  
  ---
  
  