API error after manual delete of CMS created branch

Hey there,

we are using the netlify CMS since a short time with editorial workflow activated. The CMS created a branch for a new content (post) I added via the cms. As it was a test - and I was in a rush and sticked to learned behaviour - I deleted the branch in the repositroy.

No I always get the following error message when going to “Workflow” in the CMS backend:

Failed to load entry: API_ERROR: {“type”: “error”, “error”: {“message”: “The source or destination could not be found for spec: cms/XXXX/XXXX-XXXXXXX-XXXXX…main.”}}

Where is this “link” saved, so I could also delete this by hand? Or is there a better way to solve this situation now?

THANKS

Michael

What happens if you create a branch with the same name?

Thanks for your question.

Failed to load entry: API_ERROR: {“type”:“error”,“error”:{“message”:“No such file or directory: src/XXXX/XXXX-XXXXXXX-XXXXX.md”}}

Seams to be a step closer - but not close enough. :wink:

And of course I not just created the branch - I also created a file with that name.

Just to confirm, did the file get pushed to the repo? Sometimes blank files and folders are not pushed to the repo. I don’t see why it would fail if the branch and file exists. Maybe try adding some demo content to the file?

Hey there. The file had already content - but it only existed (as it was before deleting the whole branch) just existing in that branch. I now also created this file in the main branch - and so it worked. I could delete the test post in the “Workflow” in the Netlfiy CMS - and then could delete all that branches and files again - and now everything works again. Thanks for your time and your sign in the right direction.

The solution in small steps was:

  1. create a branch with the same name as the deleted branch had
  2. create a file with some content in the new branch AND in the main branch. Give it the same name as the file in the deleted branch had. (after step 1 you should see the name in the error message. It is slightly different now)
  3. Now you should not have an error message anymore. Delete the content from within the Netlify CMS (in Workflow).
  4. Now you can delete the files and the branch created in step 1 and 2.

That worked for me and I hope that helps somebody else someday!

1 Like

Thanks for coming back and sharing this solution with the Forums! This will definitely be beneficial for future Forums members who encounter something similar. :netliconfetti: