fastly / fastly-magento2

Module for integrating Fastly CDN with Magento 2 installations
BSD 3-Clause "New" or "Revised" License
147 stars 120 forks source link

Advanced -> System Page cannot be accessed with latest version of module and magento 2.2 #107

Closed jordanvector closed 6 years ago

jordanvector commented 7 years ago
  1. Linux version 4.12.4-pl2 (builder@lab.plat.farm) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Sat, 29 Jul 2017 11:33:19 +0200
  2. PHP 7.0.23-1~dotdeb+8.1
  3. Mariadb 10.1
  4. magento 2.2 enterprise
  5. Composer version 1.5.0 2017-08-08 11:08:04
  6. The advanced -> system section is not accessible with the fastly module enabled. I have tested this without the fastly module disabled and it does work correctly. Screenshot of blank system page attached configuration settings stores magento admin

Unfortunately I cannot find any error logs for this but I will keep looking

udovicic commented 7 years ago

Hi @jordanvector ,

I have tried this on latest 2.2 (not EE though) and works as expected. To help us debug this further, can you please check if there are any JS errors in browsers console and if there is anything in the PHP/Apache log?

I see that you have quite few extensions, so it is possible that some combination of them with Fastly module simply does not work.

yyevgenii commented 7 years ago

I've run into the same issue. The reason of the issue is in that the Fastly module stores serialized data in Magento database, but starting from the 2.2.0 release Magento replaces usages of unserialize with json_decode: https://devdocs.magento.com/guides/v2.2/release-notes/backward-incompatible-changes.html#database-data-format-changes

In my case Magento thrown an exception when I tried to open Advanced > System page in admin backend:

1 exception(s):
Exception #0 (InvalidArgumentException): Unable to unserialize value.

Exception #0 (InvalidArgumentException): Unable to unserialize value.
#0 vendor/magento/module-config/Model/Config/Backend/Serialized.php(55): Magento\Framework\Serialize\Serializer\Json->unserialize('a:0:{}')

The serialized data:

MariaDB [main]> select * from core_config_data where config_id=35\G
*************************** 1. row ***************************
config_id: 35
    scope: default
 scope_id: 0
     path: system/full_page_cache/fastly/fastly_advanced_configuration/geoip_country_mapping
    value: a:0:{}
1 row in set (0.00 sec)

Magento has an upgrade guide for module developers: https://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html

Fastly should upgrade the fastly/magento2 module in order to make it compatible with the 2.2 release.

yyevgenii commented 7 years ago

@jordanvector as workaround you can find and replace all serialized data in the Magento DB under the system/full_page_cache/fastly/ section. You can use some converter like the following: http://solutions.weblite.ca/php2json/index.php to convert the serialized value "a:0:{}" into JSON "[]".

jordanvector commented 7 years ago

Brilliant, that was definitely the issue. Thanks a lot @yyevgenii

shiftedreality commented 7 years ago

@jordanvector please reopen the issue, because it seems to be fixed in module itself.

vvuksan commented 7 years ago

This has been fixed in master #114 . Please give it a shot and let us know if it doesn't fix the issue.

vvuksan commented 7 years ago

Actually try this first

https://github.com/Inchoo/fastly-magento2

It won't work with 2.1. It will need to be run only on 2.2.

vvuksan commented 7 years ago

We have released the upgrade method with version 1.2.34 of the module. Here are the 2.1 => 2.2 upgrade instructions

https://github.com/fastly/fastly-magento2/blob/00f2bf042e5f708a1c3e7f49ae4f0fe71a658a76/Documentation/Guides/MAGENTO-UPGRADES.md

jordanvector commented 6 years ago

Seems like that resolved the issues, can we close the ticket?