Answers.Body: <p>Not sure what to say.  Worked on this site all day and got the same DB error for hours.  Suddenly, tonight, sat down to do some more work and for the first time in 3 different iterations of this site, I accessed Civi and I'm in the process of configuring.</p>
  <p>I still don't know what caused it to get over its error, but wanted to note that it does seem to have solved itself (I was at a loss so while I worked on other parts of the site, I did not manage anything to solve the civi problem).</p>
  <p>Best of luck to anyone else who encounters this!
  -tiffani</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-24T15:20:32.287Z
Answers.Text: Good that it's working but just noting two things: (1) Your urls include "web" which suggests you have the web server set up to have the site one level "higher" than usual. Normally the document_root is set to point to the web folder so it isn't in the url. (2) The error you posted isn't a DB Error, and it possibly suggests you have an unpatched pear/log, meaning that your top-level composer.json does not have `"extra": { "enable-patching": true,` in it, or it does but the patches didn't run during composer download/install.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-24T18:33:07.897Z
Answers.Text: Thank you for the insights.  I've been trying to figure out the web thing myself.  My installation is at www/www/edboost.org which, in the past has meant my root was at EdBoost.org.  But when I installed Drupal it sent me to edboost.org/edboost.org/web. And now I realize that the base URL for my civi install is edboost.org/edboost.org/web/edboost.org/web, which is causing my other problems.  I'm new to Composer.  Do you think there's something about how I'm installing that's creating these additional levels (which are not actual directories)?
Answers.UserDisplayName: Tiffani Chin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-24T18:36:21.760Z
Answers.Text: And, actually, I finally got Civi working last night, but when I tried to import contacts this morning, I got the error saying my base_URL was incorrect.  Changing it has let to a Critical Error for the entire site.    I do want to get this right, but I'm just not sure what to do.  Trying to following all installation instructions to a T but getting these weird settings.  I'd appreciate any advice.  
  
  And I'll check out the composer. json and look for that setting.  THANK YOU!
Answers.UserDisplayName: Tiffani Chin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-28T19:11:55.393Z
Answers.Text: @Demerit, thank you for the insights.  I ended up reinstalling Drupal and Civi and have them on the correct root now (finally) which has resolved many of my issues.  Appreciate the flag.
Answers.UserDisplayName: Tiffani Chin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-24T03:38:47.277Z
Answers.LastActivityDate: 2024-05-24T03:38:47.277Z
Answers.UserDisplayName: Tiffani Chin
Body: <p>Brand new Civi installation on a brand new Drupal 10 site.  Followed the instructions on the Civi documentation. Everything checks out in the Drupal Status; everything seems to have installed corrected.</p>
  <p>But when I try to go to Civicrm home to configure, I get a DB error: constraint violation.</p>
  <p>Debug gives me this:</p>
  <p>`Location   <a href="https://edboost.org/edboost.org/web/civicrm" rel="nofollow noreferrer">https://edboost.org/edboost.org/web/civicrm</a></p>
  <p>Referrer    <a href="https://edboost.org/edboost.org/web/admin/config/development/performance" rel="nofollow noreferrer">https://edboost.org/edboost.org/web/admin/config/development/performance</a></p>
  <p>Message Deprecated function: Function strftime() is deprecated in Log_file-&gt;log() (line 294 of /home/vsource4/www/www/edboost.org/vendor/pear/log/Log/file.php)
  #0 /home/vsource4/www/www/edboost.org/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'Function strfti...', '/home/vsource4/...', 294)
  #1 /home/vsource4/www/www/edboost.org/vendor/pear/log/Log/file.php(294): _drupal_error_handler(8192, 'Function strfti...', '/home/vsource4/...', 294)
  #2 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(604): Log_file-&gt;log('$backTrace = #0...', 7)
  #3 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(576): CRM_Core_Error::debug_log_message('$backTrace = #0...', false, '', 7)
  #4 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(747): CRM_Core_Error::debug_var('backTrace', '#0 /home/vsourc...', true, true, '', 7)
  #5 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(443): CRM_Core_Error::backtrace('backTrace', true)
  #6 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(Civi\Core\Exception\DBQueryException))
  #7 /home/vsource4/www/www/edboost.org/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke(Array)
  #8 /home/vsource4/www/www/edboost.org/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(83): Drupal\civicrm\Civicrm-&gt;invoke(Array)
  #9 [internal function]: Drupal\civicrm\Controller\CivicrmController-&gt;main(Array, '')
  #10 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
  #11 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber{closure}()
  #12 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
  #13 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array)
  #14 /home/vsource4/www/www/edboost.org/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber{closure}()
  #15 /home/vsource4/www/www/edboost.org/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
  #16 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #17 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #18 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #19 /home/vsource4/www/www/edboost.org/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #20 /home/vsource4/www/www/edboost.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #21 /home/vsource4/www/www/edboost.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #22 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #23 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #24 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #25 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #26 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #27 /home/vsource4/www/www/edboost.org/web/index.php(19): Drupal\Core\DrupalKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request))
  #28 {main}`</p>
  <p>Has anyone encountered this?  I'm not sure where to go from here (long time Civi user, but struggling to get this new install up and running).</p>
  <p>Thanks in advance!
  -tiffani</p>
  
Tags: <drupal><installation>
Title: DB constraint violation: newly installed but cannot get to Civi home screen
ThreadText: # DB constraint violation: newly installed but cannot get to Civi home screen
  
  (Asked by: username_0 on 2024-05-23)
  
  Brand new Civi installation on a brand new Drupal 10 site. Followed the instructions on the Civi documentation. Everything checks out in the Drupal Status; everything seems to have installed corrected.
  
  But when I try to go to Civicrm home to configure, I get a DB error: constraint violation.
  
  Debug gives me this:
  
  `Location <https://edboost.org/edboost.org/web/civicrm>
  
  Referrer <https://edboost.org/edboost.org/web/admin/config/development/performance>
  
  Message Deprecated function: Function strftime() is deprecated in Log\_file->log() (line 294 of /home/vsource4/www/www/edboost.org/vendor/pear/log/Log/file.php)
  #0 /home/vsource4/www/www/edboost.org/web/core/includes/bootstrap.inc(164): \_drupal\_error\_handler\_real(8192, 'Function strfti...', '/home/vsource4/...', 294)
  #1 /home/vsource4/www/www/edboost.org/vendor/pear/log/Log/file.php(294): \_drupal\_error\_handler(8192, 'Function strfti...', '/home/vsource4/...', 294)
  #2 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(604): Log\_file->log('$backTrace = #0...', 7)
  #3 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(576): CRM\_Core\_Error::debug\_log\_message('$backTrace = #0...', false, '', 7)
  #4 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(747): CRM\_Core\_Error::debug\_var('backTrace', '#0 /home/vsourc...', true, true, '', 7)
  #5 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Error.php(443): CRM\_Core\_Error::backtrace('backTrace', true)
  #6 /home/vsource4/www/www/edboost.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(39): CRM\_Core\_Error::handleUnhandledException(Object(Civi\Core\Exception\DBQueryException))
  #7 /home/vsource4/www/www/edboost.org/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM\_Core\_Invoke::invoke(Array)
  #8 /home/vsource4/www/www/edboost.org/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(83): Drupal\civicrm\Civicrm->invoke(Array)
  #9 [internal function]: Drupal\civicrm\Controller\CivicrmController->main(Array, '')
  #10 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call\_user\_func\_array(Array, Array)
  #11 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
  #12 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
  #13 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
  #14 /home/vsource4/www/www/edboost.org/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
  #15 /home/vsource4/www/www/edboost.org/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
  #16 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #17 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #18 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #19 /home/vsource4/www/www/edboost.org/web/core/modules/big\_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #20 /home/vsource4/www/www/edboost.org/web/core/modules/page\_cache/src/StackMiddleware/PageCache.php(106): Drupal\big\_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #21 /home/vsource4/www/www/edboost.org/web/core/modules/page\_cache/src/StackMiddleware/PageCache.php(85): Drupal\page\_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #22 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page\_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #23 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #24 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #25 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #26 /home/vsource4/www/www/edboost.org/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
  #27 /home/vsource4/www/www/edboost.org/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
  #28 {main}`
  
  Has anyone encountered this? I'm not sure where to go from here (long time Civi user, but struggling to get this new install up and running).
  
  Thanks in advance!
  -tiffani
  
  **Tags:** drupal, installation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-05-24. Score: 1
  
  Not sure what to say. Worked on this site all day and got the same DB error for hours. Suddenly, tonight, sat down to do some more work and for the first time in 3 different iterations of this site, I accessed Civi and I'm in the process of configuring.
  
  I still don't know what caused it to get over its error, but wanted to note that it does seem to have solved itself (I was at a loss so while I worked on other parts of the site, I did not manage anything to solve the civi problem).
  
  Best of luck to anyone else who encounters this!
  -tiffani
  
  > **Comments:**
  > **username_1**: Good that it's working but just noting two things: (1) Your urls include "web" which suggests you have the web server set up to have the site one level "higher" than usual. Normally the document_root is set to point to the web folder so it isn't in the url. (2) The error you posted isn't a DB Error, and it possibly suggests you have an unpatched pear/log, meaning that your top-level composer.json does not have `"extra": { "enable-patching": true,` in it, or it does but the patches didn't run during composer download/install.  
  > **username_0**: Thank you for the insights.  I've been trying to figure out the web thing myself.  My installation is at www/www/edboost.org which, in the past has meant my root was at EdBoost.org.  But when I installed Drupal it sent me to edboost.org/edboost.org/web. And now I realize that the base URL for my civi install is edboost.org/edboost.org/web/edboost.org/web, which is causing my other problems.  I'm new to Composer.  Do you think there's something about how I'm installing that's creating these additional levels (which are not actual directories)?  
  > **username_0**: And, actually, I finally got Civi working last night, but when I tried to import contacts this morning, I got the error saying my base_URL was incorrect.  Changing it has let to a Critical Error for the entire site.    I do want to get this right, but I'm just not sure what to do.  Trying to following all installation instructions to a T but getting these weird settings.  I'd appreciate any advice.    And I'll check out the composer. json and look for that setting.  THANK YOU!  
  > **username_0**: @username_1, thank you for the insights.  I ended up reinstalling Drupal and Civi and have them on the correct root now (finally) which has resolved many of my issues.  Appreciate the flag.  
  
  ---
  
  