Question

I've tried to debug this exception.log file for a site I'm working on and I'm not very versed on the inner workings of Magento 2.1.2. The log file is now almost 100mb and it's the same message over and over. Can someone help me to located the problem files and point me in the direction of how to fix this?

For the fishpig exception, I've tried to figure out why it is not finding the css file, but I can't pinpoint it, the file exists!

Below are the repeated messages with the last 2 trace lines included:

[2017-02-07 22:17:38] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element 'product.info.options' already has a child with alias 'file' in /home/{username}/public_html/vendor/magento/framework/Data/Structure.php:611
Stack trace:
#0 /home/{username}/public_html/vendor/magento/framework/Data/Structure.php(319): Magento\Framework\Data\Structure->_insertChild('product.info.op...', 'product.info.op...', NULL, 'file')
#1 /home/{username}/public_html/vendor/magento/framework/View/Layout/ScheduledStructure/Helper.php(196): Magento\Framework\Data\Structure->setAsChild('product.info.op...', 'product.info.op...', 'file')
[2017-02-07 22:33:33] main.CRITICAL: Magento\Framework\View\Asset\File\NotFoundException: Unable to get content for 'frontend/Vizume/bencherChild/en_US/FishPig_WordPress/css/wordpress.min.css' in /home/{username}/public_html/vendor/magento/framework/View/Asset/File.php:165
Stack trace:
#0 /home/{username}/public_html/vendor/magento/framework/View/Asset/MergeStrategy/Direct.php(70): Magento\Framework\View\Asset\File->getContent()
#1 /home/{username}/public_html/vendor/magento/framework/View/Asset/MergeStrategy/Direct.php(52): Magento\Framework\View\Asset\MergeStrategy\Direct->composeMergedContent(Array, Object(Magento\Framework\View\Asset\File))
#2 /home/{username}/public_html/vendor/magento/framework/View/Asset/MergeStrategy/FileExists.php(44): Magento\Framework\View\Asset\MergeStrategy\Direct->merge(Array, Object(Magento\Framework\View\Asset\File))

For the first message, I get this same message over and over with "alias Text" , "alias Default", "alias Select" and several other terms as well.

Can someone out there tell me how to fix these? They are the only exceptions that keep throwing, but are making my file huge.

Thanks.

EDIT 1

<head>
    <css src="FishPig_WordPress/css/wordpress.css"/>
</head>
<body>
    <referenceContainer name="sidebar.main">
        <block class="FishPig\WordPress\Block\Sidebar" name="wp.sidebar" before="-" />
    </referenceContainer>
    <referenceContainer name="content">
        <block class="FishPig\WordPress\Block\Homepage\View" name="wp.homepage.view" template="post/list/wrapper.phtml">
            <block class="FishPig\WordPress\Block\Post\ListPost" name="wp.post.list" template="post/list.phtml">
                <container name="wp.post.list.renderer" as="renderer">
                    <block class="FishPig\WordPress\Block\Post" name="post.list.headi

EDIT 2 Below is the code where the as=" " are being shown. File names are CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml

                                    <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml">
                                    <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
                                    </block>
                                    <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
                                </block>

catalog_product_view.xml

                                    <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml">
                                    <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
                                    </block>
                                    <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
                                </block>

SOLUTION FOUND FOR "as" EXCEPTIONS: There has been a pull request made and the problem with the exceptions being thrown has been fixed here.

Was it helpful?

Solution

First exception is a simple alias conflict in your XML file.

main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element 'product.info.options' already has a child with alias 'file' in /home/{username}/public_html/vendor/magento/framework/Data/Structure.php:611

This means that you are using a child element with alias file under product.info.options Just check for all occurrences of product.info.options and check if child elements with as="file" exists. rename anyone and error should get removed.
The alias name is "file" which is used for multiple elements. Run command grep -rnw 'YOUR_ROOT_DIRECTORY' -e "product.info.option" --exclude-dir YOUR_ROOT_DIRECTORY/var You will find files using the term. Check each of them for "file" alias name. If there are multiple, rename anyone. You also need to update the code where is being referenced.
For second exception,

main.CRITICAL: Magento\Framework\View\Asset\File\NotFoundException: Unable to get content for 'frontend/Vizume/bencherChild/en_US/FishPig_WordPress/css/wordpress.min.css' in /home/{username}/public_html/vendor/magento/framework/View/Asset/File.php:165

First make sure that the file exist on the path. If the file is not available, just run static deploy command. If the file is there, check for it's permission if it is accessible.
your file permissions are correct, no need to change, just find the code which includes wordpress.min.css in your code and put it in your question.

OTHER TIPS

After reading the Magento docs and trying Jaimin's solutions, it seems that that the as="file" as="default" as="select" as="text" aliases that are assigned to blocks under product.info.options block are FIRSTLY DEFINED in the base theme, so the EXTENDING (not overriding) file that was written by the new theme author is repeating the same parent block/child block relationship and Magento is reading those blocks twice, thus throwing the "already has a child with alias" exception.

However, IF OVERRIDING, then the base theme file would be ignored and the aliases would only be defined once, thus not throwing the exception.

Commenting out the "repeated" block with those aliases defined seems to have fixed the exceptions.

However, the strange thing is that there are other blocks that are repeatedly defined again, but not throwing exceptions. Possible due to the "parent block/child block" relationship being a bit different?

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top