Closed markshust closed 2 years ago
Thanks for reporting the issue! I’m going to check what is happening…
@markshust could you maybe do me a favor and help me pinpoint the issue quicker by running the tool with -vv
?
It will produce a ton of debug output.
Please then modify the controller again and paste the log here.
Thanks!
Ah thanks -- here you go:
app@0ccc115e9d3d:~/html$ /var/www/.composer-global/vendor/bin/cache-clean.js -w -vv
Release 1.0.46 sponsored by https://www.mage2.tv
Magento dir /var/www/html
Listing modules by shelling out to php
12:43:27 ERROR: failed shelling out to php for reading the module list.
12:43:27 ERROR Details: nil
12:43:27 ERROR Details:
Listing themes by shelling out to php
12:43:27 ERROR: failed shelling out to php for reading the theme list.
12:43:27 ERROR Details: nil
12:43:27 ERROR Details:
Watching static files in /var/www/html/pub/static/frontend
Config dump file /var/www/html/var/cache-clean-config.json not found
Monitoring app/etc/config.php for new modules
Reading app config by shelling out to php
Reading app config by shelling out to php
Consider enabling the currently disabled caches:
Reading app config by shelling out to php
full_page
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
Clean generated code: [G]
Clean integration test sandboxes: [I]
Clean static content areas: [F]rontend [A]dminhtml
Watcher initialized (Ctrl-C to quit)
Just for reference, here's the command executed in the similar env on PHP 7.4 (which works):
Thank you, but what I meant to ask for was the output of the watcher running with -vv
while you edit the Controller file.
There should be some additional output regarding the controller being added, and about the decisions what to do.
It might look something like this:
15:09:03 Processing /var/www/html/app/code/Example/Check/Controller/Check/NewAction.php
15:09:03 Cleaning id(s): app_action_list
Reading app config by shelling out to php
15:09:03 Cache storage {:id_prefix 69d_, :backend Magento\Framework\Cache\Backend\Redis, :backend_options {:server redis, :database 0, :port 6379, :password , :compress_data 1, :compression_lib }}
15:09:03 Cleaning id(s): 69d_APP_ACTION_LIST
... more output
15:09:03 Cleaning cache type(s) full_page
15:09:03 Using :page_cache cache backend
Reading app config by shelling out to php
15:09:03 Cache storage {:id_prefix 69d_, :backend Magento\Framework\Cache\Backend\Redis, :backend_options {:server redis, :database 1, :port 6379, :password , :compress_data 0, :compression_lib }}
15:09:03 Flushing redis db 1
15:09:03 Varnish request: #js {:protocol http:, :hostname varnish, :port 80, :method PURGE, :path /, :headers #js {:X-Magento-Tags-Pattern .*}, :timeout 10000}
15:09:03 Using :page_cache cache backend
... more output
Adding a new Controller class will cause the APP_ACTION_LIST record and the FULL_PAGE cache type to be cleared once. Subsequent changes of the controller will not trigger an action by the cache watcher.
Could you please add a new Controller file and paste the output that is printed?
Any file path matching Controller/**/*.php
is treated as a controller class, so it should be enough to create an empty Dummy.php
file withing a modules Controller folder.
Oh, I was tiered yesterday evening.
I only just noticed the ERROR: failed shelling out to php for reading the module list
in the output you posted.
Sorry for not picking that up immediately.
The command that is used to read the path to all modules (or themes) in the given installation is
php -r "require 'vendor/autoload.php'; \$bp = strlen(dirname(dirname(realpath('vendor/autoload.php')))) + 1; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo substr(\$m, \$bp).PHP_EOL;"
The command that is executed to read the config is the following (except that an absolute path to the env.php
file is used).
php -r "echo json_encode((require 'app/etc/env.php') ?? []);"
Can you run those commands manually?
Agh... this one is user error 🤪. I must have been tired too.
I had my module defined twice, once in vendor
and once in app/code
. Appears everything is working now that I resolved my issue 👍 Thanks for the help, that first PHP line helped me find the issue.
Testing this out on Magento 2.4.4 + PHP 8.1. The watcher seems to start fine with no errors, but doesn't appear to be clearing out the appropriate caches. Confirmed by writing a new controller action, changing it, and the updates do not appear until a manual
bin/magento cache:clean full_page
is executed.