Giter VIP home page Giter VIP logo

fastly-magento2's Introduction

FASTLY CDN FOR MAGENTO2 DOCUMENTATION

Thank you for using the "Fastly CDN module for Magento2" (Fastly_Cdn).

This package contains everything you need to connect fastly.com (Fastly) with your Magento commerce shop and to get the most out of Fastly's powerful caching capabilities for a blazing fast e-commerce site.

Contents

Description

The Fastly_Cdn module relies on Magento2's page cache functionality and extends its Varnish capabilities to leverage Fastly's enhanced caching technology and Geo-IP support.

The second component, the VCL, configures Fastly's Varnish to process the client requests and Magento's HTML responses according to the Cache-Control headers the Fastly_Cdn module adds to every response.

Documentation

Documentation for this module can be found in the Documentation folder.

Support

Help using this module can be found by posting to Fastly's community forum.

For Fastly customers with a Support Package please reach out via the normal channels.

If there are issues/errors with integrating the module, please post details in the GitHub repository issues.

Features

The module utilises a number of features of Fastly's services. This section will provide a brief overview of the ones available in the Fastly_Cdn module.

Geo IP Detection: Using the client's IP this allows a regional store to be delivered to the user.

Serving Stale on Errors: This allows an expired copy of content to be used in case of errors on the origin. This prevents site outages being visible to users.

Serving Stale while Revalidating: This allows an expired copy of content to be served while the content is refreshed from origin. This maintains performance while keeping a fresh cache.

Soft Purging: This marks content as expired (before the TTL). Using this means that content can be freshened actively while using stale content to users for a fast site.

N.B. More in-depth explanations of these features can be found in Fastly's Documentation.

Contributing

We welcome pull requests for issues and new functionality. Please see Contributing for more details.

fastly-magento2's People

Contributors

acme avatar andrewkett avatar bados avatar bbutkovic avatar catap avatar cpartica avatar deninchoo avatar dhorytskyi avatar drwilco avatar dspe avatar fredden avatar glo05363 avatar hirokazunishi avatar hrle991 avatar ivanviduka avatar jcdennen avatar jondade avatar lauredg avatar lukas713 avatar martinpeverelli avatar mickaeldatadome avatar mizdebski-netacea avatar osrecio avatar pawel-siejba avatar pdohogne-magento avatar phoenix-bjoern avatar rswalkden avatar smaeda-ks avatar udovicic avatar vvuksan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastly-magento2's Issues

Disabling Magento_Review causes Fastly module enablement to fail

Question that was posted on IRC

So, question for anyone familiar with Fastly and Magento 2.  I'm attempting to install it on an environment with Magento_Review disabled.   Attempting to enable Fastly throws this error:

Unable to change status of modules because of the following constraints:
Cannot enable Fastly_Cdn because it depends on disabled modules:
Magento_Review: Fastly_Cdn->Magento_Config->Magento_Backend->Magento_Reports->Magento_Review
However, I can't find anything demonstrating that this dependency is needed, or even declared

Latest Version Overlay Actions No longer work

In the latest release I noticed that the overlay.js file that typically was used for the actions overlay when 404's in the fastly section. Because of that I can no longer update the fastly vcl snippet from the backend, update backend settings, and anything else that depends on the overlay. Any idea how I can fix this?

Steps to reproduce.

Click upload VCL to fastly button, overlay is supposed to slide out from the left but nothing happens

Manage custom VCL

It would be great if you could add a possibility for managing custom VCLs through Magento backend.

'Quick Purge' functionality doesn't work for static resources

Hello Fastly team,

Summary of issue
Quick Purge functionality doesn't work for static resources (but works for 'HTML' URLs)

Steps to replicate

  1. Install Fastly module (latest version) on the latest Magento (2.2.6)
  2. Go to System -> Cache Management
  3. Try to purge via 'Quick Purge' form any non-html URL like image, css, js etc, for example https://example.org/media/styles.css - notice an error message 'The purge request was not processed successfully.' (and there are no other errors in the logs).

However, it works fine for HTML pages, for example purging of 'https://example.org/what-is-new.html'
returns 'The URL's "https://example.org/what-is-new.html" cache has been cleaned.'

Fastly image rollover in Product Listing Page

Hello Team,

