Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Php error after a couple of hours #833

Open
larnoult opened this issue Dec 1, 2021 · 1 comment
Open

Php error after a couple of hours #833

larnoult opened this issue Dec 1, 2021 · 1 comment

Comments

@larnoult
Copy link

larnoult commented Dec 1, 2021

Wordpress 5.8.2 multisite install, CiviCRM 5.43.2.
Shoreditch and Shoreditch WordPress Workarounds installed.
After activating this extension, civiCase works great on Wordpress... but only for a couple of hours.
After that, a Php fatal error happens on every pages (back and front). WordPress error message (debug mode true) is

Fatal error: Uncaught Error: Class 'CRM_Civicase_Helper_CaseSetting' not found in /www/parlemonde_330/public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php:16 Stack trace: #0 /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(109): include() #1 /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(92): Civi\Core\SettingsMetadata::loadSettingsMetadata('/www/parlemonde...') #2 /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(66): Civi\Core\SettingsMetadata::loadSettingsMetaDataFolders(Array) #3 /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(220): Civi\Core\SettingsMetadata::getMetadata(Array) #4 /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(102): Civi\Core\SettingsManager->getDefaults('domain') #5 /www/parlemonde_330/public/wp-content/uploads/civicrm/ext/firewall/ in /www/parlemonde_330/public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php on line 16
In the server log:
[error] 124524#124524: *706243 FastCGI sent in stderr: "PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/CRM/Core/Smarty/plugins/) is not within the allowed path(s): (/www/parlemonde_330/public:/www/parlemonde_330/mysqleditor:/www/parlemonde_330/web:/www/parlemonde_330/deploy:/www/parlemonde_330/deployment:/www/parlemonde_330/deployments:/usr/share:/tmp) in /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty.php on line 108PHP message: PHP Fatal error: Uncaught Error: Class 'CRM_Afform_DAO_AfformSubmission' not found in /www/parlemonde_330/public/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractEntity.php:91

@mlutfy
Copy link

mlutfy commented Dec 1, 2021

We were chatting online about this - and while debugging I found this:

$ wp civicrm api extension.refresh
PHP Fatal error:  Uncaught Error: Class 'CRM_Civicase_Helper_CaseSetting' not found in /www/public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php:16
Stack trace:
#0 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(109): include()
#1 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(92): Civi\Core\SettingsMetadata::loadSettingsMetadata()
#2 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(66): Civi\Core\SettingsMetadata::loadSettingsMetaDataFolders()
#3 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(220): Civi\Core\SettingsMetadata::getMetadata()
#4 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(102): Civi\Core\SettingsManager->getDefaults()
#5 /www//public/wp-content/uploads/civicrm/ext/firewall/firewall.php(14): Civi\Core\SettingsMa in /www//public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php on line 16
Fatal error: Uncaught Error: Class 'CRM_Civicase_Helper_CaseSetting' not found in /www//public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php:16
Stack trace:
#0 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(109): include()
#1 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(92): Civi\Core\SettingsMetadata::loadSettingsMetadata()
#2 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsMetadata.php(66): Civi\Core\SettingsMetadata::loadSettingsMetaDataFolders()
#3 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(220): Civi\Core\SettingsMetadata::getMetadata()
#4 /www//public/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsManager.php(102): Civi\Core\SettingsManager->getDefaults()
#5 /www//public/wp-content/uploads/civicrm/ext/firewall/firewall.php(14): Civi\Core\SettingsMa in /www/parlemonde_330/public/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicase-symbiotic/settings/CiviCase.setting.php on line 16

Related to the firewall extension which does this:

function firewall_civicrm_config(&$config) {
  _firewall_civix_civicrm_config($config);
  // Defaults are not loaded until *after* hook_civicrm_config is called by default
  \Civi::service('settings_manager')->useDefaults();
  $firewall = new \Civi\Firewall\Firewall();
  $firewall->run();
}

So it seems like a bit of a catch-22 between settings and the PHP include path not being set (because hook_civicrm_config from civicase has not yet run at that point).

Might be related: https://lab.civicrm.org/extensions/stripe/-/issues/326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants