Confirmed XenForo 2.3.13 – Embed metadata rebuild failures, MariaDB error 1406 and image proxy timeouts

LeeRobertsMe

Member
Licensed customer
Affected version
2.3.13
Hi XenForo Development Team,

I'd like to share some findings from our ongoing migration of MYCNCUK, an established UK CNC machining community, from vBulletin 4.2.5 to XenForo 2.3.13.

During post-migration maintenance, we encountered two separate problems with XenForo's embed metadata rebuild jobs. After extensive troubleshooting, we were able to isolate both issues and identify workarounds.

I'm reporting these findings in case they highlight opportunities to improve the reliability of rebuild operations, particularly for forums migrating large amounts of legacy content.

Environment​

  • XenForo: 2.3.13
  • Source platform: vBulletin 4.2.5
  • Operating system: Ubuntu 24.04 LTS
  • Web server: NGINX
  • PHP: 8.3, PHP-FPM
  • Database: MariaDB 10.11
  • Server: Linode VPS, upgraded to 8 GB RAM during troubleshooting
  • Reverse proxy/CDN: Cloudflare
  • Search: XenForo native search, without Enhanced Search
The migrated forum contains approximately 125,000 posts, 14,000 threads and 27,000 attachments, alongside legacy private conversations and other community content.

We also reproduced similar rebuild performance problems in our separate local Docker development environment.

Issue 1 — MySQL error 1406: Data too long for​

During embed metadata rebuilding, XenForo returned:

XF\Db\Exception: MySQL query error [1406]: Data too long for column 'embed_metadata' at row 1

The exception originated from:

XF\Job\AbstractEmbedMetadataJob::saveMetadata()

One confirmed failure involved:

xf_conversation_message.message_id = 7731

The affected conversation message contained approximately 451 KB of message content. Its existing embed_metadata field was NULL.

Our investigation revealed inconsistencies in the column capacities across the relevant tables.

We ultimately confirmed the following schema:

TableColumn type after remediation
xf_post.embed_metadataMEDIUMBLOB
xf_conversation_message.embed_metadataMEDIUMBLOB
xf_profile_post.embed_metadataMEDIUMBLOB
xf_profile_post_comment.embed_metadataMEDIUMBLOB
The conversation and profile-post metadata columns had originally been defined as BLOB in our imported database.

After taking backups, we enlarged the remaining columns to MEDIUMBLOB using targeted ALTER TABLE statements.

Following these changes, the rebuilds progressed successfully beyond the previously encountered database errors.

We appreciate that legacy imported content may contain unusually large or complex metadata, but it may be worth considering whether the relevant schema definitions or rebuild error handling could better accommodate such records.

Issue 2 — Image proxy requests causing rebuild timeouts​

We subsequently encountered a separate problem affecting both:

  • Rebuild post embed metadata
  • Rebuild direct message embed metadata
During these operations, PHP-FPM workers would become heavily occupied, the forum could become temporarily unresponsive, and Cloudflare would eventually return an HTTP 504 Gateway Timeout.

Increasing the VPS specification to 8 GB RAM did not resolve the behaviour.

We enabled PHP-FPM slow-request logging and captured the following execution path:

XF\Job\AbstractEmbedMetadataJob::run()
→ XF\Service\Message\PreparerService::prepare()
→ XF\BbCode\ProcessorAction\AnalyzeUsage::analyzeImgTag()
→ XF\Service\ImageProxyService::getImage()
→ XF\Service\ImageProxyService::refetchImage()
→ XF\Service\ImageProxyService::fetchImageDataFromUrl()
→ XF\Http\Reader::getUntrusted()
→ GuzzleHttp\Client::request()
→ curl_exec()

This showed that the metadata rebuild was spending time attempting to retrieve external image resources through the image proxy.

Given the age of our forum, some legacy BBCode image references may point to remote hosts that are slow, inaccessible or no longer operational.

Isolation and successful workaround​

We performed two controlled tests:

Test A — Exclude image processing

We ran the direct-message embed metadata rebuild with the Images option deselected.

The task completed extremely quickly without the previous timeout behaviour, as did "Rebuild post embed metadata"

Test B — Disable the image proxy

We temporarily disabled XenForo's image proxy through the native Admin CP options.

We then reran the complete direct-message embed metadata rebuild, including image processing.

The full rebuild completed successfully without the previous timeouts.

These results strongly suggest that external image retrieval through the image proxy was responsible for the observed PHP-FPM delays.

Potential improvements for consideration​

Based on our findings, it may be worth considering:

  1. Whether all applicable embed metadata columns should consistently support larger metadata payloads, or whether oversized records should be handled more gracefully.
  2. Whether image metadata rebuilding could avoid synchronous external image downloads, or impose more restrictive per-request timeouts during rebuilds.
  3. Whether failed or slow external image URLs could be skipped and logged without delaying an entire rebuild batch.
  4. Whether the rebuild interface could provide more detailed progress information, including the current record ID and operation, to assist with troubleshooting migrated content.
I recognise that some of these behaviours may be intentional, and that external network conditions and legacy content can complicate migration work.

Nevertheless, the difference between rebuild behaviour with the image proxy enabled and disabled was substantial and repeatable in our tests.

Conclusion​

Both issues are now sufficiently isolated for us to continue validating the MYCNCUK migration.

Our immediate workaround has been to standardise the relevant embed metadata columns to MEDIUMBLOB and temporarily disable image proxying during metadata rebuild operations.

I'd be interested to know whether these behaviours are already recognised, whether there is an alternative recommended configuration, or whether any of these findings warrant further investigation.

I'm happy to provide additional logs, SQL schema information, or relevant diagnostic details if helpful.

Kind regards,

Lee Roberts
Technical Director & Founder
Machinist Network
https://machinist.network

MYCNCUK — https://www.mycncuk.com
 
Back
Top Bottom