Skip to content

Minicart Issue with upgrade 2.1.7-2.1.9 #11375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pioneerathletics opened this issue Oct 11, 2017 · 24 comments
Closed

Minicart Issue with upgrade 2.1.7-2.1.9 #11375

pioneerathletics opened this issue Oct 11, 2017 · 24 comments
Assignees
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@pioneerathletics
Copy link

Preconditions

  1. Magento 2.1.9 CE
  2. PHP 7.0.24
  3. Apache/2.4.23 CentOS
  4. Redis enabled
  5. All Caches enabled

Steps to reproduce

  1. Updating from 2.1.7 to 2.1.9
  2. Ran from the CLI– composer require magento/product-community-edition 2.1.9 --no-update
    composer update
  3. rm -rf /var/cache/*
    rm -rf /var/page_cache/*
    rm -rf /var/generation/*
  4. php bin/magento setup:upgrade
  5. php bin/magento setup:di:compile
  6. php bin/magento setup:static-content:deploy
  7. php bin/magento cache:flush and cache/clean
  8. No errors present in terminal

Expected result

  1. Magento should update to 2.1.9 as expected
  2. Should be able to add products to cart

Actual result

  1. Error in knockout.js when trying to add a product to the mini cart
  2. Seems to mainly happen in Google Chrome (current version)
  3. Error in console
    Uncaught ReferenceError: Unable to process binding "if: function (){return getCartParam('summary_count') }" Message: Unable to process binding "if: function (){return maxItemsToDisplay < getCartLineItemsCount() }" Message: maxItemsToDisplay is not defined at if (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:55) at ko.computed.disposeWhenNodeIsRemoved (knockout.js:3989) at evaluateImmediate (knockout.js:1737) at Object.ko.computed.ko.dependentObservable (knockout.js:1946) at init (knockout.js:3988) at knockout.js:2989 at Object.ignore (knockout.js:1249) at knockout.js:2988 at Object.arrayForEach (knockout.js:151) at applyBindingsToNodeInternal (knockout.js:2974)
  4. Error won’t clear out, even when clearing var/cache/, var/view_preprocessed/, pub/static/* and running static-content:deploy again.
  5. Even tried running setup:upgrade and setup:di:compile again but nothing cleared out the error from the browser
  6. Also tried redeploying production mode – magento deploy:mode:set production
    screen shot 2017-10-07 at 9 57 39 am copy
    screen shot 2017-10-09 at 1 45 52 pm
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 11, 2017
@orlangur
Copy link
Contributor

Please make sure your updated https://github.com/magento/magento2/blob/2.1.8/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81 corresponds to the core version. Can you reproduced on a clean Magento 2.1.9 install? What kind of minicart customizations are made?

@pioneerathletics
Copy link
Author

Hi there Vlad,
Yes I have confirmed that the linked file you've provided is the same file I have in my system. I do not have any minicart customizations whatsoever. I've only had this issue when upgrading from 2.1.7 to 2.1.9 just within the last week. Interestingly enough I updated another store to 2.1.9 during the week of Sept. 22nd and didn't notice any issues.

When I did update this week, though, I noticed the difference was symfony had several updates that weren't there the week of Sept. 22nd.

Below is Sept. 22nd upgrade to 2.1.9 on a separate store
`Updating dependencies (including require-dev)
Package operations: 0 installs, 57 updates, 0 removals

  • Updating magento/framework (100.1.7 => 100.1.9): Loading from cache
  • Updating magento/theme-frontend-blank (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/theme-frontend-luma (100.1.6 => 100.1.7): Loading from cache
  • Updating magento/module-media-storage (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-config (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-store (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-backend (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-ui (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-email (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-theme (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-directory (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-eav (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-catalog (101.0.7 => 101.0.9): Loading from cache
  • Updating magento/module-quote (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-catalog-inventory (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-page-cache (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-url-rewrite (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-cms (101.0.5 => 101.0.7): Loading from cache
  • Updating magento/module-catalog-url-rewrite (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-customer (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-integration (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-tax (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-widget (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-wishlist (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-reports (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-sales-rule (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-rule (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-checkout (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-payment (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-sales (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-gift-message (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-rss (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-downloadable (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-newsletter (100.1.2 => 100.1.4): Loading from cache
  • Updating magento/module-review (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-catalog-import-export (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-backup (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-webapi (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-vault (100.2.1 => 100.2.2): Loading from cache
  • Updating magento/module-usps (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-ups (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-configurable-product (100.1.7 => 100.1.9): Loading from cache
  • Updating magento/module-swatches (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-sitemap (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-catalog-search (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-product-video (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-paypal (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-customer-import-export (100.1.2 => 100.1.4): Loading from cache
  • Updating magento/module-currency-symbol (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-configurable-import-export (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-catalog-widget (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-bundle (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-advanced-pricing-import-export (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-admin-notification (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/magento2-base (2.1.7 => 2.1.9): Loading from cache
  • Updating shipperhq/module-shipper (20.7.4 => 20.7.6): Downloading (100%) `

And this is the update from this week on October 10th:
`Updating dependencies (including require-dev)
Package operations: 0 installs, 70 updates, 0 removals

  • Updating symfony/process (v2.8.26 => v2.8.28): Loading from cache
  • Updating magento/framework (100.1.7 => 100.1.9): Loading from cache
  • Updating magento/theme-frontend-blank (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/theme-frontend-luma (100.1.6 => 100.1.7): Loading from cache
  • Updating magento/module-media-storage (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-config (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-store (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-backend (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-ui (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-email (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-theme (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-directory (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-eav (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-catalog (101.0.7 => 101.0.9): Loading from cache
  • Updating magento/module-quote (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-catalog-inventory (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-page-cache (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-url-rewrite (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-cms (101.0.5 => 101.0.7): Loading from cache
  • Updating magento/module-catalog-url-rewrite (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-customer (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-integration (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-tax (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-widget (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-wishlist (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-reports (100.1.3 => 100.1.5): Loading from cache
  • Updating magento/module-sales-rule (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-rule (100.1.4 => 100.1.5): Loading from cache
  • Updating magento/module-checkout (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-payment (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-sales (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-gift-message (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-rss (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-downloadable (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-newsletter (100.1.2 => 100.1.4): Loading from cache
  • Updating magento/module-review (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-catalog-import-export (100.1.4 => 100.1.6): Loading from cache
  • Updating magento/module-backup (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-webapi (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-vault (100.2.1 => 100.2.2): Loading from cache
  • Updating magento/module-usps (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-ups (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-configurable-product (100.1.7 => 100.1.9): Loading from cache
  • Updating magento/module-swatches (100.1.6 => 100.1.8): Loading from cache
  • Updating magento/module-sitemap (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-catalog-search (100.1.5 => 100.1.7): Loading from cache
  • Updating magento/module-product-video (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-paypal (100.1.5 => 100.1.6): Loading from cache
  • Updating magento/module-customer-import-export (100.1.2 => 100.1.4): Loading from cache
  • Updating magento/module-currency-symbol (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-configurable-import-export (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-catalog-widget (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-bundle (100.1.3 => 100.1.4): Loading from cache
  • Updating magento/module-advanced-pricing-import-export (100.1.2 => 100.1.3): Loading from cache
  • Updating magento/module-admin-notification (100.1.2 => 100.1.3): Loading from cache
  • Updating symfony/finder (v3.3.6 => v3.3.10): Loading from cache
  • Updating symfony/filesystem (v2.8.26 => v2.8.28): Loading from cache
  • Updating symfony/event-dispatcher (v2.8.26 => v2.8.28): Loading from cache
  • Updating magento/magento2-base (2.1.7 => 2.1.9): Loading from cache
  • Updating shipperhq/module-logger (20.1.2 => 20.1.3): Loading from cache
  • Updating shipperhq/module-common (20.3.3 => 20.3.4): Loading from cache
  • Updating shipperhq/library-shipper (20.3.2 => 20.4.0): Loading from cache
  • Updating shipperhq/library-ws (20.1.2 => 20.1.3): Loading from cache
  • Updating shipperhq/module-shipper (20.6.0 => 20.8.2): Downloading (100%) - Updating symfony/yaml (v2.8.26 => v2.8.28): Loading from cache
  • Updating symfony/config (v2.8.26 => v2.8.28): Loading from cache
  • Updating symfony/dependency-injection (v2.8.26 => v2.8.28): Loading from cache
  • Updating symfony/stopwatch (v3.3.6 => v3.3.10): Loading from cache
  • Updating fabpot/php-cs-fixer (v1.13.1 => v1.13.3): Loading from cache
    `
    Not sure if that could have anything to do with a bad update?

@orlangur
Copy link
Contributor

I don't think composer packages could break it. Just search for "maxItemsToDisplay" all over the 2.1.9 vanilla code and your codebase to check if all of them in place. For example it can be missing in \Magento\Checkout\Block\Cart\Sidebar::getConfig.

@pioneerathletics
Copy link
Author

I'm not sure how I can check the entire codebase? How will I know where they are supposed to be?

@orlangur
Copy link
Contributor

In PhpStorm you can do it with Cmd+Shift+F, in terminal with grep -i maxItemsToDisplay.

@pioneerathletics
Copy link
Author

I see, I do not have PhpStorm-I'll have to look into it. It seems like the issue is related to this one? #4170

@orlangur
Copy link
Contributor

No, it was a different issue fix: https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81

Usually such error may occur if you override some core js component or html template so that after upgrade it does not contain all necessary functionality.

@fendowuk
Copy link

We had exactly the same problem yesterday, in the end our host fixed the issue for us. He "chrooted" in and then ran the following commands (altered slightly for non magestack environment).

rm -rf var/generation/* var/view_preprocessed/* pub/static/*
php bin/magento deploy:mode:set production
php bin/magento cache:flush; curl -X PURGE https://www.example.com/.*

We were in developer mode prior to running the commands and all cache was turned off. We must have ran these commands 20+ times during the day to try to solve the error so we aren't sure if the fact he "chrooted" in could have made the difference, although I think maybe varnish hadn't been purged properly before.

I hope it helps!

@pioneerathletics
Copy link
Author

Thanks @fendowuk we'll have to give it a try. Actually I looked back at the exception.log and came across this:[2017-10-06 11:52:23] main.CRITICAL: RuntimeException: Source class "" for "Magento\Framework\App\Response\Http\Interceptor" generation does not exist. in /home/website/web-folder/vendor/magento/framework/Code/Generator.php:185
and also
[2017-10-06 11:54:16] main.CRITICAL: ReflectionException: Class Magento\MediaStorage\Model\File\Storage\Response\Interceptor does not exist in /home/website/web-folder/vendor/magento/framework/Code/Reader/ClassReader.php:19
Could it have been just an error in deploying the new version?

@fendowuk
Copy link

Hi @pioneerathletics I can't be sure, I think it is more than likely a cache issue. Are you using varnish?
I would try enabling developer mode, disabling cache and running the commands above.

@pioneerathletics
Copy link
Author

Hi @fendowuk no we're just using the built in cache (I had a lot of problems with disappearing nav menus with varnish). We are also on production mode, do you usually switch over to developer mode when you update?

@pioneerathletics
Copy link
Author

Forgot to mention we're using Redis as well.

@fendowuk
Copy link

Hi @pioneerathletics I've just always done it, I guess there is no reason to. If you are in production mode just try running.

rm -rf var/generation/* var/view_preprocessed/* pub/static/*
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
redis-cli flushall

If that doesn't work I'd try to run as root/chroot as it's the only other difference in what I was doing to what my host did.

@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 19, 2017
@magento-engcom-team magento-engcom-team self-assigned this Oct 19, 2017
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Oct 19, 2017

Hi @pioneerathletics
Did you help the last comment from fendowuk?

@pioneerathletics
Copy link
Author

I haven't tried the suggestion yet. I am waiting until the weekend to attempt the upgrade because the last time I updated my minicart issue started and I was forced to restore from a backup that took our store offline during business hours.

@magento-engcom-team
Copy link
Contributor

@pioneerathletics Thanks for the feedback.
Please update after you try last proposal.

@xmav
Copy link
Contributor

xmav commented Oct 27, 2017

I saw same issue after upgrade from 2.1.7 to 2.19
rm -rf var/generation/* var/view_preprocessed/* pub/static/* solved the issue for me
(default mode)

@pioneerathletics
Copy link
Author

So I tried updating again from 2.1.7 to 2.1.9., in production mode, and yet again I've had the same mini-cart issue. I tried the suggestions from @fendowuk and at first glance they didn't work. I had to manually clear my browser cache in order for the changes to apply (Chrome, Safari, Safari iOs) .

@magento-engcom-team why would this issue still be persistent, except for when I manually cleared my browser cache? It wouldn't be a big deal, but if a repeat customer visits the store again and the mini-cart is not functioning how would they know to clear their browser cache and cookies?

@orlangur
Copy link
Contributor

@pioneerathletics are you able to reproduce this problem on a clean Magento 2.1.7 installation ("clean" in terms of modules/themes, it can contain any data and/or official sample data) when it is upgraded to 2.1.9?

@magento-engcom-team
Copy link
Contributor

Hi @pioneerathletics
Are you able to reproduce this problem on a clean Magento 2.1.7 installation ("clean" in terms of modules/themes, it can contain any data and/or official sample data) when it is upgraded to 2.1.9?

@fendowuk
Copy link

fendowuk commented Nov 2, 2017

Hi @pioneerathletics

I also had the same issue with having to clear browser cache before seeing the changes. Sorry, I should have also said that initially.

I have however just realised that the .htaccess file in pub/static/.htaccess was missing. I am wondering if this could have been the cause, do you have that file on your site?

@Tristan-N
Copy link

Same issue here. Tried all of the above, still no functioning minicart.

PHP 7.0 and 7.1
Mysql 5.7
Magento CE 2.1.9

@Tristan-N
Copy link

I figured out that once created an override for minicart.js and it didn't get updated like @orlangur mentioned

No, it was a different issue fix: https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js#L81
Usually such error may occur if you override some core js component or html template so that after upgrade it does not contain all necessary functionality.

I checked the difference between the files (original in vendor folder and custom in app/design) (using diffchecker.com) to see what happened and updated the override.

After that I followed @fendowuk's advice:

We had exactly the same problem yesterday, in the end our host fixed the issue for us. He "chrooted" in and then ran the following commands (altered slightly for non magestack environment).

rm -rf var/generation/* var/view_preprocessed/* pub/static/*
php bin/magento deploy:mode:set production
php bin/magento cache:flush; curl -X PURGE https://www.example.com/.*

We were in developer mode prior to running the commands and all cache was turned off. We must have ran these commands 20+ times during the day to try to solve the error so we aren't sure if the fact he "chrooted" in could have made the difference, although I think maybe varnish hadn't been purged properly before.

I hope it helps!

To finish it all I cleared local browser cache and looked again and guess what? It solved my problem.

So, the only advice I'm missing in here is:
go to root folder of Magento in terminal and enter find . -name minicart.js and see if there are customized versions of this file. If so, check if maxItemsToDisplay exists and add it there using https://github.com/magento/magento2/blame/2.1/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js if needed.

@magento-engcom-team
Copy link
Contributor

@pioneerathletics, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

6 participants