Umbraco cloud CI/CD error: Patch cannot be applied - searches for old

Hi everyone,

I’m running into an issue with Umbraco Deploy (v17) in the Azure DevOps CI/CD pipeline and hoping someone can point me in the right direction.

Setup:

  • Umbraco cloud project with repository in Azure Devops.
  • CICD pipeline using the samples from github: GitHub - umbraco/Umbraco.Cloud.CICDFlow.Samples · GitHub
  • Umbraco version: 17.4.2
  • Schema files in the repository: version 17.1.0
  • Target (cloud) environment schemas: also version 17.1.0

Problem:
During deployment, the pipeline fails with the message:

Patch cannot be applied - please check the output below for the problematic parts

This is followed by multiple similar errors like:

Checking patch src/.../umbraco/Deploy/Revision/data-type__0225af17b30249cb9176b9f35cab9c17.uda…
error: while searching for:
“Udi”: “umb://data-type/0225af17b30249cb9176b9f35cab9c17”,
“Dependencies”: [ ],
“\__type”: “Umbraco.Deploy.Infrastructure,Umbraco.Deploy.Infrastructure.Artifacts.DataTypeArtifact”,
“\__version”: “17.0.2”
}
error: patch failed: src/.../umbraco/Deploy/Revision/data-type__0225af17b30249cb9176b9f35cab9c17.uda:7

Observations:

  • The errors are consistent across multiple schema files.

  • The failing patch references __version: 17.0.2, while both environments are on 17.1.0. I checked this using the kudu editor for the files on cloud.

Any help or pointers would be much appreciated.

Thanks!

Hi @IcDaan

A few suggestions for things to try courtesy of AI:

Practical steps to try, roughly in order:

  1. In the cloud portal, trigger a fresh extraction so the stored diff regenerates against current state, then re-run the pipeline.

  2. Verify Umbraco.Deploy.* (Cloud, Core, Infrastructure) NuGet versions are identical between your repo and what’s deployed to the cloud environment.

  3. If the environments genuinely have matching content and this is purely a serialization-version textual conflict, you can resolve by pulling the current cloud .uda files down (clone the cloud git remote), letting them overwrite your local revision folder, committing, and pushing — which re-baselines everyone to the same __version.

  4. Check whether an auto-upgrade ran on the cloud environment recently; that’s a frequent trigger for the artifact version stamp changing underneath you.

Justin

Hi @justin-nevitech ,

Thanks for the suggestions,

  1. Maybe I’m not understanding this suggestion correctly, so please explain further if that’s the case.
    1.1. I updated the schema locally and in the cloud using the deploy dashboard, and I also cleared cached signatures in both environments.
    1.2. After that, I performed a manual backmerge from the cloud into my DevOps repository. The existing schemas are now the same version (17.1.0).
  2. These packages also match the same version.
  3. This was resolved with the backmerge. My local revision folder contains more items than the cloud environment.
  4. No auto-update has occurred since I performed the full backmerge.

The issue still remains. Thanks for the input.

Hi @IcDaan

If your local Revision folder has more .uda files than cloud, the patch is trying to push those extras up as new files, and that’s different to the version mismatch you started with. Even with everything on 17.1.0 now, the apply can still fail if the diff baseline doesn’t line up with what’s actually on cloud.

Couple of things to check:

Clone the cloud git remote into a separate folder and diff the two Revision directories directly:

git clone <cloud-remote-url> cloud-check
diff -rq cloud-check/umbraco/Deploy/Revision <yourrepo>/umbraco/Deploy/Revision

The files in yours but not cloud’s are your suspects - likely schema you created/committed locally but never got deployed up. The backmerge pulls cloud’s state in but won’t delete those local-only leftovers.

Also worth ruling out: are the failing files in the log (data-type__0225... etc.) local-only, or do they exist in both? If they’re in both and still failing, it’s probably a line-ending thing (CRLF vs LF) on the .uda files — git sees every line as changed and the apply breaks even though the JSON is identical.

Justin

I did a manual push to Umbraco Cloud, so both branches are up to date. The schemas are identical. Still, my pipeline fails with a schema version that’s in neither branch.

Doing a backmerge form the cloud master branch to my devops shows no pending changes.

I’m going to contact the cloud team of Umbraco maybe its a known issue to them.

Hi @IcDaan

That would have been my next suggestion as I wouldn’t know what to try next…

Hope you get an answer!

Justin

Thanks, will leave the solution here once we find one.

Update: This documentation should describes the issue and provides a fix: Troubleshooting | Cloud | Umbraco Documentation

TLDR: Ensure that your repository contains the changes that are in the Cloud environment. Run a new deployment without the cloud-sync step.

Yep that was the fix. Pull from Umbraco cloud and make sure local branch/repo is up to date with latest changes. Then deploy without the CloudSync step. After that turn it back on and it works. :umbraco-heart:

Thanks for posting the solution. Just ran in to this myself and all works again.