Answers.Body: <p>I use CiviCRM/Drupal 9 in a split database configuration with Views.  Make sure that you've added the <a href="https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/views/" rel="nofollow noreferrer">necessary configuration</a> into <code>settings.php</code> (can be found under <strong>Administer menu » System Settings » CMS Database Configuration</strong>).  You'll also need the <code>civicrm_entity</code> module.</p>
  <p>Note that this is a moving target as of February 2022 - Drupal 10 won't support per-table database prefixes in <code>settings.php</code> so work is underway to use a different approach.  There is an <a href="https://www.drupal.org/project/civicrm_entity/issues/3198146" rel="nofollow noreferrer">open issue</a> (and open <a href="https://www.drupal.org/project/civicrm_entity/issues/3198146" rel="nofollow noreferrer">pull request</a>) which, once merged, will change the values you put into <code>settings.php</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-24T20:54:49.610Z
Answers.Text: I am sorry I have not updated this sooner but I was able to fix this by adding a second database without prefixes.  There is an example here: https://www.drupal.org/project/civicrm_entity/issues/3198146#comment-14352132
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-09T05:01:21.447Z
Answers.Text: thank you for your help. I have checked my database settings and they all look right for Drupal 9. Nothing should be changed on my end. Looking back at what I did, I think I updated to the newest version of civicrm_entity. I tried to go back to old dev copy I was using (probably 9 months old) and that will not work any longer. I get "'Error: Class ''Drupal\civicrm_entity\ModuleInstaller'' not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of /var/www/site/web/core/lib/Drupal/Comp'" Any ideas on where else to look is greatly appreciated
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-09T18:45:07.567Z
Answers.Text: I recall there was an issue with older versions of civicrm_entity that didn't uninstall cleanly, though I don't recall details past that - that may be related to your problem.  You can check Github or d.o for civicrm_entity issues that mention uninstall.  I suspect that if you can cleanly uninstall and reinstall civicrm_entity you'll be good - though now that I look, I too am running some older dev version.  Still, uninstall/reinstall of civicrm_entity seems like a good next move.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-08T04:22:06.013Z
Answers.LastActivityDate: 2022-02-08T04:22:06.013Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>My CiviCRM database cannot connect to my database server when it is loading a Drupal page that accesses CiviCRM through Views.</p>
  <p>We have been having all sorts of trouble with our Amazon Aurora instance but all the problems have appeared focused on the Drupal database.  We have one server but two databases running on the instance. One for Drupal 9.3.3 and one for CiviCRM 5.45.2.</p>
  <p>The error is <code>InvalidArgumentException: Minimum requirement: driver://host/database in Drupal\Core\Database\Connection::createConnectionOptionsFromUrl() (line 2021 of core/lib/Drupal/Core/Database/Connection.php).</code></p>
  <p>The full backtrace too long to include but these are the key lines:</p>
  <pre><code>Drupal\Core\Database\Database::convertDbUrlToConnectionInfo('mysql://db_name:password@db-address:port/database?new_link=true', '/var/www/web') (Line: 67)
  Drupal\civicrm_entity\Plugin\views\query\CivicrmSql-&gt;init(Object, Object, Array) (Line: 820)
  Drupal\views\Plugin\views\display\DisplayPluginBase-&gt;getPlugin('query') (Line: 1182)
  Drupal\views\ViewExecutable-&gt;initQuery() (Line: 1154)
  Drupal\views\ViewExecutable-&gt;getQuery() (Line: 242)
  Drupal\views\Plugin\views\cache\CachePluginBase-&gt;getCacheTags() (Line: 1566)
  Drupal\views\ViewExecutable-&gt;getCacheTags() (Line: 2208)
  Drupal\views\Plugin\views\display\DisplayPluginBase-&gt;applyDisplayCacheabilityMetadata(Array) (Line: 2407)
  Drupal\views\Plugin\views\display\DisplayPluginBase-&gt;buildRenderable(Array, ) (Line: 1595)
  Drupal\views\ViewExecutable-&gt;buildRenderable('block_1', Array, ) (Line: 51)
  Drupal\views\Plugin\Block\ViewsBlock-&gt;build() (Line: 171)
  Drupal\block\BlockViewBuilder::preRender(Array)
  </code></pre>
  <p>I am able to load /civicrm and I am able to connect to the database with <code>cv</code> command. I have no reason to think there would be any corruption to the database. I did recently expand the value for <code>max_allowed_packets</code>, expand the size of the RDS Aurora instance, and turn on file based long query auditing.  I do not think any of these things should break this. Further, it was working this morning after those changes were made.</p>
  <p>Any help is greatly appreciated.</p>
  <p>Thanks,</p>
  <p>Josh</p>
  