We are using Fastly in Product Listing Page and when we hover over the product grid image, we need an alternative image to appear. In order to achieve this we are updating the srcset attribute of the image tag.
But noticed that on initial load, the srcset has a url with an extra dpr parameter and device-pixel ratio. So when we replace the srcset on image hover to display the alternate image we are not able to include the device-pixel ratio as this will prevent the image from changing even though the srcset attribute value changes. As of now, we are only replacing the srcset along with dpr parameter and skipping device-pixel ratio on product grid image hover. Even though this works in most browsers, noticed that it doesn't work at all in IE11.
Can you please advise us how we can have an alternate image displayed in a Product listing page with Fastly enabled. Please let us know if you need any further details or information.

Thanks!
Sumayya

Fastly serving cached pages in maintenance mode - whitelisted IP

Hello Fastly team,

Summary of issue

We have acquired strange behaviour. Fastly services was able to cache pages during maintenance mode who have list of whitelisted IP ( var/.maintenance.ip ) .

Once whitelisted user (admin) hit certain pages, Fastly cached them and after that was able serve actual page to user who has been entered from non-whitelisted IP (out of network).

Steps to replicate

  1. Setup Fastly (latest version) on Magento 2.2.3
  2. Make sure to add your IP in var/.maintenance.ip
  3. Put page in maintenance mode
  4. Check homepage, if it is able to serve from outer network
  5. Hit homepage from whitelisted IP
  6. Check homepage from outer network and receive cached page

Expected outcome

User from outer network should receive maintenance page instead of cached page (by whitelisted user)

Questions

  1. This is bug can be reproduced only on our side?
  2. Can Fastly module implemented correct behaviour in this case? We already working on workaround but it is unhandy.

Best regards,

Hard Reload cache bypass for whitelisted IP addresses

I've worked with a Magento 1 varnish plugin that provided the option to bypass cache on a hard reload from the browser (CMD + SHIFT + R or SHIFT + F5).

Only for a whitelisted set of IP addresses this gave the shop owner the opportunity to peek behind the cache to see if changes were already present in Magento and would appear after a varnish flush.

Since this is probably not such a big change, would you be open to adding it to your plugin as well?

Fastly geoip redirect to the same store

If my default and current store are en_us and the popup come and offer me to switch to the en_ca store I am redirected to the current store en_us. I can reach the en_ca store with magento 2.2.6 and 2.2.7

Slack Webhook error on reindex from CLI

Hi There!

We're using fastly's module (v1.2.68) on magento cloud and when we re-index we receive the following exception if webhooks are enabled:

PHP Fatal error:  Uncaught Error: Call to a member function getUserName() on null in /app/redacted/vendor/fastly/magento2/Model/Api.php:793
Stack trace:
#0 /app/redacted/vendor/fastly/magento2/Model/Api.php(198): Fastly\Cdn\Model\Api->sendWebHook('*clean by key o...')
#1 /app/redacted/vendor/fastly/magento2/Model/PurgeCache.php(69): Fastly\Cdn\Model\Api->cleanBySurrogateKey(Array)
#2 /app/redacted/vendor/fastly/magento2/Observer/InvalidateVarnishObserver.php(89): Fastly\Cdn\Model\PurgeCache->sendPurgeRequest(Array)
#3 /app/redacted/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Fastly\Cdn\Observer\InvalidateVarnishObserver->execute(Object(Magento\Framework\Event\Observer))
#4 /app/redacted/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Fastly\Cdn\Observer\InvalidateVarnishObserver), Object(Magento\Framework\Event\Observer))
#5 /app/redacted/vendor/magento/module-staging/Model/Event/Manag in /app/redacted/vendor/fastly/magento2/Model/Api.php on line 793

This seems to be related to this section of code which seems to have a check around it to ensure the area code is adminhtml, so I'm unsure why this is happening at all, to be honest.

[BUG] Magento 2 system configuration tab broken

Bug:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Failed to check Service details.

Exception #0 (Magento\Framework\Exception\LocalizedException): Failed to check Service details.
#0 /var/www/html/vendor/fastly/magento2/Model/Config/Backend/ListAcl.php(48): Fastly\Cdn\Model\Api->checkServiceDetails()
#1 /var/www/html/vendor/magento/module-config/Model/Config/Structure/Element/Field.php(458): Fastly\Cdn\Model\Config\Backend\ListAcl->toOptionArray(true)
#2 /var/www/html/vendor/magento/module-config/Model/Config/Structure/Element/Field.php(376): Magento\Config\Model\Config\Structure\Element\Field->_getOptionsFromSourceModel(Object(Fastly\Cdn\Model\Config\Backend\ListAcl))

