magento2: app:config:import fails - flag column 'flag_data' is too short ?
I got this error; Import failed: Unable to unserialize value, string is corrupted. when running php bin/magento app:config:import to import my app/etc/config.php.
It turns out, the importer does a comparison in \Magento\Config\Model\Config\Importer::import. To do this comparison, it retrieves a ‘flag’; the system_config_snapshot flag. This is saved in the database. The problem is; the flag_data column in the flag table in Magento 2 is a TEXT, which is too short; it can only hold 65535 characters! It therefore cuts off the serialized data, making it corrupt.
Maybe this is a solution; ALTER TABLE flag MODIFY flag_data LONGTEXT COMMENT 'Flag Data'; ?
Preconditions
- Magento 2.2
Steps to reproduce
- Dump a large enough configuration file and import it (message me for an example file, it contains client data but willing to share with Magento employees) – you should also be able to create a large config.php by inserting large data sets into the
translationtable, since it also exports i18n settings.
Expected result
- It should import
app/etc/config.php
Actual result
- Message;
Import failed: Unable to unserialize value, string is corrupted.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 19 (11 by maintainers)
I was also having this problem with app:config:import
I have a feeling this issue may not be fixed with an sql update.
On 2.3.3 this workaround was successful:
To create a large enough config.php, use https://lipsum.lipsum.com/ to generate a minimum of 66000 bytes of text and place it for example in the
default_custom_instructionsfield in config.php.Then run
php bin/magento app:config:importand runphp bin/magento app:config:importagain;ideally, there would be a mode that only dumps differences from the current config to the default values.