Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-1718

eZ Recommendation - the requests are not logged when using Guzzle6

    XMLWordPrintable

Details

    • Sprint 2

    Description

      The requests to YooChoose using Guzzle are not correctly logged when using Guzzle6. This line is responsible for logging the requests: https://github.com/ezsystems/EzSystemsRecommendationBundle/blob/master/Client/YooChooseNotifier.php#L412.
      In my case (see steps to reproduce below) this line isn't executed because the argument type of the anonymous function isn't correct. Guzzle catches the following internal exception:

      Argument 1 passed to EzSystems\RecommendationBundle\Client\YooChooseNotifier::EzSystems\RecommendationBundle\Client\{closure}() must be an instance of Guzzle\Http\Message\Response, instance of GuzzleHttp\Psr7\Response given, called in C:\Apache24\htdocs\ezplatform\vendor\guzzlehttp\promises\src\FulfilledPromise.php on line 39
      

      This results in the message not being logged.
      Customer also reports the related error in their Apache logs. I wasn't able to reproduce it directly (because of the above error), but the end effect is the same:

      PHP Fatal error:  Call to undefined method EzSystems\\RecommendationBundle\\Client\\YooChooseNotifier::log() in /xxx/vendor/ezsystems/recommendation-bundle/Client/YooChooseNotifier.php on line 412, referer: xxx
      

      Steps to reproduce

      1. Set up the fresh installation of eZPlatform with eZ Recommendation using the install steps: https://github.com/ezsystems/EzSystemsRecommendationBundle#step-1-installation.
      2. Put the following configuration of eZ Recommendation in your config.yml file:
        ez_recommendation:
            system:
                default:
                    yoochoose:
                        customer_id: "XXX"
                        license_key: "XXX"
                    server_uri: "http://your-site.dev"
                    recommender:
                        included_content_types: ["article"]
        
      3. Make sure you have logging enabled with the debug level (you can use dev environment for this purpose).
      4. Go to Platform UI and create and publish an article.
      5. Check your logs. There should be a message there that says "Got asynchronously 200 from YooChoose notification POST", but it isn't there.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: