3 minutes August 6, 2025

Fixing “Error 503 Backend Fetch Failed” in Shopware 6.6 with Varnish: Header Too Long Explained

After upgrading from Shopware 6.5 to 6.6 and using Varnish as your reverse proxy, you may run into a sudden critical issue:

  • Pages return 503 errors
  • Varnish logs show messages like:
    Varnish logs fill up with BogoHeader Header too long: xkey: ... and FetchError http format error.

This error is not widely documented, but it directly affects stores with advanced caching setups. Here’s what’s happening and how to fix it.

What’s Causing the Error?

Shopware 6.6 introduces more granular HTTP cache tagging via the xkey header. This allows precise cache invalidation by tagging each response with multiple cache keys.

However:

  • The xkey header can grow very large (especially on pages with many entities).
  • Varnish has strict defaults:
    • Max size for a single header: 8KB
    • Max size for all headers combined: 32KB

Once the xkey exceeds these limits, Varnish fails to process the response and returns a 503.

How to Identify the Issue

Varnishlog will show:

Your site’s users see:

  • Error 503 Backend fetch failed

Why It Happens After Upgrading to Shopware 6.6

  • Shopware 6.6 enables more detailed cache tags by default.
  • Each product/category/page adds to the growing xkey header.
  • If you’re using use_varnish_xkey: true, the tag list expands even faster.
  • The new config key for reverse proxy is:
    shopware.http_cache.reverse_proxy (was storefront.reverse_proxy in 6.5)

Solution: Increase Varnish’s Header Limits

To support the larger headers, you need to manually increase Varnish’s limits.

Step 1: Edit the ExecStart Command in varnish.service

Find your varnish.service file (e.g., /etc/systemd/system/varnish.service) and update ExecStart like this:

These values raise the limits to 256KB (from the default 8KB and 32KB).

Step 2: Reload and Restart Varnish

Don’t forget:

  • Both must be increased, one for any single header, one for all headers in total.
  • Edit your unit file, then:

Confirm the Fix

Use these commands to check the active settings:

Make sure both show the updated values.

 Key Takeaways

  • This is not a bug but a result of Shopware 6.6’s improved caching system.
  • Varnish’s default limits are too low for the new cache tagging behavior.
  • Without increasing these limits, your reverse proxy setup will break, even if your configs are otherwise correct.
  • As your store grows or adds more plugins, you may need to tune these limits again.
  • Plugins or themes that add additional cache tags or metadata can also contribute to this issue by increasing header size.

Need Help?

If you’re facing cache or proxy issues after a Shopware upgrade, 2Hats Logic Solutions can help. Our experienced Shopware developers specialize in performance tuning and Varnish configuration.

 

 

blog
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Aneesh ceo
Aneesh Sreedharan
Founder & CEO, 2Hats Logic Solutions
Subscribe to our Newsletter
Aneesh ceo

    Stay In The Loop!

    Subscribe to our newsletter and learn about the latest digital trends.