I have a config_split configuration with name Development and folder ../config/dev
When I export the config with drush csex now the config is exported to ../config/dev/dev. It seems a collection is determined and that collection name is appended to that folder. Changing the folder to e.g. config/devtest makes sure the config is exported to config/devtest/dev. I do not understand where the dev collection comes from.
This is the config_split config:
uuid: null
langcode: nl
status: false
dependencies: { }
id: development
label: Development
folder: ../config/dev
module:
devel: 0
devel_generate: 0
field_ui: 0
kint: 0
views_ui: 0
theme: { }
blacklist:
- field_ui.settings
- devel.settings
- devel.toolbar.settings
- system.menu.devel
graylist: { }
graylist_dependents: true
graylist_skip_equal: true
weight: 0
| Comment | File | Size | Author |
|---|
Comments
Comment #2
daften commentedRelated to this, I now something get errors like this:
Comment #3
daften commentedThe module functionality is completely broken now because of this.
It seems related to the changes done for incorporating config_filter
Comment #4
bircherThis seems to be indeed a quite strange bug.
First of all thanks for sharing the configuration and the detailed error message.
Just to rule out other factors, does
drush cexwork? And do you have other modules that mess with configuration? Can you reproduce it on a fresh installation? I don't know where the extra directory/collection would come from.Comment #5
neoxavier commented+1,
my config_split.config_split.dev.yml is
I got the same issue.
In my case, my folder was ../configs/env/dev
when I did
drush csex dev, it created ../configs/env/dev/env
I tried with 8.3 and 8.4 and dev version as well
I also think that config_filter is the reason.
Comment #6
bobbygryzyngerI am also seeing this issue appear on exports using
1.0.0-beta6. I am able to reproduce it using the following steps.1. Sync the database from my remote development environment, which has
config_splitenabled and configured as follows:2. Enable my development environment split locally via
settings.php:$config['config_split.config_split.dev']['status'] = TRUE;3. Log on to the site and add an additional module to my
devsplit (for the purpose of illustration I added thesearchmodule).4. Run
drush @local_alias cex(drush 8.1.10). Here, the output is:5. When the export completes, I get the following directory structure (showing split directories for other environments):

Prior to export, the directory looked like this:

The updated and exported
config_splitconfiguration file looks like this:From what I can tell, it doesn't seem that I'm doing anything too out of the ordinary here. I am also using
config_ignorein conjunction withconfig_splitand I am usingconfig_filter 1.0.0-rc1.Please let me know if any additional information would be helpful in tracking the cause of this issue down.
Comment #7
bobbygryzyngerComment #8
bobbygryzyngerIt seems there may be some unexpected interaction with

config_ignorehere. If I go to the configuration UI I see thatshield.settingsandcore.extensionare showing up as part of myconfig_ignoresettings.This is despite
config_ignorebeing configured as follows:Comment #9
bobbygryzyngerComment #10
bircherOk so this is apparently still happening and I have no good way to debug it.
I created https://github.com/bircher/config_split_debug which is very similar to the setup in which I develop config_split and somewhat similar to the project setup we use at Nuvole.
Please fork it and modify your fork to the point that this pesky bug can be reproduced.
Then I will have the same environment and setup and I can step though it with xdebug.
Thanks for your collaboration.
Comment #11
bobbygryzynger@bircher, thanks for your responsiveness here. I haven't been able to reproduce the extra directories issue on a fresh install. But I have been able to reproduce the UI issue where split entities are being listed as ignored entities. I've opened a new issue here for this.
Comment #12
bircherHi, thanks for tying to reproduce the bug.
I just saw the following: https://github.com/bobbygryzynger/config_split_debug/commit/96b58ceec426...
This practice could indeed lead to the split having/being a collection and messing up the export after an import.
A config directory contains all the config in yaml files and all the collections in folders that contain the collections overrides. This is how
\Drupal\Core\Config\FileStorageworks and we have to accept that.So a split directory is also a FileStorage, and consequently it is not a good idea to have a FileStorage in the same path of another FileStorage. Otherwise the outer FileStorage will read the inner one as a collection. I guess you have not worked on a multilingual site or you would have seen the language directories there.
The split directory should be in a sibling directory of the sync directory. I will add a warning in the field description.
If the other issue reporters could comment on it and also reveal the location of the sync directory then maybe we can pin it down to that and it becomes a documentation issue.
Comment #13
bobbygryzynger@bircher, thanks for clarifying this.
I do have a follow up question then: is it possible to to create a directory structure where there is a directory for splits that is a sibling of the
syncdirectory, but this directory contains subdirectories where the config files are stored? As in:It seems that #5 is taking this approach. Is this also necessarily problematic because of the reasons you stated?
The use-case I am trying to solve here is for a multisite installation. Ideally, based on your comment above, I'd like to structure the directories like this, where each multisite can have its own splits:
If this isn't workable, do you have any suggestions for how split directories can be structured so that they may be further divided to support this sort of usage?
Comment #14
bircherYes both options are absolutely possible, almost anything should work so long as you don't nest file storages within each other. The folder containing config in yml should not contain other config folders, split or otherwise.
Comment #15
bobbygryzyngerThanks @bircher, the configuration above, with subdirectories of a splits directory, is working well for our use-case.
Comment #17
bircherThere has been no activity in a month.
It seems the error stemmed from using the split directory inside the the sync directory. So I added a warning now and I guess this can be closed now.
Comment #18
froboyI also ran into the above issue, coming to config_split via https://www.jeffgeerling.com/blog/2017/adding-configuration-split-drupal.... I've sent a comment to Jeff requesting he update the post to reflect the requirements above.
I can confirm that i saw the issue with my split config nested in the existing config directory and everything works fine when it's moved to a sibling as per #2863919-13: I get the collection inside of the config split directory.
Comment #19
imclean commentedThis prevents some valid split directories such as config_live as a sibling of sync directory. For example, sync directory is
sites/default/configthesites/default/config_devandsites/default/config_livewould both be invalid. Follow up: #2899516: Improve split folder validationThere's no patch here so it wasn't immediately obvious.
Comment #20
thaddeusmt commentedI was running in to this too, and fixed it my moving the "split" storage directory outside of the "sync" directory.
The instructions in the admin UI say "The directory, relative to the Drupal root, to which to save the filtered config. Recommended is a sibbling directory of what you defined in $config_directories[CONFIG_SYNC_DIRECTORY] in settings.php"
This appears to be bad advice, so maybe it should be changed.
Comment #23
landsman commentedthis is really done? can someone open this issue again?
Comment #24
radimklaskaHi friends! :-)
I just experienced the same problem - I can confirm that moving split directories out of the main config directory solves the problem.
Comment #25
albertski commentedI just ran into the same issue.
Originally it imported to the ../config/dev module but now it is exporting to ../config/dev/dev.
I think all I did was install a new module and uninstall it and then update a view.
I debugged SplitFilter->getSecondaryStorage() and the $directory is correct (../config/dev) but still config is outputting to ../config/dev/dev. If anyone has any idea where to look I can help with making a patch to fix this.
Comment #26
albertski commented@thaddesumt's solution of moving outside of sync directory fixed the issue for me.
I originally had:
I had my split directories at:
../config/dev
../config/prod
Now I updated to:
And my split directories stay the same (outside of the sync directory):
../config/dev
../config/prod