Failed to Deploy : destructive changes - how to fix?

My Realm Sync schemas are checked in to a github repository, and linked to the app. Automatic deployment is turned on.

I changed some field types from decimal to double in my schemas. (I have already changed the document values in Atlas.) When I checked in my changes, they won’t deploy because these are destructive changes. I see this in the deployment history:

Unfortunately, neither of the “Review draft & deploy” buttons actually does anything! How can I fix this?

Also, I encountered a problem when I first tried to commit my changes, and I’m not sure where to report it as a bug (in the documentation, if not in fact). When I first committed my changes, I did not have automatic deployment turned on. Of course, nothing happened when I committed. BUT! when I then turned on automatic deployment, still nothing happened. I had to make a second commit to the github repo to trigger a change. This is despite this page saying clearly in the summary at the bottom that “When Automatic GitHub Deployment is enabled, MongoDB Realm immediately deploys the latest commit.” Evidently that means “While it is enabled, Realm immediately deploys each commit”, not “When you enable it, Realm immediately deploys the current latest commit”.

Ok, so I tried terminating sync, and then pressing “re-deploy” - but that doesn’t seem to be doing anything either!

Sorry, I would edit my previous reply but it’s not offering me an edit button. :confused:

Anyway, I realised that I had not actually committed the “terminate sync” changes. So I tried again, terminate sync, commit. Then I tried editing the schema directly in the UI (since it hadn’t actually updated from the version in the github repo) and committing. But even with sync off, it refuses to deploy. The UI also got itself into a bad state, after I tried another time to commit the change - it says “draft not found”:

Anyhow, I have now finally convinced it to make my changes - by disabling automatic deployment from github, then making one-by-one schema changes in the UI.

Note to self: don’t make destructive schema changes through github.

1 Like

Sorry you had trouble with this! The UI giving you a Review Draft & Deploy button that does not work sounds like a bug - I’ll raise this with the team.

Regarding the docs, you’re right - the “Deploy Automatically with GitHub” docs page could be clearer. I’ll update that to “while.” And I’ll investigate the expected behavior when making destructive schema changes, and add a note about that to the page.

Thank you for sharing your findings here. And if you ever find something in the docs that seems misleading, or is missing info, feel free to use the feedback widget in the bottom-right corner of each page to let us know. After you leave a star rating, you can add comments and provide details. The Realm docs team gets those reports and we’re always happy to make improvements.

Glad you found a resolution, and sorry it didn’t work as expected!


Ok, this happened to me again today. Can’t make a destructive schema change, even through Realm UI, even if I terminate sync first. Realm UI fails to deploy the change, then when I press the “review draft and deploy” button again, I get:

At this point, I think I’m going to give up on automatic deployment.

Had the same issue, with automatic deployment enabled neither the changes made in the UI nor github were able to deploy… After disabling automatic deployment the same error appeared as with @polymath74 “Failed to Deploy: draft not found”

Update: Just resolved this. After disabling automatic deployment and getting “Failed to Deploy: draft not found” you can go into the deployment history and choose one of the failed deployments from github, then click “re-deploy”. It was then prompted that this will reset sync on the client, and after deployed fine.