Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

PHP Notice: Undefined index: gardens_site_settings #1038

Closed
seanhamlin opened this issue Feb 2, 2017 · 2 comments
Closed

PHP Notice: Undefined index: gardens_site_settings #1038

seanhamlin opened this issue Feb 2, 2017 · 2 comments
Labels
Bug Something isn't working

Comments

@seanhamlin
Copy link

My system information:

  • Operating system type: Ubuntu Precise
  • Operating system version: Precise
  • BLT version: 8.6.10

Seeing this error in the logs on production Site Factory for my customer:

[02-Feb-2017 21:37:24 UTC] PHP Notice:  Undefined index: gardens_site_settings in /mnt/www/html/[SITENAME]01live/vendor/acquia/blt/settings/blt.settings.php on line 40 request_id="-"

And in the last day:

$ grep -c gardens_site_settings php-errors.log
5478
@grasmash grasmash added the Bug Something isn't working label Feb 9, 2017
@grasmash
Copy link
Contributor

grasmash commented Feb 17, 2017

@seanhamlin Can you please inspect the global variables for that server and determine which one contains the db name? Perhaps the ENV vars were change in ACSF. Currently we expect the db name to be

$GLOBALS['gardens_site_settings']['conf']['acsf_db_name'].

@nikgregory Perhaps you have a suggestion for better determining this.

@seanhamlin
Copy link
Author

Here is an example dump from a site in a production context (with bits redacted):

$ d8 @$ALIAS php-eval 'var_dump($GLOBALS['gardens_site_settings']);'
array(6) {
  ["site"]=>
  string(10) "[SITEFACTORYNAME]"
  ["env"]=>
  string(6) "01live"
  ["memcache_inc"]=>
  string(53) "profiles/gardens/modules/acquia/memcache/memcache.inc"
  ["flags"]=>
  array(0) {
  }
  ["conf"]=>
  array(5) {
    ["gardens_site_id"]=>
    int(141)
    ["gardens_db_name"]=>
    string(9) "ebysai141"
    ["acsf_site_id"]=>
    int(141)
    ["acsf_db_name"]=>
    string(9) "ebysai141"
    ["site_api_key"]=>
    string(40) "[REDACTED]"
  }
  ["file_private_path"]=>
  NULL
}

Which suggests that the code should work. Checking out the PHP error logs again on production, and it seems to have stopped on Feb 16, the last error being:

[16-Feb-2017 01:18:29 UTC] PHP Notice:  Undefined index: gardens_site_settings in /mnt/www/html/[SITEFACTORYNAME]/vendor/acquia/blt/settings/blt.settings.php on line 40 request_id="-"

Happy to close this issue.

magtak added a commit to magtak/blt that referenced this issue Apr 13, 2018
grasmash pushed a commit that referenced this issue Apr 13, 2018
Fixes #1038: PHP Notice: Undefined index: gardens_site_settings.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants