umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Base64 image in a RTE stalls the deployment #144

Closed HalldorLyngmo closed 1 year ago

HalldorLyngmo commented 1 year ago

When there is a base64image inside an RTE it completely stalls the Deployment until the deploy timeout limit is reached.

Reproduction

Specifics

Umbraco: v9.5.4 and v10.3.2 Deploy: v9.5.2 and v10.1.2

Steps to reproduce

  1. Create a document type with an RTE editor and allow it as root.
  2. Add the base64image to the RTE from the txt file I've attached. base64image.txt

image

  1. Publish the node. (This will probably end with an exception since the CMS doesn't like these base64images either) However, refresh the page and you'll have a node to transfer to the next env.
  2. Try transferring the node and it should stall/hang on Create manifest on source

image

This is what the CPU usage looks like during the deployment of this one node. image

Bug summary

Basically, base64 images are the devil 🙈

In the past, we have seen major issues with base64images causing CPU spikes in the CMS during preview or publishing. Often completely killing the application. Processing/serializing these base64 strings seems to be very resource intensive.

Old CMS issues for reference:

Not sure if this needs to be fixed in the CMS or Deploy, though it seems like more of a CMS issue at first glance.

The main reason for creating this issue on the Deploy tracker: If it can't be fixed in Deploy I would like improved logging so it's faster to debug it. Right now, even with Debug logging enabled, there is no information on which node is being processed. If the node id was logged out it would be easier to know at what point it stalls/fails. Speially when it's a large deployment with hundreds of nodes.

When I was debugging with the source code in Visual Studio I was able to log out the content id here. That enabled me to figure out the issue pretty quickly but getting to that spot was a huge pain.

Expected result

It transfers the node blisteringly fast

Actual result

It hangs until the deploy timeout is reached.

AndyButland commented 1 year ago

Have had a look into this. I had trouble with even saving the image provided, presumably due to the linked CMS issues, but trying with a smaller one - e.g. this one - seemed to be OK. Saving and deploying, So I don't think base64 images are fundamentally not supported, but when they get to a certain size they are problematic.

With regard to the logging, I've added a debug log line now that emits an entry just before running an update from an artifact for a particular "pass" (depending on the type of information being transferred, the updates are made in multiple passes).

The line will look like:

Process pass #3 started|completed for artifact "umb://document/3cce2545e3ac44ecbf55a52cc5965db3" ("About Us").

So hopefully that'll help for future when it comes to figuring out what it's tripping up on.