Skip to content

cache-clean -w Doesn't clean the cache but it says cleaned #44

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
syedsaleem086 opened this issue Sep 1, 2019 · 5 comments
Closed

cache-clean -w Doesn't clean the cache but it says cleaned #44

syedsaleem086 opened this issue Sep 1, 2019 · 5 comments
Labels
bug Something isn't working linux more-info-required Further information is requested

Comments

@syedsaleem086
Copy link

syedsaleem086 commented Sep 1, 2019

Hi

cache-clean -w doesn't clean cache but it says the cache cleaned

Watcher initialized (Ctrl-C to quit)
Cleaning cache type(s) layout full_page

When pressing a it flushes all the caches and it works
Other options like [c]onfig [b]lock_html [l]ayout [t]ranslate [f]ull_page [v]iew
doesn't work

Installed node v10.16.3
Ubuntu 18.04

@Vinai
Copy link
Contributor

Vinai commented Sep 1, 2019

Can you please run the command in debug mode with the -vv or --debug flag, press the key to flush the layout cache, and post the debug output here?

cache-clean.js -w --debug

@Vinai Vinai added bug Something isn't working linux more-info-required Further information is requested labels Sep 1, 2019
@syedsaleem086
Copy link
Author

syedsaleem086 commented Sep 1, 2019

Monitoring app/etc/config.php for new modules
Listening for hotkeys
Hot-keys for manual cache cleaning:
[c]onfig [b]lock_html [l]ayout [t]ranslate [f]ull_page [v]iew [a]ll

Hot-key for cleaning all generated code: [G]
Hot-keys for cleaning static content areas: [F]rontend [A]dminhtml

Watcher initialized (Ctrl-C to quit)
Processing /var/www/html/layerednav/public_html/app/code/Netable/BetterPopup/view/frontend/layout/default.xml
Cleaning cache type(s) layout full_page
Using :default cache_backend
Reading app config by shelling out to php
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/cache}
Cleaning tag LAYOUT_GENERAL_CACHE_TAG
Tag-file /var/www/html/layerednav/public_html/var/cache/mage-tags/mage---5b0_LAYOUT_GENERAL_CACHE_TAG
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--d/mage---5b0_LAYOUT_FRONTEND_STORE1_3
Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/
Processing /var/www/html/layerednav/public_html/app/code/Netable/BetterPopup/view/frontend/layout/default.xml
Cleaning cache type(s) layout full_page
Using :default cache_backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/cache}
Cleaning tag LAYOUT_GENERAL_CACHE_TAG
Tag-file /var/www/html/layerednav/public_html/var/cache/mage-tags/mage---5b0_LAYOUT_GENERAL_CACHE_TAG
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--d/mage---5b0_LAYOUT_FRONTEND_STORE1_3
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--7/mage---5b0_LAYOUT_FRONTEND_STORE1_3C7461AF04BB11FE209659D7147D2C579_PAGE_LAYOUT_MERGED
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--7/mage---5b0_LAYOUT_FRONTEND_STORE1_3PAGE_LAYOUT
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--5/mage---5b0_LAYOUT_FRONTEND_STORE1_30A98983867A1770682B48D9A0AD63441_PAGE_LAYOUT_MERGED
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--7/mage---5b0_STRUCTURE_LAYOUT_FRONTEND_STORE1_3C7461AF04BB11FE209659D7147D2C579
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--f/mage---5b0_LAYOUT_FRONTEND_STORE1_36F1B068EC7CCF4878F9284DD1137AFD1_PAGE_LAYOUT_MERGED
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--6/mage---5b0_STRUCTURE_LAYOUT_FRONTEND_STORE1_36F1B068EC7CCF4878F9284DD1137AFD1
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--c/mage---5b0_LAYOUT_FRONTEND_STORE1_3D41D8CD98F00B204E9800998ECF8427E_PAGE_LAYOUT_MERGED
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--d/mage---5b0_STRUCTURE_LAYOUT_FRONTEND_STORE1_3D41D8CD98F00B204E9800998ECF8427E
Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/
----------------app/etc/env.php--------------------
    'MAGE_MODE' => 'developer',
    'session' => [
        'save' => 'files'
    ],
    'cache' => [
        'frontend' => [
            'default' => [
                'id_prefix' => '5b0_'
            ],
            'page_cache' => [
                'id_prefix' => '5b0_'
            ]
        ]
    ],

@syedsaleem086
Copy link
Author

syedsaleem086 commented Sep 1, 2019

It worked when loading the project for the first time and editing the default.xml

After that, I have modified n number of times this default.xml and it didn't clean the cache

Below is the output

Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/
Processing /var/www/html/layerednav/public_html/app/code/Netable/BetterPopup/view/frontend/layout/default.xml
Cleaning cache type(s) layout full_page
Using :default cache_backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/cache}
Cleaning tag LAYOUT_GENERAL_CACHE_TAG
Tag-file /var/www/html/layerednav/public_html/var/cache/mage-tags/mage---5b0_LAYOUT_GENERAL_CACHE_TAG
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--c/mage---5b0_LAYOUT_FRONTEND_STORE1_3D41D8CD98F00B204E9800998ECF8427E_PAGE_LAYOUT_MERGED
cleaning file /var/www/html/layerednav/public_html/var/cache/mage--d/mage---5b0_STRUCTURE_LAYOUT_FRONTEND_STORE1_3D41D8CD98F00B204E9800998ECF8427E
Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/
Processing /var/www/html/layerednav/public_html/app/code/Netable/BetterPopup/view/frontend/layout/default.xml
Cleaning cache type(s) layout full_page
Using :default cache_backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/cache}
Cleaning tag LAYOUT_GENERAL_CACHE_TAG
Tag-file /var/www/html/layerednav/public_html/var/cache/mage-tags/mage---5b0_LAYOUT_GENERAL_CACHE_TAG
Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/
Processing /var/www/html/layerednav/public_html/app/code/Netable/BetterPopup/view/frontend/layout/default.xml
Cleaning cache type(s) layout full_page
Using :default cache_backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/cache}
Cleaning tag LAYOUT_GENERAL_CACHE_TAG
Tag-file /var/www/html/layerednav/public_html/var/cache/mage-tags/mage---5b0_LAYOUT_GENERAL_CACHE_TAG
Using :page_cache cache backend
Cache storage  {:id_prefix 5b0_, :backend Cm_Cache_Backend_File, :cache_dir /var/www/html/layerednav/public_html/var/page_cache}
Cleaning dir /var/www/html/layerednav/public_html/var/page_cache/

image

@Vinai
Copy link
Contributor

Vinai commented Sep 2, 2019

Thanks for the additional information. I notice in your app/etc/env.php there is an ID prefix defined for both the default and the page_cache backends, but no other backend configuration.
Unfortunately there is a bug in the last few Magento2 versions that caused the full page cache to be written to the regular cache directory in that case.
The patch fixing the bug has been accepted, but isn't yet merged into the 2.3 mainline.
The results of that bug are that sometimes the cache tag-to-record mapping is overwritten, and that cleaning the full page cache cleans the complete cache.

As a workaround, please try adding the following cache backend_options config to your env.php file:

    'cache' => [
        'frontend' => [
            'default' => [
                'id_prefix' => '5b0_'
            ],
            'page_cache' => [
                'id_prefix' => '5b0_',
                'backend_options' => [
                    'cache_dir' => 'page_cache'
                ]
            ]
        ]
    ]

Please try this and let me know if that fixes the issue for you. If not, I'll have to investigate further.

@syedsaleem086
Copy link
Author

Thanks @Vinai
It worked :)

@Vinai Vinai closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux more-info-required Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants