- 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.
We also reproduced similar rebuild performance problems in our separate local Docker development environment.
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:
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.
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:
repare()
→ 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.
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.
Nevertheless, the difference between rebuild behaviour with the image proxy enabled and disabled was substantial and repeatable in our tests.
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
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
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:
| Table | Column type after remediation |
|---|---|
| xf_post.embed_metadata | MEDIUMBLOB |
| xf_conversation_message.embed_metadata | MEDIUMBLOB |
| xf_profile_post.embed_metadata | MEDIUMBLOB |
| xf_profile_post_comment.embed_metadata | MEDIUMBLOB |
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
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:
→ 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:- Whether all applicable embed metadata columns should consistently support larger metadata payloads, or whether oversized records should be handled more gracefully.
- Whether image metadata rebuilding could avoid synchronous external image downloads, or impose more restrictive per-request timeouts during rebuilds.
- Whether failed or slow external image URLs could be skipped and logged without delaying an entire rebuild batch.
- Whether the rebuild interface could provide more detailed progress information, including the current record ID and operation, to assist with troubleshooting migrated content.
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