Are there problems withe the 8.1.8 update? First time I've had any issues with a simple Drupal 8 update. And why does drupal.org continue to show 8.1.7 released on the home page with no update? Keep getting
"Not present
Your sites/default/settings.php file must define the $config_directories variable as an array containing the names of directories in which configuration files can be found. It must contain a sync key."
Been trying a bunch of stuff and can't seem to find what's going on. A little disconcerting.

Comments

VM’s picture

/**
 * Location of the site configuration files.
 *
 * The $config_directories array specifies the location of file system
 * directories used for configuration data. On install, the "sync" directory is
 * created. This is used for configuration imports. The "active" directory is
 * not created by default since the default storage for active configuration is
 * the database rather than the file system. (This can be changed. See "Active
 * configuration settings" below).
 *
 * The default location for the "sync" directory is inside a randomly-named
 * directory in the public files path. The setting below allows you to override
 * the "sync" location.
 *
 * If you use files for the "active" configuration, you can tell the
 * Configuration system where this directory is located by adding an entry with
 * array key CONFIG_ACTIVE_DIRECTORY.
 *
 * Example:
 * @code
 *   $config_directories = array(
 *     CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot',
 *   );
 * @endcode
 */
$config_directories = array();

Is the above included in your settings.php file? If no, then you will need to make sure you replace the default.settings.php and settings.php file in your core.

gelierb’s picture

VM - thanks for the comment...

=== $config_directories = array(); is indeed in the settings.php file. In fact nothing has been changed in that file now or during other updates.

I'm not sure what it all means of course -
=== the:
$settings['install_profile'] = 'standard';
$config_directories['active'] = 'sites/default/files/config_...;
$config_directories['staging'] = 'sites/default/files/config_...';
stuff that shows up at the bottom of the file.

=== the:
$settings['hash_salt'] = ... in the file.

=== why your comments talk about "CONFIG_SYNC_DIRECTORY":
* Example:
* @code
* $config_directories = array(
* CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot',
* );
* @endcode

=== mine talk about:
* Example:
* @code
* $config_directories = array(
* CONFIG_ACTIVE_DIRECTORY => '/some/directory/outside/webroot',
* CONFIG_STAGING_DIRECTORY => '/another/directory/outside/webroot',
* );
* @endcode

