Failed to persist entry: API_ERROR: Branch not found - Gatsby & NetlifyCMS

While creating your Gatsby Blog, if you chose the Gatsby Starter Delog - Blog for Developer and Designer developed by W3Layouts, chances are that while you create a new entry to Publish on Neltify CMS, you would get the error:

Failed to persist entry: API_ERROR: Not Found

So to fix the error, in the static/admin directory, at the top of your config.yml, add the following:

Copy
backend:
  name: github
  repo: <your-repo-name>
  accept_roles:
    - admin
    - editor
  branch: main 
  
  --- rest of config.yml file --- 

Commit the changes, and then re-deploy to Netlify.
The error should be gone now, and you should be able to publish a new entry now.

If the error isn't gone yet, have a look at some solutions here: https://github.com/netlify/netlify-cms/issues/2544

Comments

Edwards Moses - Web & Mobile — React & React Native Consultant

Edwards Moses
Web & Mobile — React & React Native Consultant

I'm Edwards, based in Lagos, Nigeria.
Freelancer Software Developer — collaborating with teams to craft extraordinary products.

From conception through to completion, I find immense joy in witnessing the evolution of an idea into a fully realized product in the hands of users. Check out my projects and articles to see what I've been up to lately.

Ready to bring your ideas to life?