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

SS 4.0.x-dev error installing with composer: Uncaught Exception: More than one YAML document exists named 'mysite' #7231

Closed
GustavoMarcante opened this issue Aug 2, 2017 · 7 comments

Comments

@GustavoMarcante
Copy link

GustavoMarcante commented Aug 2, 2017

I tried to install SilverStripe 4 using composer create-project silverstripe/installer silverstripe 4.0.x-dev (at /opt linking /opt/silverstripe to /var/www/html) and then browsing to localhost/silverstripe/install.php in a Ubuntu 16.04 desktop.
I got:

Setting up /opt/silverstripe/.htaccess

Fatal error: Uncaught Exception: More than one YAML document exists named 'mysite'. in /opt/silverstripe/vendor/silverstripe/config/src/Transformer/YamlTransformer.php:214 Stack trace: #0 /opt/silverstripe/vendor/silverstripe/config/src/Transformer/YamlTransformer.php(511): SilverStripe\Config\Transformer\YamlTransformer->getNamedYamlDocuments() #1 /opt/silverstripe/vendor/silverstripe/config/src/Transformer/YamlTransformer.php(484): SilverStripe\Config\Transformer\YamlTransformer->filterByOnlyAndExcept() #2 /opt/silverstripe/vendor/silverstripe/config/src/Transformer/YamlTransformer.php(103): SilverStripe\Config\Transformer\YamlTransformer->getSortedYamlDocuments() #3 /opt/silverstripe/vendor/silverstripe/config/src/Collections/MemoryConfigCollection.php(73): SilverStripe\Config\Transformer\YamlTransformer->transform(Object(SilverStripe\Config\Collections\MemoryConfigCollection)) #4 /opt/silverstripe/framework/src/Core/Config/CoreConfigFa in /opt/silverstripe/vendor/silverstripe/config/src/Transformer/YamlTransformer.php on line 214

I also tried to avoid tidy support warning with sudo apt install php-tidy but the warning stills there.

Thanks!

@tractorcow
Copy link
Contributor

Hi @GustavoMarcante do you have multiple files in mysite/_config? If so, can you please tell me if there are multiple Name: mysite files there? If not, this error may be a false negative we need to fix.

@tractorcow
Copy link
Contributor

@GustavoMarcante I've created a patch that doesn't fix the issue, but it will report the location of any conflicted files.

silverstripe/silverstripe-config#19

Would you be able to please copy this code into your local install and tell me what kind of error you're encountering?

@tractorcow
Copy link
Contributor

I've found the issue... the second mysite is coming from the installer.

@tractorcow
Copy link
Contributor

Fix at silverstripe/recipe-core#2

@GustavoMarcante
Copy link
Author

GustavoMarcante commented Aug 2, 2017

@tractorcow I tried to update using composer update (updated some files) and then browsing to localhost/silverstripe/install.php again, but the same error happened.
I also tried a new install with no success in fixing.
Am I missing something?

@GustavoMarcante
Copy link
Author

GustavoMarcante commented Aug 2, 2017

In /mysite/_config I have
config.yml
mysite.yml
theme.yml

I looked /vendor/silverstripe/config/src/Transformer/YamlTransformer.php and mysite/_config/mysite.yml and the changes of silverstripe/silverstripe-config#19 and https://github.com/silverstripe/recipe-core/pull/2/files were not there (yet). I changed it manually, but I had no effect.

@tractorcow
Copy link
Contributor

One more fix at #7235 will prevent that unnecessary third config file. ;)

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

No branches or pull requests

2 participants