========= bottom line - why I have this status error:
"Not present
Your sites/default/settings.php file must define the $config_directories variable as an array containing the names of directories in which configuration files can be found. It must contain a sync key."
when as far as I can tell - nothing has changed from before :(

gelierb’s picture

OK - so now the download page for 8.1.8 has been updated and says:
"#2466197: Staging directory should not have to be writeable. was missing logic to create the sync directory.... The solution is to either use the 8.1.x-dev release, or upgrade to the next patch release (e.g. 8.1.9 or 8.2.0-beta2)."

If the "solution" is to wait and upgrade to a later patch, why is this patch even still available? Guess I just don't get the big picture here.

lukejoliat’s picture

Any update on this? I'm running 8.19 and I'm still getting the same missing config directories error.

tamarpe’s picture

I removed the settings.php file, copy the default.settings.php file (from the drupal 8.18) to the /sites/default directory and changed it to settings.php
I filled the details with the existing database name, username & password and it's gone.
(It's not re-install your database, it uses the existing one).

muzeebahmad’s picture

Paste below line in sites/default/settings.php file's line 247
$config_directories = array(CONFIG_SYNC_DIRECTORY => 'webroot',);
This Worked for me in drupal 8.2.4 You can try it might work for you

denisomerovic’s picture

now this shows up "The directory webroot does not exist".

mmjvb’s picture

$config_directories['sync'] = 'sites/default/files/config_jCRVU4W927AjY7e5FIaf_W9RT_Qgftm3KE6BGvQQCaRMt9uQwenJanjSkWXCbBD-KkyjafG0AA/sync';

Obviously, between config and /sync depends on your environment.

denisomerovic’s picture

I solved the problem. Thanks for your help

adminMN2023’s picture

Can you let us know how you solved the problem? Thanks!

denisomerovic’s picture

My site is on local. I just find this folder 'config_acqTmp-2017-02-09T19.04.11-8467' in my 'sites\default\files' and i just copied in 247 line in settings.php file and save it. So in your case this folder 'config_acqTmp-2017-02-09T19.04.11-8467' will look a little bit different.
$config_directories['sync'] = 'sites\default\files\config_acqTmp-2017-02-09T19.04.11-8467'; - this is the line that i copied on 247 line in settings.php.
$config_directories['sync'] = 'sites\default\files\your config folder goes here'; - try this and let me know.

walking-bird’s picture

This solution worked for me.
In order to find that config_gobblygook, I looked in docroot/sites/default/files and in there is a folder named config_ and then a whole bunch of letters and numbers. I copied that full name and then inserted it into line 247 of the settings.php file.
I'm using Drupal 8.2.3

Mr. Horse’s picture

Hi, I'm new to D8 and trying to resolve this problem but not quite understanding the fix.

Exactly how are you supposed to insert/paste the 'config_acqTmp-20...' text (mentioned in above posts) into line 247?
Line 247 falls inside these lines of code in the settings.php file:

* Example:
* @code
* $config_directories = array(
* CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot',
* );
* @endcode

I've been messing with it, trying various ways, but can't get it to work. I fixed the Trusted Host Settings error...this one eludes me.

Can someone please copy the 'code' above and show me what it would look like with the fix inserted?

mmjvb’s picture

$config_directories['sync'] = 'sites/default/files/config_jCRVU4W927AjY7e5FIaf_W9RT_Qgftm3KE6BGvQQCaRMt9uQwenJanjSkWXCbBD-KkyjafG0AA/sync';

Again, name of folder config_ needs to be looked up in your environment!

Mr. Horse’s picture

Thanks for chiming in, mmjvb!

Should it look like this (but with my full folder config_):

* Example:
* @code
* $config_directories['sync'] = 'sites/default/files/
* config_acqTmp-2017/sync';
* @endcode

or like this:

* Example:
* @code
* $config_directories['sync'] = 'sites/default/files/config_acqTmp-2017/sync';
* @endcode

Because either way, it still isn't working for me.
Am I missing something here? Do I need to do something else to get this error cleared up?
BTW, what is the # line you're referring to?

mmjvb’s picture

Both examples you gave show comments. Don't change the comments. Anything between /* and */ is a comment.
It should look like I showed you. And again, it doesn't matter where you put the line.

Just as an example the last lines of my settings.php:

#
# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
#   include $app_root . '/' . $site_path . '/settings.local.php';
# }
$databases['default']['default'] = array (
  'database' => 'd825',
  'username' => 'root',
  'password' => '',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
$settings['install_profile'] = 'standard';
$config_directories['sync'] = 'sites/default/files/config_jCRVU4W927AjY7e5FIaf_W9RT_Qgftm3KE6BGvQQCaRMt9uQwenJanjSkWXCbBD-KkyjafG0AA/sync';

$ettings['trusted_host_patterns'] = array(
    '^localhost$',
	'd825',
);
Mr. Horse’s picture

Ok, thanks for clarifying that. Learning all the time!

I did as you've directed but it is still throwing up an error. It has changed the error message though. Now it says the directory: sites/default/files/config_acqTmp-2017/sync does not exist. I double checked the (full) config file title and it's correct.

Any idea why it would say it doesn't exist?

mmjvb’s picture

Either the name is wrong, think about case sensitivity or where is the rest of the date. Or there is something wrong with security settings of one of the folders in the path. Check the full path and verify whether apache has access to each folder.

Mr. Horse’s picture

Ok, I finally figured it out. There was no 'sync' folder in the 'config_acqTmp-2017' folder!

As soon as I added the sync folder the error disappeared, and I'm good to go.

Thanks for your help, patience and time in responding to me on this issue.

mmjvb’s picture

Glad you found it in the end (pun intended, ;) ).

Vectorizer’s picture

This whole thread helped me in resolving the issue

Bahson’s picture

This helped.. even though inside my config_...... folder there was no sync folder. I made one and the errors were gone. Thanks

MirnaFalkner’s picture

Thank you, mmjvb:
$config_directories['sync'] = 'sites/default/files/config_jCRVU4W927AjY7e5FIaf_W9RT_Qgftm3KE6BGvQQCaRMt9uQwenJanjSkWXCbBD-KkyjafG0AA/sync';

Copied the code above and replace the "config_..." file name with the name that was generated and PROBLEM SOLVED! Thank you!

Christopher James Francis Rodgers’s picture

FYI:

Baby step easy solution for end-users running
Drupal 8 locally on your computer,
in my case,
on Windows with Acquia Dev Desktop

ERROR:

Configuration directories

Not present

Your sites/[*MYSITENAME*].dd/settings.php file must define the $config_directories variable as an array containing the names of directories in which configuration files can be found. It must contain a sync key.

Solution:

[Solved] Drupal 8 Acquia error - Your sites/*/.dd/settings.php file must define the $config_directories ... contain a sync key

https://www.drupal.org/node/2891394


All the best; intended.
-Chris (great-grandpa.com)
___
"The number one stated objective for Drupal is improving usability." ~Dries Buytaert *

adminMN2023’s picture

I always had strange anomalies with Drupal 8 on DevDesktop. I can't remember what was wrong. I switched to XAMPP and it was smooth sailing ever since. (This might give folks another option if they have errors and don't know where to turn.