Answers.Body: <p>It sounds drupal hasn't had a chance to boot yet before that gets called. Try disabling the environmentindicator extension first, since it's calling it during hook_config which might be too early here.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-02T10:00:56.293Z
Answers.Text: Yes, this did the trick. Thanks!
Answers.UserDisplayName: Webmaster COVS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-01T16:03:50.903Z
Answers.LastActivityDate: 2023-04-01T16:03:50.903Z
Answers.UserDisplayName: Demerit
Body: <p>When I try to upgrade via cv, I get the following error:</p>
  <pre><code>In DrupalBase.php line 282:
  
  [Error] Call to undefined function _drupal_flush_css_js()
  </code></pre>
  <p>I am able to do the upgrade within the GUI.</p>
  <p>Any thoughts?</p>
  <p>Verbose listing:</p>
  <pre><code>~/p$ cv -vvv upgrade:db
  
  Box Requirements Checker
  ========================
  
  &gt; Using PHP 8.1.13
  &gt; PHP is using the following php.ini file:
    /usr/local/php81/lib/php.ini
  
  &gt; Checking Box requirements:
    ✔ The application requires a version matching &quot;&gt;=7.3.0&quot;.
    ✔ The application requires the extension &quot;json&quot;.
    ✔ The package &quot;psy/psysh&quot; requires the extension &quot;json&quot;.
    ✔ The package &quot;jakub-onderka/php-console-highlighter&quot; requires the extension &quot;tokenizer&quot;.
    ✔ The package &quot;nikic/php-parser&quot; requires the extension &quot;tokenizer&quot;.
    ✔ The package &quot;psy/psysh&quot; requires the extension &quot;tokenizer&quot;.
  
  
   [OK] Your system is ready to run the application.
  
  
  [BootTrait] Start
  [BootTrait] Attempting to set verbose error reporting
  [BootTrait] Call standard cv bootstrap
  [Bootstrap] Options: {
      &quot;dynamicSettingsFile&quot;: &quot;phar:///home/myuser/vendor/bin/cv/settings_location.php&quot;,
      &quot;env&quot;: &quot;CIVICRM_SETTINGS&quot;,
      &quot;prefetch&quot;: true,
      &quot;settingsFile&quot;: null,
      &quot;search&quot;: true,
      &quot;cmsType&quot;: null,
      &quot;httpHost&quot;: &quot;&quot;,
      &quot;output&quot;: {}
  }
  [Bootstrap] Find settings file
  [Bootstrap] Load supplemental configuration for &quot;/home/myuser/p/sites/default/civicrm.settings.php&quot;
  [Bootstrap] Find CMS root for &quot;/home/myuser/p&quot;
  [Bootstrap] Found &quot;drupal&quot; in &quot;/home/myuser/p&quot;
  [Bootstrap] Simulate web environment in CLI
  [Bootstrap] Load settings file &quot;/home/myuser/p/sites/default/civicrm.settings.php&quot;
  [Bootstrap] Initialize class loader
  [Bootstrap] Call core bootstrap
  
  In DrupalBase.php line 282:
  
    [Error]
    Call to undefined function _drupal_flush_css_js()
  
  
  Exception trace:
    at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php:282
   CRM_Utils_System_DrupalBase-&gt;clearResourceCache() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:362
   CRM_Core_Resources-&gt;resetCacheCode() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:138
   CRM_Core_Resources-&gt;__construct() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/Container.php:557
   Civi\Core\Container::createResources() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:1130
   Symfony\Component\DependencyInjection\ContainerBuilder-&gt;createService() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:618
   Symfony\Component\DependencyInjection\ContainerBuilder-&gt;doGet() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:558
   Symfony\Component\DependencyInjection\ContainerBuilder-&gt;get() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi.php:175
   Civi::service() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:116
   CRM_Core_Resources::singleton() at /home/myuser/domains/mydomain/public_html/sites/default/files/civicrm/ext/nz.co.fuzion.environmentindicator/environmentindicator.php:13
   environmentindicator_civicrm_config() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:271
   CRM_Utils_Hook-&gt;runHooks() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php:73
   CRM_Utils_Hook_DrupalBase-&gt;invokeViaUF() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php:306
   Civi\Core\CiviEventDispatcher::delegateToUF() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php:251
   Symfony\Component\EventDispatcher\EventDispatcher-&gt;callListeners() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php:73
   Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php:260
   Civi\Core\CiviEventDispatcher-&gt;dispatch() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:167
   CRM_Utils_Hook-&gt;invoke() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:1382
   CRM_Utils_Hook::config() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Config.php:94
   CRM_Core_Config::singleton() at phar:///home/myuser/vendor/bin/cv/src/Bootstrap.php:104
   Civi\Cv\Bootstrap-&gt;boot() at phar:///home/myuser/vendor/bin/cv/src/Util/BootTrait.php:69
   Civi\Cv\Command\UpgradeDbCommand-&gt;_boot_full() at phar:///home/myuser/vendor/bin/cv/src/Util/BootTrait.php:44
   Civi\Cv\Command\UpgradeDbCommand-&gt;boot() at phar:///home/myuser/vendor/bin/cv/src/Command/UpgradeDbCommand.php:31
   Civi\Cv\Command\UpgradeDbCommand-&gt;execute() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Command/Command.php:127
   Cvphar\Symfony\Component\Console\Command\Command-&gt;run() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:637
   Cvphar\Symfony\Component\Console\Application-&gt;doRunCommand() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:190
   Cvphar\Symfony\Component\Console\Application-&gt;doRun() at phar:///home/myuser/vendor/bin/cv/src/Application.php:66
   Civi\Cv\Application-&gt;doRun() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:101
   Cvphar\Symfony\Component\Console\Application-&gt;run() at phar:///home/myuser/vendor/bin/cv/src/Application.php:32
   Civi\Cv\Application::main() at phar:///home/myuser/vendor/bin/cv/bin/cv:28
   require() at /home/myuser/vendor/bin/cv:14
  
  upgrade:db [--out OUT] [--flat [FLAT]] [--dry-run] [--retry] [--skip] [--step] [--level LEVEL] [--hostname HOSTNAME] [-t|--test] [-U|--user USER]
  </code></pre>
  
