• Resolved birddesignnz

    (@birddesignnz)


    Hey all, I have a site that I have been building using WordPress, Create Block Theme, and WooCommerce.

    WP: v6.8.3
    WC: v9.8.5
    CBT: v2.7.0

    Everything is working fine on the dev site and when I migrate the site everything works normal for a period of time, but soon after (usually overnight) I start getting an error (shown below) when I try to edit pages, and additionally certain blocks don’t display on the homepage.

    Here is the email that I get from WordPress:

    Howdy!

    WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

    In this case, WordPress caught an error with one of your plugins, WooCommerce.

    First, visit your website (https://rebeccabrand.org/) and check for any visible issues. Next, visit the page where the error was caught (https://rebeccabrand.org/wp-admin/post.php?post=11&action=edit) and check for any visible issues.

    Please contact your host for assistance with investigating this issue further.

    If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

    https://rebeccabrand.org/wp-login.php?action=enter_recovery_mode&rm_token=U8QiNee9NBM5O3Nz9950ve&rm_key=xeGGU3KYdcJlnkjup8CTzz

    To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

    When seeking help with this issue, you may be asked for some of the following information:
    WordPress version 6.8.3
    Active theme: Rebecca Brand Theme (version 1.03)
    Current plugin: WooCommerce (version 9.8.5)
    PHP version 8.3.24



    Error Details
    =============
    An error of type E_ERROR was caused in line 224 of the file /home/selahchu/rebeccabrand.org/wp-content/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php. Error message: Uncaught ValueError: Path cannot be empty in /home/selahchu/rebeccabrand.org/wp-content/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php:224
    Stack trace:
    #0 /home/selahchu/rebeccabrand.org/wp-content/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php(224): file_get_contents()
    #1 /home/selahchu/rebeccabrand.org/wp-content/plugins/woocommerce/src/Blocks/BlockTemplatesController.php(372): Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils::build_template_result_from_file()
    #2 /home/selahchu/rebeccabrand.org/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTemplatesController->add_block_templates()
    #3 /home/selahchu/rebeccabrand.org/wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #4 /home/selahchu/rebeccabrand.org/wp-includes/block-template-utils.php(1253): apply_filters()
    #5 /home/selahchu/rebeccabrand.org/wp-includes/blocks/template-part.php(238): get_block_templates()
    #6 /home/selahchu/rebeccabrand.org/wp-includes/blocks/template-part.php(284): build_template_part_block_instance_variations()
    #7 /home/selahchu/rebeccabrand.org/wp-includes/class-wp-block-type.php(604): build_template_part_block_variations()
    #8 /home/selahchu/rebeccabrand.org/wp-includes/class-wp-block-type.php(366): WP_Block_Type->get_variations()
    #9 /home/selahchu/rebeccabrand.org/wp-admin/includes/post.php(2343): WP_Block_Type->__get()
    #10 /home/selahchu/rebeccabrand.org/wp-admin/edit-form-blocks.php(147): get_block_editor_server_block_settings()
    #11 /home/selahchu/rebeccabrand.org/wp-admin/post.php(187): require('/home/selahchu/...')
    #12 {main}
    thrown

    Additional info

    • Before I migrate the site I publish the theme and disabled Create Block Theme.
    • I have tried clearing transients, which I initially thought had fixed the issue, but it came back and when I tried to clear them again the issue still persisted.

    Any help would be greatly appreciated!

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi @birddesignnz,

    Thank you for reaching out and for the detailed explanation of the issue. I understand how issues like this can be frustrating and confusing.

    This issue is a known problem between WooCommerce and block-based themes, often appearing after migrating a site. It occurs when WooCommerce tries to load a missing or empty template file, usually caused by caching issues or corrupted data.

    Here’s what you can do:

    1. Clear All Caches – Clear your hosting cache, WooCommerce transients (WooCommerce → Status → Tools → “Clear transients”), and any caching plugin you use.
    2. Reset Template Cache – Temporarily add this to your theme’s functions.php, visit your site once, then remove it:
    add_action('init', function() {
        delete_transient('woocommerce_blocks_templates');
        delete_option('woocommerce_blocks_templates_cache');
    });

    If the issue persists, go to Settings → Permalinks → Save Changes (without changing anything). This refreshes your site’s structure and can sometimes resolve hidden errors.

    Start by clearing your caches and resetting the template cache — these two steps fix most cases.

    Once you’ve tried them, observe the issue for some days to see if the issue comes back.

    When responding can you confirm if you’re getting this same error from the dev site if it’s still active?

    Thread Starter birddesignnz

    (@birddesignnz)

    Hi @mosesmedh

    I have tried what you suggested and the problem still persists I’m afraid. These are the exact steps I took:

    1. My hosting doesn’t have a manual clear cache function and only does at random intervals, so I used WP Super Cache to clear the site cache.

    2. I cleared the transients using both WP-Optimize and via the WordPress plugin (WooCommerce → Status → Tools → “Clear transients”).

    3. Added the code you mentioned to functions.php

    4. reloaded the site – error still persisted

    5. Resaved the perm links as per your method above.

    Any other ideas?

    P.S. never had this issue on the dev site.

    • This reply was modified 8 months, 1 week ago by birddesignnz.
    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @birddesignnz,

    Thanks for the detailed follow-up, and I appreciate you walking through each step so clearly. Since the issue persists even after clearing caches, transients, and resetting permalinks, and especially given that it doesn’t occur on the dev site, we might be looking at something environment-specific on the live server.

    Here are a few additional things to check:

    • Ensure that your theme and plugin directories (especially WooCommerce) have the correct read permissions. Sometimes file_get_contents() fails if the server restricts access to certain paths.
    • The error suggests WooCommerce is trying to load a block template file but the path is empty. Double-check that all WooCommerce block template files were correctly migrated and exist in /woocommerce/src/Blocks/Templates/.
    • Temporarily switch to a default theme like Twenty Twenty-Five or Storefront to see if the issue persists. If it resolves, the custom theme created with Create Block Theme might have compatibility issues with WooCommerce’s block templates.
    • If your host uses persistent object caching (like Redis or Memcached) or opcode caching (like OPcache), stale data might be lingering. You could ask your host to flush those manually.
    • Deactivate and reactivate WooCommerce. This can help regenerate template data.
    • Compare your dev and live environment. Since it works fine on dev, check if there are differences in:
      • PHP versions
      • WordPress/WooCommerce versions
      • Active plugins
      • Theme files that might not have migrated properly

    I hope that helps. Let us know if you need anything else.

    Thread Starter birddesignnz

    (@birddesignnz)

    Hi @frankremmy

    Thank you for your reply. That is one strange thing is that the problem occurred yesterday and clearing the transients fixed the problem, before it came back again.

    I have checked all of those things you suggested and everything seems the same between dev site and live site.

    I’m absolutely stumped!

    • This reply was modified 8 months, 1 week ago by birddesignnz.
    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @birddesignnz,

    Thanks for the update. It’s helpful to know that clearing transients temporarily resolved the issue before it returned. Now we need to find the root cause and stop it from happening again.

    Please take your time reviewing the checklist, and we’ll be here whenever you’re ready to continue. If anything new pops up in the meantime, don’t hesitate to reach out.

    Looking forward to hearing what you uncover.

    Thread Starter birddesignnz

    (@birddesignnz)

    @frankremmy

    I have checked everything and everything seems the same. Apparently the host can’t manually clear the cache, apparently it happens automatically (a cron I guess).

    I guess I will have to wait until tomorrow to see if it clears and works normally again.

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @birddesignnz,

    Thanks again for the detailed follow-up. It’s definitely puzzling that the issue resolves temporarily after clearing transients, only to return again. Since everything checks out between the dev and live environments, and your host’s cache clears on a cron schedule, this might be a case of stale data reintroducing the error after the cache rebuilds.

    A few more things you might consider:

    • You could try setting up a scheduled task (via a plugin like WP Crontrol) to clear WooCommerce transients regularly, especially if manual cache clearing isn’t an option.
    • Enable WP_DEBUG in your wp-config.php to capture any recurring errors overnight. This might reveal what’s triggering the issue post-migration.
    • Even if everything looks identical, try disabling all other plugins temporarily on the live site to rule out a subtle conflict. Then re-enable them one by one and see if the error persists.
    • If your host uses aggressive caching or custom server rules, it might be worth asking them to review any logs or caching layers that could be interfering with WooCommerce’s block templates.
    • Since the issue reappears after a delay, it might be triggered by a scheduled task or cron job. You could check WooCommerce → Status → Scheduled Actions for any failed or pending tasks that relate to block templates and share it with me via https://snipboard.io/

    I’d also like to understand both environments properly. Please share your dev and live site’s System Status Report which you can find via WooCommerce → Status. Select Get system report and then Copy for support. Once you’ve done that, you can paste it into your reply here. You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    I hope that helps. Looking forward to your response.

    Thread Starter birddesignnz

    (@birddesignnz)

    Hi @frankremmy

    To clarify, it only resolved the first time I cleared the transients, later attempts to try this failed. With this in mind I don’t think a scheduled task is the answer yet until we find out exactly what is happening.

    Unfortunately the issue didn’t resolve overnight either, however I did enable the logs, here is the result:

    https://www.dropbox.com/scl/fi/3t2cpfevf37eksufcq49c/debug-1.log?rlkey=lvvms15v3y8c7u125apiu8dj7&st=wzzt6mm1&dl=0

    I also tried disabling all plugins except WooCommerce (and Paypal payments) this didn’t resolve the issue.

    On the failed tasks, there are five. Didn’t appear to be relevant to the issue but here is a screenshot:

    https://www.dropbox.com/scl/fi/gq8fldnr9yvdkg2d2r2zu/rebeccabrand.org_wp-admin_admin.php_page-wc-status-tab-action-scheduler-status-failed.png?rlkey=sktuknyuyn3wjmccxihqjr5mo&st=tqtdd9ku&dl=0

    Finally, here is are the Status Reports:

    https://www.dropbox.com/scl/fi/s7s0cs0l4af2oq2qjqc8r/SystemStatusReport_dev.bird-design.co.nz_2025-10-08T08-16-28.txt?rlkey=i3ezete7afcex3tsl10jhx2ep&st=oy02lgo6&dl=0

    https://www.dropbox.com/scl/fi/uwdhw8ryzm7cxmmy7yy25/SystemStatusReport_rebeccabrand.org_2025-10-08T08-18-02.txt?rlkey=8xy7e7pujznf5g3q9rgr5cd8q&st=rr05hh6u&dl=0

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for sharing the system status report. I have checked the report and noticed that your WordPress version is not up to date. Please update both WooCommerce and WordPress, and then check if that resolves the issue.

    Also, the error you shared. these error means a theme or plugin on your site is registering a block pattern incorrectly. The content field in that pattern should be a string (text/HTML), but it’s not. It’s a minor PHP notice — usually fixed by updating your theme or plugins to their latest versions.

    Please update all plugins and let us know if you still face the same issue

    Thread Starter birddesignnz

    (@birddesignnz)

    Hey everyone, thanks for your support. I have been doing some testing as I have still been experiencing the issue after updating to the latest versions.

    I think there might be something going on with the WooCommerce directory. When I uninstall WooCommerce and reinstall it, then everything works properly again for a period and then overnight it breaks again.

    I have made a backup of the directory and next time the error comes back I am going to overwrite with the backup and see if the problem resolves. I think this would point to something going on with the hosting.

    I will report back.

    Sai (woo-hc)

    (@saivutukuru)

    Hi @birddesignnz,

    From your latest observations, it does sound like something on the hosting side may be intermittently affecting the WooCommerce plugin files or cached data. The fact that reinstalling WooCommerce temporarily resolves the issue, but it reappears overnight, suggests one of the following could be happening:

    1. Server-side cache or cron process overwriting or corrupting WooCommerce files or transients.
      • Some hosts run automated caching, malware scans, or file-optimization cron jobs that may unintentionally alter plugin directories or cached block template data.
    2. Persistent cache or OPcache rebuild.
      • If your host uses persistent caching (like Redis, Memcached, or OPcache), stale entries may be restored after the nightly cron resets. Asking your host to manually flush all layers of cache might help confirm this.

    To help narrow this down further, please try the following next steps:

    • Compare the WooCommerce directory before and after the error reappears.
      You mentioned you’ve already backed up the working copy, perfect. Once the issue returns, please compare both directories (using a diff tool or even an FTP compare) and note if any files differ or are missing.
    • Temporarily disable any server-side optimization or cache layers (if your host allows).
      This includes tools like LiteSpeed, NGINX cache, Redis, or Cloudflare.
    • Check server cron logs (or ask your host to) to identify any automated tasks that run around the time the issue tends to return.
    • If possible, switch the site to Storefront temporarily once the issue reoccurs. This will confirm whether the problem is purely file-level or also theme-related.

    Please let us know the results after you test overwriting the WooCommerce directory with your backup when the issue comes back. If that resolves it again, it will strongly confirm that something on the server side is altering or invalidating 

    WooCommerce’s block template files overnight.

    We’ll be happy to dig further once you share those findings.

    Plugin Support Chris Moreira – a11n

    (@chrism245)

    Since we haven’t received any updates from you, I’ll mark this as resolved for now. If you need further assistance, you’re welcome to start a new thread.

    Your feedback helps others – please consider leaving a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

    Thread Starter birddesignnz

    (@birddesignnz)

    Hi all, sorry for the delayed reply I had a colleague away and I was under the pump. Unfortunately I am no closer to solving this one.

    I have tried replacing the WC plugin folder with a copy that I made when everything was working, but this doesn’t seem to solve it. Only reinstalling WordPress fixes the issue before it breaks overnight. I am still trying to get system log information from Crazy Domains, but they are being a bit obtuse, showing me only php error the error that I included in my original post above.

    Any further suggestions would are greatly appreciated as I am getting a bit desperate here. Can we hardcode the value or something?

    Hi @birddesignnz,

    Thank you for your response. It’s been about 3 weeks and 5 days since the issue was first reported, and several updates have been released since then. Could you please share your latest system status report by going to WooCommerce > Status > Get system report > Copy for support, then paste the details on Pastebin and share the link here?

    Thread Starter birddesignnz

    (@birddesignnz)

    Hi everyone, thank you all for your help on this one. I seem to have solved the issue, though I’m still not 100% sure why it was happening. It seems to have been related to the block them. It somehow didn’t like my banner which was a General Template block which I had placed into my template. The clue here was that this is the part of the front end that was disappearing when the error occurred. What I did was recreate the banner as a regular pattern and then reinserted into the template, then no more errors!

    Anyone know why this might have been happened?

Viewing 15 replies - 1 through 15 (of 16 total)

The topic ‘Errors and blocks missing after migration to live site’ is closed to new replies.