magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

[Magento 2.1.0] Catalog nav bar is missing in 2.1.0 #5423

Closed Ctucker9233 closed 7 years ago

Ctucker9233 commented 8 years ago

Steps to reproduce

  1. Put store in maitenance mode
  2. Install Magento 2.1.0 from .zip folder per magento documentation
  3. run setup:upgrade and setup:di:compile commands
  4. Navigate to front end

    Expected result

Store page displays normally with catalog navigation

Actual result

Store page displays without catalog navigation

Note: Multi-store setup backend frontend

acidreian666 commented 8 years ago

what did you upgrade from? is your Storefront using SSL aka (https://) Are you running Varnish? Theres simular issues going around.

JDavidVR commented 8 years ago

I have same problem upgrading from 2.0.7 to 2.1 I don't know why, probably its an issue with changes to the settings, before 2.1 it was on store>configuration>design, now it is on content > theme(or something like that)

Ctucker9233 commented 8 years ago

@acidreian666 I upgraded from 2.0.7 and it uses SSL. I don't use varnish.

Ctucker9233 commented 8 years ago

@JDavidVR It would seem that my theme is working ok. I didn't manipulate anything having to do with that nav bar.

Ctucker9233 commented 8 years ago

If themes can't transfer from 2.0.7 to 2.1, that is a critical oversight.

Ctucker9233 commented 8 years ago

If I clear /var/cache, /var/page_cache and /var/generation according to the documentation, http://devdocs.magento.com/guides/v2.1/comp-mgr/cli/cli-upgrade.html, this happens:

Warning: ltrim() expects parameter 1 to be string, object given in /home/tuckersf/public_html/vendor/magento/framework/Code/Generator/EntityAbstract.php on line 152

Notice: Uninitialized string offset: 0 in /home/tuckersf/public_html/vendor/magento/framework/Autoload/ClassLoaderWrapper.php on line 81

Notice: Uninitialized string offset: 0 in /home/tuckersf/public_html/vendor/composer/ClassLoader.php on line 317

Notice: Uninitialized string offset: 0 in /home/tuckersf/public_html/vendor/composer/ClassLoader.php on line 349 An error has happened during application run. See exception log for details.

acidreian666 commented 8 years ago

So I been trying to Replicate the original problem my tests have been as fallowed. Test 1 Install magento on Ubuntu 16.04 server w/ Nginx php7.0-fpm varnish mysql installed magento2 to html dir via sudo wget magento2.1.zip (from official magento website) then installed m2.1 via website installer http://localhost/setup/ no issues.

Finished install = Functional 2.1 with NO menu on Homepage no matter what configurations are used.

Test 2 Installed Magento 2 Stack via Bitnami on Debain server. m2.0.7 with apache mysql php7 varnish memcached ect.. basic stuff. after using and making sure basic configuration is set and m2.0.7 is functional via http://localhost/ using Admin backend System Upgrade and upgrading to 2.1 upgrades flawlessly. Finished install = Functional 2.1 with menu on Homepage (Menus are working Functionally) *Note Using Varnish w/ Apache & m2.1 with SSL menu disappears the same way as it does using Test1.

Thoughts. Issues with Nginx server using 2.1 compatibility? Issues using the Official Magento2.1 zip from website? Or could it be because of Debain jesse vs Ubuntu 16.04?

I'm going to do more testing.

JDavidVR commented 8 years ago

@Ctucker9233 I did more tests, trying to change configuration on backend and I agree with you this is a critical issue, for sites that are already build on 2.0.x and want to upgrade to 2.1

In logs I have this error: [2016-07-03 23:08:39] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_2c7461af04bb11fe209659d7147d2c579 and handles default, cms_index_index, cms_page_view, cms_index_index_id_home: Please correct the XML data and try again. [] [] [2016-07-03 23:08:39] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_20a98983867a1770682b48d9a0ad63441 and handles 1column: Please correct the XML data and try again. [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'currency' element cannot be added as child to 'header.panel', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'header.links' element cannot be added as child to 'header.panel', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and '' respectively. [] [] [2016-07-03 23:08:39] main.CRITICAL: Broken reference: the 'store.settings.currency' tries to reorder itself towards 'store_language', but their parents are different: 'store.settings' and '' respectively. [] [] [2016-07-03 23:08:39] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_26f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again. [] [] [2016-07-03 23:08:43] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_22b24c6d6a5609522924195bc1e69d26e and handles default, not_noroute_other: Please correct the XML data and try again. [] [] [2016-07-03 23:08:44] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_20a98983867a1770682b48d9a0ad63441 and handles 1column: Please correct the XML data and try again. [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'currency' element cannot be added as child to 'header.panel', because the latter doesn't exist [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'header.links' element cannot be added as child to 'header.panel', because the latter doesn't exist [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and '' respectively. [] [] [2016-07-03 23:08:44] main.CRITICAL: Broken reference: the 'store.settings.currency' tries to reorder itself towards 'store_language', but their parents are different: 'store.settings' and '' respectively. [] [] [2016-07-03 23:08:44] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_26f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again. [] []

Ctucker9233 commented 8 years ago

@JDavidVR Thanks for testing this out. So am I screwed and just need to do a clean install of 2.0.7?

Ctucker9233 commented 8 years ago

@JDavidVR where did you find that log? Do you think there is a way to programatically fixing this? @magento-team please investigate this.

erikhansen commented 8 years ago

I'm also experiencing this issue. I upgraded Magento Enterprise 2.0.7 to 2.1. I changed the theme to the Magento/luma theme and am still not seeing the main navigation. I am using Varnish. I logged a similar issue for 2.0.x, but it was marked as fixed in 2.1: https://github.com/magento/magento2/issues/3897#issuecomment-219215906

pboisvert commented 8 years ago

Olena--can you have the team check this scenario?

Ctucker9233 commented 8 years ago

@tkacheva In my scenario, I am not using varnish unless it got switched on without me knowing. It wouldn't surprise me at this point. How would I make sure that varnish is not running?

Ctucker9233 commented 8 years ago

I've created my own menu as a sort of work around. Just buttons with straight links. I would still like to see this fixed as soon as possible. If it is a glitch with the upgrade procedure, the official documentation needs to change. That's what I used to arrive at this point. I can't continue to use Magento if I need to do a wipe, install new version and reimport data every time there is an upgrade. It is just not feasible.

acidreian666 commented 8 years ago

Alright guys i have like 10 Magento 2 servers running on google cloud. I figured out where the menu bar went well actually idk what code is stoping it from loading but... ssh'd to my website root Dir sudo cd /var/www/html/ run sudo find . -type d -exec chmod 777 {} \; & sudo find . -type f -exec chmod 777 {} \;

Now menu is back and all permissions are messed up but its back and functional..

so where is the exact permissions required for every folder in a based 2.1 install?

tkacheva commented 8 years ago

@eug123 Could you look into it?

Ctucker9233 commented 8 years ago

@acidreian666 So it's a permissions thing? Can you tell which folder is causing the problem? My site is live so I'd rather not change the permissions for every folder. It might be a security risk. Thanks for taking the time to really investigate this.

Ctucker9233 commented 8 years ago

@tkacheva or @eug123 Is there any update on a timeline for this being fixed?

acidreian666 commented 8 years ago

@Ctucker9233 so I have found that my sever with m2.1 varnish4.1 nginx-latest U buntu 16.04 mysql-latest php7.0.8-fpm Permissions all = 777 files & folders of /var/www/html/ functions perfectly untill I listen to port 443 and attempted to view the site in https://example.com then the menu navigation is gone. So then using nginx-latest to reverse proxy SSL termination it opens the site and leaves things broken and not responsive. Example still no menu in https and also now no menu in http either like it was before. Ex.2 adding to cart after product search also broken. List gos and gos.but I think that aside has more to do with SSL proxy & varnish.

Also I might add I have never switched from default mode to developer or production. But I did flush cache and reindex and static deploy manually.

Ctucker9233 commented 8 years ago

@tkacheva @eug123 Any new information on this issue?

Ctucker9233 commented 8 years ago

@tkacheva @eug123 @magento-team Is there any news on this issue? It is really effecting customer experience.

JDavidVR commented 8 years ago

I'm having this problem even in clean installation :(

acidreian666 commented 8 years ago

@JDavidVR please list your full server setup & distribution information with components your using. I have installed and setup m21 10 times in the past 4 days with a functional navigation bar.

Ctucker9233 commented 8 years ago

@acidreian666 On any of your setups did you install 2.0.7 and then upgrade to 2.1.0? I think this is where the problem really lies.

I'm hosted on siteground.com Apache (not sure which version) mysql (latest) PHP version 5.6.23 Magento 2.1.0

I've flushed all caches repeatedly. The only thing I haven't tried is to set permissions on everything to 777 like you did. I don't know if that is safe to do.

acidreian666 commented 8 years ago

@Ctucker9233 Are you using Varnish or Memcached or something simular or a cloudflare or Maxcdn? I have never used Php 5.6 because theres 30x faster speed when using php7 from my expirence.

here is the question flushing the caches meaning your running the site in Devoloper mode not production?

have you tried sudo rm -r pub/static/* sudo php bin/magento setup:static-content:deploy

http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html

I did 1 upgrade from 2.0.7 without a problem and multiple upgrades from 2.0.6 to 2.1 without problems. but that was only with fixing permissions.

I think after your upgrade from 2.0.7 the System upgrade does not keep permissions on the deployed files or something in the theme that causes a permission issue. thus the menu is gone.

if you had your website up and running on a cloud server or something it would be abit easier to clone it and change domain to an Ip addess using mysql commands then changing permissions to 777 to check if thats the issue your having with your offical site.

JDavidVR commented 8 years ago

@acidreian666 I found something weird. the first time, y copied files from magento 2.1 to 2.0.7 (both with sample data) but it gave me the catalog nav error, so I tried to copy again the files(it overwirte 2.0.7) but still it was not working. at the end I did a rm -rf vendor/* and copied a clean vendor folder from 2.1, and it solved the problem, I don't know exactly which files are different.

about clean installation, I applied same solution and it worked, I have to mention that first installation worked well, but I think a deploy messed files, becuase I'm using phpstorm to deploy files to my local web server(I'm using virtualbox to have latest version of php7.0.x , apache2.4.x and mysql 5.6.x)

@Ctucker9233 can you apply the steps I mentioned, so you can confirm or discard if it is working (it worked for me) if it works, means that magento 2.0.7 contains files that was discarded in 2.1 and it is causing conflicts.

tkacheva commented 8 years ago

Issue MAGETWO-55189.

Ctucker9233 commented 8 years ago

@acidreian666 I've never changed the magento mode as far as I know. I only use a straight forward static cache, nothing more. When I say that I've flushed the caches, I've manually deleted the folders within pub/static/frontend, var/cache and var/page_cache. Siteground also has it's own button to flush static cache files so I do that too just to make sure it's all clean.

@JDavidVR I'll be darned. Your solution did the trick. That means there's an old file somewhere causing a conflict. Thanks a ton!

Ctucker9233 commented 8 years ago

@veloraven @tkacheva Thanks for your responsiveness! Is there a way I can follow this internal ticket? Any ideas when a permanent fix will be released? I know you're all working on a million other things so I appreciate any updates you can give me.

piotrekkaminski commented 8 years ago

@JDavidVR it seems as if you attempted to overwrite files. This is incorrect approach to upgrade as it will not remove files that could be removed in new version, and it will cause issues. The proper upgrade path is either using command line or setup wizard, which allows to remove files that were removed in new version.

Ctucker9233 commented 8 years ago

@piotrekkaminski I also tried this approach and this is why the issue exists. At the time it was the only upgrade option available to me. Setup wizard did not function (even with the 2.0.7 patch) and the CLI kept throwing a memory exceeded error. I've gone back and forth with my hosting provider on this one.

My point is, if for some reason both of the approved upgrade methods are unusable, overwriting files is the only option and there should be a way to do that without errors like this occuring. Perhaps including text in the changelog or release notes on what files need to be permanently deleted in order to have a functioning setup.

dman311 commented 8 years ago

I'm also having the same issue with the menu not appearing. I upgraded from 2.0.7 to 2.1.0, at first the upgrade would not proceed. I was able to remove the migration tool and the upgrade appeared to be successful. I am not able to see products on the front end and I get a server error on the back end when trying to view categories. I'm going to pull a backup and go back to 2.0.7 until this issues is resolved.

sebastian-ehrling commented 8 years ago

delete the directory "vendor". Then reinstall vendor directory from zip!

HellgaM commented 8 years ago

I have a custom theme, adding of " " to block with name="store.menu" in my theme did the trick.

tkacheva commented 8 years ago

@dman311 @JDavidVR guys, does anyone have this issue when upgrading using setup tool or command line?

alyzrazor commented 8 years ago

I think I found the cause for this bug, I tried to reproduce this problem in many different ways and scenarios using fresh installations of 2.1, PHP 5.6 or 7, once I change from http to https my nav bar is gone in HOME, but it works in some other places like: Account Login etc...

It ONLY happened as SOON AS I ACTIVATE VARNISH, so it doesn't happen when I'm using Built-in Cache

Ctucker9233 commented 8 years ago

@tkacheva My issue occurred after command line upgrade.

@alyzrazor I am the original poster of this issue and I DO NOT USE VARNISH. I never switched from http to https either. So it does not only happen under these conditions.

karlsminton commented 8 years ago

I also am experiencing this issue, I'm using no caching extensions - just inbuilt. I also upgraded via commandline, one of the recommended methods and I'm not presently using https.

Ctucker9233 commented 8 years ago

@karlsminton have you tried deleting the entire vendor folder and reloading a fresh 2.1 vendor folder?

karlsminton commented 8 years ago

@Ctucker9233 I'm reluctant to do this if it can be avoided, for the reasons piotrekkaminski mentioned earlier.

tkacheva commented 8 years ago

@Ctucker9233, if you still have this issue with CLI upgrade, please provide detailed steps end environment you are using so that we are able to reproduce the case. We managed to reproduce the issue only with direct override the files which is not the right way to upgrade.

Ctucker9233 commented 8 years ago

@tkacheva I followed the Magento documentation on how to upgrade (which has a 404 error right now by the way.). So perhaps there is a lack of clarity in the documentation or failure to understand on my part. From what I recall, it says to unzip and extract the upgrade to the Magento root (which starts to overwrite files, so not sure how to get around that.). I drag and drop the .zip and extract all. Next it says to enter the CLI command php bin/magento setup:upgrade, which runs and completes successfully. I use putty to ssh in and run CLI commands. Next, I'm prompted to rerun the compile command. So I type in php bin/magento setup:di:compile. These are the exact same steps I provided in the original post for this issue. Now, given that removing the vendor folder and re-uploading using FTP solved the issue, there was probably a file that did not get overwritten during the install and caused a dependency issue. It may be all mute now, since 2.1.1 has been released and the error has not re-occurred. The reason I installed this way was because I don't have access to composer commands or don't know the correct syntax to use them. Plus, the system upgrade feature was broken at the time, so this was the only option left. So even though it may not have been the correct procedure, it was the only option available and in the end it worked. I think the documentation needs to be more detailed with exact steps for each upgrade method. Otherwise, some of us are left guessing on how to do it properly.

Ctucker9233 commented 8 years ago

@tkacheva Sorry forgot to include the environment. It was Magento 2.0.7 upgraded to 2.1.0. php version 5.6.23. I don't know the mySQL version. It's a hosted server with siteground.

flipflap commented 8 years ago

I have the same problem after updating from 2.0.9 to 2.1.0 using composer.

Now I tried to upload the directory vendor from zip and get an error:

`a:4:{i:0;s:273:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. The following modules are outdated: Magento_Sales schema: current version - 2.0.3, required version - 2.0.2 Magento_Sales data: current version - 2.0.3, required version - 2.0.2";i:1;s:2816:"#0 /home/preview1/public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

1 /home/preview1/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')

2 /home/preview1/public_html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))

3 /home/preview1/public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

4 /home/preview1/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')

5 /home/preview1/public_html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

6 /home/preview1/public_html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

7 /home/preview1/public_html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

8 /home/preview1/public_html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

9 /home/preview1/public_html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\App\Http->launch()

10 /home/preview1/public_html/var/generation/Magento/Framework/App/Http/Interceptor.php(26): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, Array)

11 /home/preview1/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()

12 /home/preview1/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))

13 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}`

bin/magento setup:upgrade did not help.

@HellgaM can you explain in which files you made this changes? I don't have that block store.menu.

Ctucker9233 commented 8 years ago

@flipflap I had to physically delete the vendor folder using FTP and physically reload it. Then I reran bin/magento setup:upgrade with no problem. Not sure if this will help in your case. Magento frowns on this method, but it was the only thing that solved the problem.

flipflap commented 8 years ago

@flipflap I tried this, but got the errors. Did you use the new vendor folder from the zip?

KevinMace commented 8 years ago

I have recently been having the issue that when Varnish was enabled, the menu (topNav block) didn't appear.

What I discovered was Varnish wasn't parsing the ESI tags, instead they were output to the frontend. In your source code search for a snippet like the following:

<esi:include src="url/of/your/site" />

If you find any "esi" tags on your page, then your Varnish config is incorrect and needs to be updated to enable "esi". After I updated my Varnish config to enable esi, everything started working as expected and the menu re-appeared.

flipflap commented 8 years ago

I don't have Varnish on my server, that can't be the reason in my case.

flipflap commented 8 years ago

I updated to 2.1.1 but still had the same problem. Now I found out that the problem comes from this code in my theme:

<container name="header.panel.wrapper" htmlClass="panel wrapper" htmlId="stopbar" htmlTag="div" before="-"/>

I need to add an id stopbar to the div panel wraper. Now I tried to move top.links but it didn't work. Finaly I add the ID by Javascript.

KevinMace commented 8 years ago

@flipflap have you checked your source code for the ESI tags? Magento might still be generating those tags and without Varnish you will have a missing nav.