Tags: <upgrade><cv>
Title: cv upgrade:db causes error
ThreadText: # cv upgrade:db causes error
  
  (Asked by: username_0 on 2023-04-01)
  
  When I try to upgrade via cv, I get the following error:
  
  ```
  In DrupalBase.php line 282:
  
  [Error] Call to undefined function _drupal_flush_css_js()
  
  ```
  
  I am able to do the upgrade within the GUI.
  
  Any thoughts?
  
  Verbose listing:
  
  ```
  ~/p$ cv -vvv upgrade:db
  
  Box Requirements Checker
  ========================
  
  > Using PHP 8.1.13
  > PHP is using the following php.ini file:
    /usr/local/php81/lib/php.ini
  
  > Checking Box requirements:
    ✔ The application requires a version matching ">=7.3.0".
    ✔ The application requires the extension "json".
    ✔ The package "psy/psysh" requires the extension "json".
    ✔ The package "jakub-onderka/php-console-highlighter" requires the extension "tokenizer".
    ✔ The package "nikic/php-parser" requires the extension "tokenizer".
    ✔ The package "psy/psysh" requires the extension "tokenizer".
  
   [OK] Your system is ready to run the application.
  
  [BootTrait] Start
  [BootTrait] Attempting to set verbose error reporting
  [BootTrait] Call standard cv bootstrap
  [Bootstrap] Options: {
      "dynamicSettingsFile": "phar:///home/myuser/vendor/bin/cv/settings_location.php",
      "env": "CIVICRM_SETTINGS",
      "prefetch": true,
      "settingsFile": null,
      "search": true,
      "cmsType": null,
      "httpHost": "",
      "output": {}
  }
  [Bootstrap] Find settings file
  [Bootstrap] Load supplemental configuration for "/home/myuser/p/sites/default/civicrm.settings.php"
  [Bootstrap] Find CMS root for "/home/myuser/p"
  [Bootstrap] Found "drupal" in "/home/myuser/p"
  [Bootstrap] Simulate web environment in CLI
  [Bootstrap] Load settings file "/home/myuser/p/sites/default/civicrm.settings.php"
  [Bootstrap] Initialize class loader
  [Bootstrap] Call core bootstrap
  
  In DrupalBase.php line 282:
  
    [Error]
    Call to undefined function _drupal_flush_css_js()
  
  Exception trace:
    at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php:282
   CRM_Utils_System_DrupalBase->clearResourceCache() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:362
   CRM_Core_Resources->resetCacheCode() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:138
   CRM_Core_Resources->__construct() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/Container.php:557
   Civi\Core\Container::createResources() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:1130
   Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:618
   Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php:558
   Symfony\Component\DependencyInjection\ContainerBuilder->get() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi.php:175
   Civi::service() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Resources.php:116
   CRM_Core_Resources::singleton() at /home/myuser/domains/mydomain/public_html/sites/default/files/civicrm/ext/nz.co.fuzion.environmentindicator/environmentindicator.php:13
   environmentindicator_civicrm_config() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:271
   CRM_Utils_Hook->runHooks() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php:73
   CRM_Utils_Hook_DrupalBase->invokeViaUF() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php:306
   Civi\Core\CiviEventDispatcher::delegateToUF() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php:251
   Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php:73
   Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php:260
   Civi\Core\CiviEventDispatcher->dispatch() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:167
   CRM_Utils_Hook->invoke() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Utils/Hook.php:1382
   CRM_Utils_Hook::config() at /home/myuser/domains/mydomain/public_html/sites/all/modules/civicrm/CRM/Core/Config.php:94
   CRM_Core_Config::singleton() at phar:///home/myuser/vendor/bin/cv/src/Bootstrap.php:104
   Civi\Cv\Bootstrap->boot() at phar:///home/myuser/vendor/bin/cv/src/Util/BootTrait.php:69
   Civi\Cv\Command\UpgradeDbCommand->_boot_full() at phar:///home/myuser/vendor/bin/cv/src/Util/BootTrait.php:44
   Civi\Cv\Command\UpgradeDbCommand->boot() at phar:///home/myuser/vendor/bin/cv/src/Command/UpgradeDbCommand.php:31
   Civi\Cv\Command\UpgradeDbCommand->execute() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Command/Command.php:127
   Cvphar\Symfony\Component\Console\Command\Command->run() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:637
   Cvphar\Symfony\Component\Console\Application->doRunCommand() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:190
   Cvphar\Symfony\Component\Console\Application->doRun() at phar:///home/myuser/vendor/bin/cv/src/Application.php:66
   Civi\Cv\Application->doRun() at phar:///home/myuser/vendor/bin/cv/vendor/symfony/console/Application.php:101
   Cvphar\Symfony\Component\Console\Application->run() at phar:///home/myuser/vendor/bin/cv/src/Application.php:32
   Civi\Cv\Application::main() at phar:///home/myuser/vendor/bin/cv/bin/cv:28
   require() at /home/myuser/vendor/bin/cv:14
  
  upgrade:db [--out OUT] [--flat [FLAT]] [--dry-run] [--retry] [--skip] [--step] [--level LEVEL] [--hostname HOSTNAME] [-t|--test] [-U|--user USER]
  
  ```
  
  **Tags:** upgrade, cv
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-01. Score: 0 | Accepted answer
  
  It sounds drupal hasn't had a chance to boot yet before that gets called. Try disabling the environmentindicator extension first, since it's calling it during hook\_config which might be too early here.
  
  > **Comments:**
  > **username_0**: Yes, this did the trick. Thanks!  
  
  ---
  
  