litespeedtech / magento2-LiteSpeed_LiteMage

LiteMage Cache Extension for Magento 2
https://www.litespeedtech.com/products/litespeed-web-cache/litemage
Other
30 stars 10 forks source link

cache:flush error Magento 2.4.2-p1 #25

Closed mannanmughal closed 1 year ago

mannanmughal commented 2 years ago

I'm using the most latest extension & receiving error code when clearing cache via cli.

Command used: $ php bin/magento cache:flush

Output; <!doctype html>

404 Not Found

Whoops, our bad...

The page you requested was not found, and we have a fine guess why.
  • If you typed the URL directly, please make sure the spelling is correct.
  • If you clicked on a link to get here, the link is outdated.
What can you do?
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
  • Go back to the previous page.
  • Use the search bar at the top of the page to search for your products.
  • Follow these links to get you back on track!
    Store Home | My Account

Flushed cache types: config layout block_html collections reflection db_ddl compiled_config eav customer_notification config_integration config_integration_api full_page config_webservice translate webpos checkout wp_gtm_categories

litespeedtech commented 2 years ago

Hi, @mannanmughal Is your frontend and backend on different servers? If yes, I got a temp solution you can try.

mannanmughal commented 2 years ago

Hi, @mannanmughal Is your frontend and backend on different servers? If yes, I got a temp solution you can try.

Thanks for your kind feedback. Well we're running single server, but backend & frontend is on the different URLs. Frontend: https://imaanboutique.com Bacakend: shop.ebazar.cc Are you planning to release any version updates to fix the reported issue?

litespeedtech commented 2 years ago

can you try to modify LiteMage/Observer/FlushCacheByCli.php, update function private function _shellPurge($params) with below 2 lines of code. let me know if it works. if yes, we'll release a new version. line 102: replace $base = $this->url->getBaseUrl($uparams); to $base = $this->url->getUrl('litemage/shell/purge', ['_scope' => 1, '_nosid' => true]); then line 117: replace $uri = $base . 'litemage/shell/purge?' . http_build_query($params); to $uri = $base . '?' . http_build_query($params);

mannanmughal commented 2 years ago

I've modified as suggested & this is the result after that; I've tried 2 commands, first one to flush cache & another one to reindex

01 Command used via CLI: $ php bin/magento cache:flush LiteMage purged tags * Flushed cache types: config layout block_html collections reflection db_ddl compiled_config eav customer_notification config_integration config_integration_api full_page config_webservice translate webpos checkout wp_ga4_categories wp_gtm_categories

02 Command used via CLI: $ bin/magento indexer:reindex

Design Config Grid index has been rebuilt successfully in 00:00:00 Customer Grid index has been rebuilt successfully in 00:00:22 Category Products index LiteMage purged tags cat_c has been rebuilt successfully in 00:00:03 Product Categories index has been rebuilt successfully in 00:00:00 Catalog Rule Product index LiteMage purged tags cat_p,BLOCK_HTML has been rebuilt successfully in 00:00:22 Product EAV index has been rebuilt successfully in 00:00:04 Stock index has been rebuilt successfully in 00:00:01 Inventory index <!DOCTYPE html>

<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 414 Request-URI Too Large
</title></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">414</h1>
<h2 style="margin-top:20px;font-size: 30px;">Request-URI Too Large
</h2>
<p>The request URL is over the maximum size allowed!</p>
</div></div></body></html>

has been rebuilt successfully in 00:00:25

litespeedtech commented 2 years ago

Can you join our slack and message me at litespeed.lauren? Thanks

litespeedtech commented 1 year ago

This issue is resolved in v2.2.