• Resolved demironmanx

    (@demironmanx)


    APCu 4.0.0
    WP CLI 2.11.0

    Hi Pierre,

    I discovered that APCu is blocking the WP CLI functionality. While using “wp plugin deactivate plugin-name” command, command line says Plugin ‘plugin-name’ deactivated. But indeed if you check it from wp-admin/plugins.php all recently plugins’s status are still active and wouldn’t change. I am bulk deactivating and activating plugins via WP CLI. I tested the process thorougly and finally when I deactivated APCu from WP Dashboard, WP CLI plugin commands started to work fine again.

    I hope you can replicate the issue and find the culprit easily.

    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter demironmanx

    (@demironmanx)

    Hi Dear Pierre,

    I hope you are fine.

    While APCu caches data in memory, which might lead to inconsistencies between what WP-CLI sees and what’s actually in the database? Or is this the nature of all object caching mechanisms?

    I decided to temporarily deactivate the object cache beforehand for better troubleshooting.

    After deactivating APCu, I double-checked the status of the plugins both via WP-CLI and the WordPress admin to ensured that they’re in sync now.

    Is there any configuration for APCu to work better with WP-CLI? Such as this involves setting up APCu to not cache certain operations or to clear its cache when WP-CLI commands are run.

    Best regards,

    Plugin Author Pierre Lannoy

    (@pierrelannoy)

    Hello @demironmanx !

    Many thanks for this report. Although I’ve never seen this behavior, I’m going to try to reproduce it. Could you please copy here the health report for the site? It will help to see if there’s something obvious and, if not, to reproduce your environment from my side.

    Thanks.

    Thread Starter demironmanx

    (@demironmanx)

    Sorry, I tried again but I couldn’t replicate the issue either. Many thanks again for bothering you. I’ll try to replicate it in the future again.

    Thanks a lot.

    Plugin Author Pierre Lannoy

    (@pierrelannoy)

    It’s very good news, actually… ??

    I close this ticket. Just answer to it if you need to re-open it. Have a nice day.

    Hi

    I had this exact issue – I was unable to carry out any updates using wp-cli when APCu was enabled with the “Object Cache” enabled. Disabling the object cache (or deactivating the plugin) immediately fixed the issue, but enabling it again reintroduced the issue.

    I found that APCu was not enabled on the command line in php.ini

    I’m on AlmaLinux 9, so I had to edit the file /etc/php.d/40-apcu.ini and uncomment and change the setting apc.enable_cli = 1

    Now wp-cli works again even with APCu Manager activated and “Object Cache” enabled.

    I’m not sure of any other implications of this change as the setting is marked as being mostly for debugging and testing so perhaps this “fix” is more of a workaround and perhaps wp-cli should theoretically still work even with this setting off, but for now this seems a good fix if anyone else runs into this issue.

    Maybe this information will help identify an issue somewhere else. Or perhaps it just is the best way to fix it. Either way it will do for now for me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.