Added in since 1.2.43 by @tnikcevs
fastly/magento2/Model/Api.php

`

public function checkServiceDetails($test = false, $serviceId = null, $apiKey = null)
    {
        if (!$test) {
            $uri = rtrim($this->_getApiServiceUri(), '/');
            $result = $this->_fetch($uri);
        } else {
            $uri = $this->config->getApiEndpoint() . 'service/' . $serviceId;
            $result = $this->_fetch($uri, \Zend_Http_Client::GET, null, true, $apiKey);
        }

        if (!$result) {
            throw new LocalizedException(__('Failed to check Service details.'));
        }

        return $result;
    }

`
additional check breaks tab

Added by:
f7ee285

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

  1. Linux version 4.12.4-pl2 ([email protected]) (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

"At least one device pixel ratio must be selected" error shows up even when Fastly isn't enabled

Hi guys

I'm trying to save a configuration value in the Advanced => System section (unrelated to Fastly), but while doing so, I get the error At least one device pixel ratio must be selected.. Even though Fastly has never been configured on that environment.
This is on an 'integration' environment of the Magento Cloud, and we can't use Fastly over there, so it makes no sense that we try to configure it.

We are using Magento 2.2.2 and fastly/magento2 version 1.2.48

Thanks!

Version 1.0.4 doesn't surrogate key purge

When updating a product via the web ui and saving the cache invalidations are not sent to Fastly but as post with tags not Surrogate Keys

[2016-07-12 13:16:03] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":{"tags":["catalog_product_1"],"mode":"matchingAnyTag"},"is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":{"tags":["catalog_product"],"mode":"matchingAnyTag"},"is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":"surrogate key: catalog_product_1","is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":"surrogate key: catalog_product_1","is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":"surrogate key: catalog_product_1","is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":"surrogate key: catalog_product_1","is_exception":false} []
[2016-07-12 13:16:04] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":"surrogate key: catalog_product_1","is_exception":false} []
[2016-07-12 13:16:07] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://mage-3.test.jdade.me.uk/index.php/admin_1m9vxp/catalog/product/save/id/1/type/simple/store/0/set/15/key/904fed5b1dfa84b5e82157d128f27c4f6fe515af4f1065f09382aa422e048952/back/edit","invalidateInfo":{"tags":["catalog_product_1","catalog_category_product_3","catalog_category_product_4"],"mode":"matchingTag"},"is_exception":false} []

Typo in README.md

Installation -> Magento Module -> Point 4

composer config respositories.fastly-magento2 git "https://[your-github-username]:[your-github-passwd]@github.com/fastly/fastly-magento2.git"

should be:

composer config repositories.fastly-magento2 git "https://[your-github-username]:[your-github-passwd]@github.com/fastly/fastly-magento2.git"

Getting too many surrogate keys

I'm getting this in the logs:

[2017-09-17 18:05:25] report.CRITICAL: Return status 400 {"method":"GET","url":"http:/","invalidateInfo":"https://api.fastly.com/service/ [service_id] /purge"} []

I added a debug message on $responseBody in _purge() function and I see this:

[2017-09-17 18:05:25] report.CRITICAL: HTTP/1.1 400 Bad Request {"status": "fail", "reason": "Batch surrogate key request only supports up to 256 surrogate keys"} {"method":"GET","url":"http:/","invalidateInfo":"https://api.fastly.com/service/ [service_id] /purge"} []

Maybe split the cache tag keys and send consecutive purges with keys sets, each having 250-256 keys ? Or something better ?

Module dependency

It looks like observer 'invalidate_varnish' Fastly\Cdn\Observer\InvalidateVarnishObserver from vendor/fastly/magento2/etc/events.xml never runs.

I'm looking into app/etc/config.php and Fastly_Cdn module is before Magento_CacheInvalidate.
It means observer 'invalidate_varnish' from Magento_CacheInvalidate isn't replaced by the observer from Fastly_Cdn module Fastly\Cdn\Observer\InvalidateVarnishObserver.
More or less 'clean_cache_by_tags' doesn't work with Fastly_Cdn module.
'clean_cache_by_tags' is called by indexer and other code. One example would be when a product gets out of stock after customer purchase via checkout.

A quick look into module and I came up with these module.xml dependencies:

<sequence>
            <module name="Magento_Store"/>
            <module name="Magento_PageCache"/>
            <module name="Magento_CacheInvalidate"/>
</sequence>

Latest Version Purge all Error

After the latest fastly release I am getting a 500 error when doing a purge all from the backend. I am on a pro tier of magento cloud as an environment. Here is the stack trace:

Error: Uncaught exception 'Error' with message 'Call to a member function getAvailableTypes() on null' in /app/7alebf6ygqtlm/vendor/fastly/magento2/Controller/Adminhtml/FastlyCdn/Purge/All.php:67
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All::execute called at /app/7alebf6ygqtlm/vendor/magento/framework/App/Action/Action.php (107)
in Magento\Framework\App\Action\Action::dispatch called at /app/7alebf6ygqtlm/vendor/magento/module-backend/App/AbstractAction.php (229)
in Magento\Backend\App\AbstractAction::dispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (58)
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All\Interceptor::___callParent called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (138)
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All\Interceptor::Magento\Framework\Interception{closure} called at /app/7alebf6ygqtlm/vendor/magento/module-backend/App/Action/Plugin/Authentication.php (143)
in Magento\Backend\App\Action\Plugin\Authentication::aroundDispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (135)
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All\Interceptor::Magento\Framework\Interception{closure} called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (153)
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All\Interceptor::___callPlugins called at /app/7alebf6ygqtlm/generated/code/Fastly/Cdn/Controller/Adminhtml/FastlyCdn/Purge/All/Interceptor.php (26)
in Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge\All\Interceptor::dispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/App/FrontController.php (55)
in Magento\Framework\App\FrontController::dispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (58)
in Magento\Framework\App\FrontController\Interceptor::___callParent called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (138)
in Magento\Framework\App\FrontController\Interceptor::Magento\Framework\Interception{closure} called at ? (?)
in call_user_func_array called at /app/7alebf6ygqtlm/vendor/m2e/ebay-amazon-magento2/Plugin/AbstractPlugin.php (34)
in Ess\M2ePro\Plugin\AbstractPlugin::execute called at /app/7alebf6ygqtlm/vendor/m2e/ebay-amazon-magento2/Plugin/HealthStatus/Magento/Framework/App/FrontController.php (42)
in Ess\M2ePro\Plugin\HealthStatus\Magento\Framework\App\FrontController::aroundDispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (135)
in Magento\Framework\App\FrontController\Interceptor::Magento\Framework\Interception{closure} called at /app/7alebf6ygqtlm/vendor/magento/framework/Interception/Interceptor.php (153)
in Magento\Framework\App\FrontController\Interceptor::___callPlugins called at /app/7alebf6ygqtlm/generated/code/Magento/Framework/App/FrontController/Interceptor.php (26)
in Magento\Framework\App\FrontController\Interceptor::dispatch called at /app/7alebf6ygqtlm/vendor/magento/framework/App/Http.php (135)
in Magento\Framework\App\Http::launch called at /app/7alebf6ygqtlm/generated/code/Magento/Framework/App/Http/Interceptor.php (24)
in Magento\Framework\App\Http\Interceptor::launch called at /app/7alebf6ygqtlm/vendor/magento/framework/App/Bootstrap.php (256)
in Magento\Framework\App\Bootstrap::run called at /app/7alebf6ygqtlm/pub/index.php (37)

Backend frontname from app/etc/env.php is not taken into account

The following VCL entries are now static.
Request to read them from app/etc/env.php and take custom admin urls into account:

    # Increase first byte timeouts for /admin* URLs to 3 minutes
    if ( req.url ~ "^/(index\.php/)?admin(_.*)?/" ) {
      set bereq.first_byte_timeout = 180s;
    }
    # Pass all admin actions
    } else if ( req.url ~ "^/(index\.php/)?admin(_.*)?/" ) {
        set req.http.x-pass = "1";
    } else {

Magento 2.1 compatibility

I tried to install the plugin using composer on a Magento 2.1.0 installation but I noticed it's incompatible.

Problem 1
- Conclusion: don't install fastly/magento2 1.0.4
- Conclusion: don't install fastly/magento2 1.0.3
- Conclusion: don't install fastly/magento2 1.0.2
- Conclusion: don't install fastly/magento2 1.0.1
- Conclusion: don't install fastly/magento2 1.0.0|remove magento/framework 100.1.0
- Conclusion: don't install fastly/magento2 1.0.0|don't install magento/framework 100.1.0
- Installation request for fastly/magento2 ^1.0 -> satisfiable by fastly/magento2[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4].
- fastly/magento2 1.0.0 requires magento/framework 100.0.* -> satisfiable by magento/framework[100.0.2, 100.0.3, 100.0.4, 100.0.5, 100.0.6, 100.0.7, 100.0.8, 100.0.9].
- Can only install one of: magento/framework[100.1.0, 100.0.2].
- Can only install one of: magento/framework[100.1.0, 100.0.3].
- Can only install one of: magento/framework[100.1.0, 100.0.4].
- Can only install one of: magento/framework[100.1.0, 100.0.5].
- Can only install one of: magento/framework[100.1.0, 100.0.6].
- Can only install one of: magento/framework[100.1.0, 100.0.7].
- Can only install one of: magento/framework[100.1.0, 100.0.8].
- Can only install one of: magento/framework[100.1.0, 100.0.9].
- Installation request for magento/framework (locked at 100.1.0) -> satisfiable by magento/framework[100.1.0].

Adding fastly/magento2 causes "Area code not set" error

System Information

  • OS name and version: Debian 8 (Jessie)
  • PHP version: PHP 7.0.20-1~dotdeb+8.1 (cli) ( NTS
  • Database server name and version: 5.7.18 MySQL Community Server (GPL)
  • Magento version: 2.1.7 EE
  • Composer version: Composer version 1.4.1 2017-03-10 09:29:45
  • Description of the problem. What is happening that shouldn't: Error when running php ./bin/magento setup:upgrade after requiring the fastly/magento2 module.
  • Description of the expected behavior: php ./bin/magento setup:upgrade should complete without error.

Exact steps to reproduce the error:

  1. Check out a commit

  2. Cleaning caches (including generated files/classes)

  3. exec composer config repositories.fastly-magento2 git "https://github.com/fastly/fastly-magento2.git"

  4. exec composer require fastly/magento2

  5. exec composer install (to insure other dependencies match the new commit)

  6. exec php ./bin/magento setup:upgrade -vvv

    [Magento\Framework\Exception\SessionException]
    Area code not set: Area code must be set before starting a session.

    [Magento\Framework\Exception\LocalizedException]
    Area code is not set

The full stack trace is:

Exception trace:
 () at /srv/example.com.local/vendor/magento/framework/App/State.php:139
 Magento\Framework\App\State->getAreaCode() at /srv/example.com.local/vendor/magento/framework/Session/SessionManager.php:173
 Magento\Framework\Session\SessionManager->start() at /srv/example.com.local/var/generation/Magento/Framework/Session/Generic/Interceptor.php:50
 Magento\Framework\Session\Generic\Interceptor->start() at /srv/example.com.local/vendor/magento/framework/Session/SessionManager.php:130
 Magento\Framework\Session\SessionManager->__construct() at /srv/example.com.local/var/generation/Magento/Framework/Session/Generic/Interceptor.php:14
 Magento\Framework\Session\Generic\Interceptor->__construct() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:89
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /srv/example.com.local/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /srv/example.com.local/vendor/magento/framework/ObjectManager/ObjectManager.php:57
 Magento\Framework\ObjectManager\ObjectManager->create() at /srv/example.com.local/setup/src/Magento/Setup/Model/Installer.php:931
 Magento\Setup\Model\Installer->createSchemaDataHandler() at /srv/example.com.local/setup/src/Magento/Setup/Model/Installer.php:1245
 Magento\Setup\Model\Installer->getSchemaDataHandler() at /srv/example.com.local/setup/src/Magento/Setup/Model/Installer.php:841
 Magento\Setup\Model\Installer->handleDBSchemaData() at /srv/example.com.local/setup/src/Magento/Setup/Model/Installer.php:796
 Magento\Setup\Model\Installer->installDataFixtures() at /srv/example.com.local/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php:74
 Magento\Setup\Console\Command\UpgradeCommand->execute() at /srv/example.com.local/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /srv/example.com.local/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /srv/example.com.local/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /srv/example.com.local/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /srv/example.com.local/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /srv/example.com.local/bin/magento:23

Please tag version 1.2.33

Hi all

Magento starts showing notifications that version 1.2.33 is out, but running composer update doesn't find this new version yet. I think you guys forgot to tag a new version?

Thanks!

ReflectionException

I get the following error on a clean install of Magento 2.0.7:

[ReflectionException]
Class Fastly\Cdn\Console\Command\GenerateVclCommand does not exist

This is right after enabling the extension on cache:flush

Enabling module does not find ConfigPlugin

After running magento module:enable Fastly_CDN the database needs magento setup:upgrade to be run. This produces the following:

ecommerce@mage-2:/var/www/html$ bin/magento module:enable Fastly_CDN
The following modules have been enabled:
- Fastly_CDN

To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please re-run Magento compile command
Info: Some modules might require static view files to be cleared. Use the optional --clear-static-content option to clear them.
ecommerce@mage-2:/var/www/html$ bin/magento setup:upgrade



  [Zend\Soap\Exception\InvalidArgumentException]                      
  Plugin class Fastly\CDN\Model\PageCache\ConfigPlugin doesn't exist  



setup:upgrade [--keep-generated] [--magento-init-params="..."]


Convert cache tags

Magento 2.1.4
I'm seeing in debug.log:
"invalidateInfo":"surrogate key: cproduct_8","is_exception":false}
cproduct is not a surrogate key or a Magento cache tag.

Responsible for breaking tags should be the transform from:
vendor/fastly/magento2/Observer/InvalidateVarnishObserver.php

return str_replace(array_keys($fastlyTags), $fastlyTags, $tags);

"catalog_category_product_8" cache tag gets replaced by "catalog_category_" string into "cproduct_8".

The cache tag is defined in:
\Magento\Catalog\Model\Product::CACHE_PRODUCT_CATEGORY_TAG = 'catalog_category_product'
https://github.com/magento/magento2/blob/2.1.8/app/code/Magento/Catalog/Model/Product.php

I see that the cache tags are smaller in length in Magento 2.2.x and this issue may not affect it.
https://github.com/magento/magento2/blob/2.2/app/code/Magento/Catalog/Model/Product.php

'Fastly' tab in the backend dashboard is broken.

Hello Fastly team,

Summary of issue
'Fastly' tab in the backend dashboard doesn't work - Ajax request to /admin/fastlyCdn_Vcl/serviceInfo/.../?isAjax=true controller returns 404 response

Steps to replicate

  1. Install Fastly module (the latest version) on the latest Magento (2.2.7)
  2. Configure Fastly settings (fill up credentials, upload VCL etc)
  3. Navigate to Magento backend dashboard > 'Fastly' - you should see an error 'A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.' due to failed Ajax request.

Cannot purge Fastly cache in 1.2.16

There's a bug in fastly-magento2-1.2.16: I'm unable to clean Fastly cache by store or by content type from Magento admin backend. I'm getting the message: "The purge request was not processed successfully." Quick Purge (clean cache by URL) works fine. I can't reproduce this issue on version 1.2.15, so the bug is only in fastly-magento2-1.2.16.

Steps to reproduce:

install fastly-magento2-1.2.16
configure fastly (ID and token)
go to System > Tools > Cache Management
click on "Clean Fastly CDN by content type" or "Clean Fastly CDN by store"

Expected result: cache will be successfully purged and I'll get the message "The Fastly CDN has been cleaned."
Actual result: cache isn't cleaned and I get the message "The purge request was not processed successfully."

If you need some other information let me know.

ESI is not present in the HTML output. This is just a warning.

I am not able to find the reason here why this is not working, I am using the M2 EE version 2.1.8 and updated the latest fastly version but still it shows me ESI is not present in the HTML output. This is just a warning.

What will be the best way to resolve this ?

Composer install fails with 'Plugin class Fastly\Cdn\Model\PageCache\ConfigPlugin doesn't exist'

PHP version 5.6
Composer version 1.2.0
Magento version 2.0.8 EE
Fastly module version 1.0.5

Error message: Plugin class Fastly\Cdn\Model\PageCache\ConfigPlugin doesn't exist

Steps to repro:
Follow instructions for installing using composer up to bin/magento module:enable Fastly_Cdn.
When running bin/magento setup:upgrade or bin/magento cache:clean the error message above is displayed.

Requested country is not available.

I just installed fastly v1.0.12 on Magento EC 2.2.5 and getting following error in admin panel config section

1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Requested country is not available.

/public_html/vendor/fastly/magento2/Model/Statistic.php(359): Magento\Directory\Model\CountryInformationAcquirer->getCountryInfo('GB')

Add different `first_byte_timeout` value for admin

I'm experiencing 503 (first byte timeout) issues quite often in the admin section for long running things like product imports. The VCL value that the Fastly extension generates seems to be set to 15 seconds. It would be good if you could specify a different timeout value for when the request URL matches an admin frontname.

Errors during di:compile

I receive the following error while running the setup:di:compile command:

/var/www/magento# php bin/magento setup:di:compile Compilation was started. Interception cache generation... 6/7 [========================>---] 85% 2 mins 228.0 MiB Errors during compilation: Fastly\Cdn\Controller\GeoIP\GetAction Incorrect dependency in class Fastly\Cdn\Controller\GeoIP\GetAction in /var/www/magento/vendor/fastly/magento2/Controller/GeoIP/GetAction.php \Magento\Framework\UrlInterface already exists in context object Total Errors Count: 1 Errors during compilation: Fastly\Cdn\Controller\GeoIP\GetAction Incorrect dependency in class Fastly\Cdn\Controller\GeoIP\GetAction in /var/www/magento/vendor/fastly/magento2/Controller/GeoIP/GetAction.php \Magento\Framework\UrlInterface already exists in context object Total Errors Count: 1 Errors during compilation: Fastly\Cdn\Controller\GeoIP\GetAction Incorrect dependency in class Fastly\Cdn\Controller\GeoIP\GetAction in /var/www/magento/vendor/fastly/magento2/Controller/GeoIP/GetAction.php \Magento\Framework\UrlInterface already exists in context object Total Errors Count: 1

Caching KO driven pages like Homepage / Category Pages?

Configuration Insight about Detecting and Caching Primary Pages in the README: I haven't begun experimenting but the documentation doesn't talk about caching primary content pages, such as (/) homepage, category pages (at the very least). These seem like great candidates for caching. Any insight into this? Is this not mentioned for a reason? Is it not a best practice?

Is the reason because there isn't a one-size fits all solution in these situations. For example, I know my product detail page isn't quite a good contact for caching because there is dynamic content not currently using knockout.js. Would still be nice to see some insight into this in the README.md

404 for merged CSS

Hello.
We faced with broken styles on FE after flush caches.
Info:

  • fastly cdn module 1.2.51
  • magento ee 2.2.3, cloud
  • fastly settings:
    Purge category: Yes
    Purge product: Yes
    Purge CMS page: Yes
    Preserve static assets on purge: No

Steps to reproduce:

  1. Flush merged js/css files in Magento BO (button 'Flush JavaScript/CSS Cache')
  2. Flush Magento caches in Magento BO (button 'Flush Magento Cache')
  3. During flushing try to open several pages

Expected results:
Merged css/js cleaned, Fastly static content cache is flushed.

Actual results:
Merged css/js cleaned, Fastly static content cache is not flushed and as a result broken FE (see broken_fe.png) and 404 on css (see Merged_css_404.png)

broken_fe.png
broken_fe
Merged_css_404.png
merged_css_404

Unable to save Fastly configuration - the screen just scrolls to the top

Hi.

I've found a bug in fastly-magento2-1.2.12 and later versions: you can't save configuration in Magento admin backend, the save button doesn't work anymore. The 1.2.11 works fine.

Steps to reproduce:

  1. install magento
  2. install fastly-magento2-1.2.12 (or newer)
  3. login into admin backend
  4. go to System > Configuration > System
  5. under Full Page Cache, set Caching Application = Fastly CDN
  6. Enter the Fastly settings (you can enter whatever you want, it doesn't matter)
  7. Click on "Save" at top right corner

Expected result: configuration will be saved and page will be reloaded
Actual result: nothing happens when you click on "Save" button, but the page scrolls to the top instead

If you need some other information let me know.

Magento Commerce Bug

Magento Commerce has a feature which allows it to "stage" content. When that content goes live, the staging module dynamically swaps the id of which content item to use[which "version id"] without actually updating the product.

It builds up an array of cache tag strings based on the item type to purge.

Fastly dynamically changes the cache tag string during the object save/page generation . So it converts cms_block_6 to cb_6

I don't see any other time where it performs this conversion. So if given an array of strings, 'cms_block_6', 'cms_block_7', 'cms_block_9' to purge - the actual pages will not be cleared.

The relevant file to look at regarding CMS pages is vendor/magento/module-cms-staging/Model/PageApplier.php

I'm guessing this also applies to any of the cache flushes being created by staging modules but have not verified.

503 Service Unavailable error when requesting 'admin/fastlyCdn_Edge_Dictionary/ListAll'

Hi guys

Yesterday we enabled Fastly on a staging environment of the Magento Cloud.

But we sometimes see errors popping up in random adminhtml pages under Stores > Configuration (not only in Advanced > System), this error is displayed in a red box: A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

When looking through the Network tab of my inspector, I can see that some XHR requests to the Fastly module throws a 503 error which causes this problem.

I can see 3 similar XHR requests, two of them work and one fails.
The ones which work:

The one which fails with a 503 error:

And I also sometimes see this one fail with a 503 error:

It's a bit random these errors, sometimes it's the first one, sometimes the other one, sometimes even both, and then sometimes no errors, really strange behavior.

Looking at the actual contents of the response, we see something like this (it feels like this is a server error somehow, but no idea how to debug this):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>503 Service Unavailable</title>
  </head>
  <body>
    <h1>Error 503 Service Unavailable</h1>
    <p>Service Unavailable</p>
    <h3>Guru Mediation:</h3>
    <p>Details: cache-ams4432-AMS some-number some-other-number</p>
    <hr>
    <p>Varnish cache server</p>
  </body>
</html>

Extra info which might be relevant:

  • we have no Edge Dictionaries setup at the moment.
  • Magento 2.2.2
  • fastly/magento2 version 1.2.48

Any ideas what can cause this or how we can solve this?

If there are no errors, those request return valid looking json strings, so I don't think the problem is in the Fastly module itself, but actually on the server side. If we have to report this to the Magento Cloud support instead, please let us know.

Thanks!

The module breaks search engine switcher in the backend.

Hello Fastly team,

Summary of issue
It is impossible to switch search engine with installed Fastly_Cdn module via Magento backend

Steps to replicate

  1. Install Fastly module (latest version) on the latest Magento (2.2.6), no needs to enable FastlyCDN as FPC engine.
  2. Go to Stores > Configuration > Catalog > Catalog Search, uncheck 'Use default' near 'Search Engine', select 'ElasticSearch' and press 'Test Connection' button.
  3. Notice the button doesn't work.
  4. Turn off the module:
    php bin/magento module:disable Fastly_Cdn
    Repeat the second step - now 'Test Connection' button is working fine.

screen shot 2018-10-31 at 12 05 07 pm

saving configuration throws fatal error

Hi guys,
I have installed the Fastly_Cdn Magento2 module and everything seems fine. I get the option to activate and testing the Fastly Credentials works fine.

But I get this error when I try to save the configuration.
My version of Magento is 2.2.3 and Fastly_Cdn is 1.2.77.

Any suggestions?

PHP Fatal error: Uncaught Error: Call to undefined method Magento\Config\Model\Config\Structure\Element\Field\Interceptor::shouldCloneFields() in /var/www/magento2/vendor/magento/module-config/Model/Config.php:212 Stack trace: #0 /var/www/magento2/vendor/magento/module-config/Model/Config.php(312): Magento\Config\Model\Config->_processGroup('template', Array, Array, 'system/cron', Array, Array, Object(Magento\Framework\DB\Transaction), Object(Magento\Framework\DB\Transaction)) #1 /var/www/magento2/vendor/magento/module-config/Model/Config.php(146): Magento\Config\Model\Config->_processGroup('cron', Array, Array, 'system', Array, Array, Object(Magento\Framework\DB\Transaction), Object(Magento\Framework\DB\Transaction)) #2 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Config\Model\Config->save() #3 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Config\Model\Config\Interceptor->___callParent('save', Array) #4 /var/www/magento2/vendor/magento/framework/ in /var/www/magento2/vendor/magento/module-config/Model/Config.php on line 212

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.