Tags: <drupal><database><drupal-views><drupal-9>
Title: Minimum requirement: driver://host/database Error
ThreadText: # Minimum requirement: driver://host/database Error
  
  (Asked by: username_0 on 2022-02-07)
  
  My CiviCRM database cannot connect to my database server when it is loading a Drupal page that accesses CiviCRM through Views.
  
  We have been having all sorts of trouble with our Amazon Aurora instance but all the problems have appeared focused on the Drupal database. We have one server but two databases running on the instance. One for Drupal 9.3.3 and one for CiviCRM 5.45.2.
  
  The error is `InvalidArgumentException: Minimum requirement: driver://host/database in Drupal\Core\Database\Connection::createConnectionOptionsFromUrl() (line 2021 of core/lib/Drupal/Core/Database/Connection.php).`
  
  The full backtrace too long to include but these are the key lines:
  
  ```
  Drupal\Core\Database\Database::convertDbUrlToConnectionInfo('mysql://db_name:password@db-address:port/database?new_link=true', '/var/www/web') (Line: 67)
  Drupal\civicrm_entity\Plugin\views\query\CivicrmSql->init(Object, Object, Array) (Line: 820)
  Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin('query') (Line: 1182)
  Drupal\views\ViewExecutable->initQuery() (Line: 1154)
  Drupal\views\ViewExecutable->getQuery() (Line: 242)
  Drupal\views\Plugin\views\cache\CachePluginBase->getCacheTags() (Line: 1566)
  Drupal\views\ViewExecutable->getCacheTags() (Line: 2208)
  Drupal\views\Plugin\views\display\DisplayPluginBase->applyDisplayCacheabilityMetadata(Array) (Line: 2407)
  Drupal\views\Plugin\views\display\DisplayPluginBase->buildRenderable(Array, ) (Line: 1595)
  Drupal\views\ViewExecutable->buildRenderable('block_1', Array, ) (Line: 51)
  Drupal\views\Plugin\Block\ViewsBlock->build() (Line: 171)
  Drupal\block\BlockViewBuilder::preRender(Array)
  
  ```
  
  I am able to load /civicrm and I am able to connect to the database with `cv` command. I have no reason to think there would be any corruption to the database. I did recently expand the value for `max_allowed_packets`, expand the size of the RDS Aurora instance, and turn on file based long query auditing. I do not think any of these things should break this. Further, it was working this morning after those changes were made.
  
  Any help is greatly appreciated.
  
  Thanks,
  
  username_0
  
  **Tags:** drupal, database, drupal-views, drupal-9
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-08. Score: 0
  
  I use CiviCRM/Drupal 9 in a split database configuration with Views. Make sure that you've added the [necessary configuration](https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/views/) into `settings.php` (can be found under **Administer menu » System Settings » CMS Database Configuration**). You'll also need the `civicrm_entity` module.
  
  Note that this is a moving target as of February 2022 - Drupal 10 won't support per-table database prefixes in `settings.php` so work is underway to use a different approach. There is an [open issue](https://www.drupal.org/project/civicrm_entity/issues/3198146) (and open [pull request](https://www.drupal.org/project/civicrm_entity/issues/3198146)) which, once merged, will change the values you put into `settings.php`.
  
  > **Comments:**
  > **username_0**: thank you for your help. I have checked my database settings and they all look right for Drupal 9. Nothing should be changed on my end. Looking back at what I did, I think I updated to the newest version of civicrm_entity. I tried to go back to old dev copy I was using (probably 9 months old) and that will not work any longer. I get "'Error: Class ''Drupal\civicrm_entity\ModuleInstaller'' not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of /var/www/site/web/core/lib/Drupal/Comp'" Any ideas on where else to look is greatly appreciated  
  > **username_1**: I recall there was an issue with older versions of civicrm_entity that didn't uninstall cleanly, though I don't recall details past that - that may be related to your problem.  You can check Github or d.o for civicrm_entity issues that mention uninstall.  I suspect that if you can cleanly uninstall and reinstall civicrm_entity you'll be good - though now that I look, I too am running some older dev version.  Still, uninstall/reinstall of civicrm_entity seems like a good next move.  
  > **username_0**: I am sorry I have not updated this sooner but I was able to fix this by adding a second database without prefixes.  There is an example here: https://www.drupal.org/project/civicrm_entity/issues/3198146#comment-14352132  
  
  ---
  
  