• Resolved asreurotux

    (@asreurotux)


    Hello,

    I’m facing a strange situation when running cron events, using wp-cli, on a multisite network while having the W3TC settings saved up on the database.

    This project requires the settings to be saved up on the database since we have several WordPress servers handling requests without having a shared filesystem (like NFS).

    Everything is running smoothly, except the cron jobs. As far as I can see, the blogs.php file is created, and appears to be required by W3TC, to get the correct blog ID for the current request. Since there is no shared FS, only one file is created, making only one server capable of mapping the URL to the correct blog id. This makes all cron requests use the master config, snce the blog_id is always 0.

    Shouldn’t the mapping saved on the database when the W3TC_CONFIG_DATABASE constant is true, or in the case of CLI requests, handle the current blog using the –url flag provided by WP-CLI?

    Is there a workaround for this?

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @asreurotux

    Thank you for your inquiry and I am happy to assist you with this.
    We need to check this and reproduce the issue.
    I’ll reply when we investigate.
    Thank you!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @asreurotux

    Can you please check this Github issue and see if the provided fix is working for you?
    Thank you!

    Thread Starter asreurotux

    (@asreurotux)

    Hi @vmarko,

    Thanks for your fast reply!

    As I can tell, the fix you mentioned would allow each site to source its configs from a different master file. Am I correct?

    If that is the case, it wouldn’t be enought to solve my problem, since there’s no shared FS on the infra-structure.

    The “Use single network configuration file for all sites” was also already unchecked.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @asreurotux

    Thank you for clarifying.
    I’ll get back to you as soon as we investigate further.
    Thank you!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @asreurotux

    Thank you for your patience.
    Your blogs.php file will grow and be filled with the time on all servers.
    In fresh environments where it’s not yet – I expect you to have this problem when you execute cron job without URL.
    You may force filling it by calling wp via curl with the blog domain.
    e.g.
    curl –quite https://myblog2.mysite.com/wp-cron.php

    That will also fix the potential problem of duplicate cron jobs execution when the same job processing is instantiated by multiple servers.
    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘W3TC_CONFIG_DATABASE and WP-CLI requests’ is closed to new replies.