Question

Any time I run bin/magento setup:upgrade I get Incorrect theme identification key

error

I understand the source is vendor/magento/framework/View/Design/Theme/FlyweightFactory.php so I had added echos to try and figure something out

enter image description here

I get

enter image description here

First pass 1, second pass NULL

Now, would be nice to understand where 1 and NULL come from

mysql> select theme_id, theme_path, area from theme;
+----------+-----------------+-----------+
| theme_id | theme_path      | area      |
+----------+-----------------+-----------+
|        1 | Magento/blank   | frontend  |
|        2 | Magento/backend | adminhtml |
|        3 | Magento/luma    | frontend  |
+----------+-----------------+-----------+
mysql> select * from core_config_data where path like '%theme%';
+-----------+----------+----------+-----------------------+-------+
| config_id | scope    | scope_id | path                  | value |
+-----------+----------+----------+-----------------------+-------+
|        34 | stores   |        1 | design/theme/theme_id | 3     |
|        58 | websites |        1 | design/theme/theme_id | 3     |
|        82 | default  |        0 | design/theme/theme_id | 3     |
+-----------+----------+----------+-----------------------+-------+

Only theme set is 3 (Luma), so I don't get how 1 gets passed. I don't know where the "crontab" area theme is set. Is there anywhere I can set that value so I won't get the error?

Any help is appreciated, happy to provide more info.

Was it helpful?

Solution

insert into theme VALUES (4, 1, 'Magento/luma', 'Magento Luma Cron', NULL, 0, 'crontab', 0, 'Magento/luma');

This is not recommended but, Try the above it fixed for me.

OTHER TIPS

Although I have no idea what the core issue is (and probably, as stated by @undefinederror, this is just a symptom of a misconfiguration somewhere else, because the crontab area needing a theme makes little sense to me), I will add that in addition to the new record within the theme table, I also had to override the DI preferences for Magento\Theme\Model\View\Design like so:

    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="frontend" xsi:type="string">Magento/luma</item>
                <item name="adminhtml" xsi:type="string">Magento/backend</item>
                <!-- fix "Incorrect theme identification key" -->
                <item name="crontab" xsi:type="string">Magento/luma</item>
            </argument>
        </arguments>
    </type>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top