"GitRPC::BadObjectState" error when attempting to save an entry within Netlify CMS

Hi all,

Recently, I have been experiencing issues with Netlify CMS that I am having difficulty troubleshooting.

Whenever I attempt to save any entry, I see an error:

Failed to persist entry: API_ERROR: GitRPC::BadObjectState

I’ve tried to resolve this in the following ways:

  • I checked the related topic at Failed to persist entry: API_ERROR: GitRPC::BadObjectState but this seemed to be a problem with the user’s config file and I cannot map that to any issue with my config file that I’m aware of.
  • I have looked at the history of my config.yml file and reverted it to a month ago just to ensure no recent changes had caused the issue.
  • I attempted to specifically pin the Netlify CMS version to 2.10.49 which I know I’d used successfully.
  • For a given post, I updated from the main branch in GitHub to ensure it was up to date. I then cleared all cached for my site via the browser dev tools as far as I could tell.

A few things I can think of that might be culprits but I’m not sure how to officially diagnose:

  • I recently changed my default branch from “master” to “main”, but had used the CMS successfully since then and the PRs are all against the correct base branch currently in GitHub.
  • I recently updated the yaml in one or two posts to add a header image as supported by the theme I’m using (the Minimal Mistakes Jekyll theme). The YAML is correct and it appears correct in the web site, but my Netlify CMS config doesn’t account for that YAML. Does it need to be included in the config definition if one item uses it?

Any help here would be appreciated – I very mych enjoy using Netlify CMS!

Sorry to be slow to get back to you, Sean!

You’ve pre-answered everything I could think to ask before escalating to our CMS devs, so I have done that and we’ll hopefully get an answer for you soon. Just to confirm - still happens, right? (I can’t login to your CMS to test and that message won’t reach our logs since it is browser-based and not from our server directly, as far as I know)

Hi @SeanKilleen,

Thank you for doing such an extensive debugging process.

Does the issue happen with both published entries (ones that don’t have a PR linked to them) and with editorial workflow entries (one that have a PR linked to them)? Can you give me an example of an entry so I can try and reproduce (I can re-create the PR in a fork).
Can you create new entries?

I was able to fork your repo and create/save entries successfully:

The only thing I changed in the config.yml was to reference my fork and removed the site_domain here https://github.com/SeanKilleen/seankilleen.github.io/blob/cbadb8f4a487ddbba3b6891dbf5dde62c2220c75/admin/config.yml#L5.
I also changed the index.html to use the latest CMS version.

The CMS should ignore any unknown markdown fields.

Hi @erez,

Thanks for looking into this! Not sure how I missed the reply but I definitely did.

I haven’t seen this for a little bit but will continue to look into it. I also was unaware that I’d pegged the Netlify CMS build at a specific version, so I’ve gone ahead and updated that version too. Willing to bet that this will resolve any problems, but wanted to at least get back to you and say thanks!

1 Like

Thanks for the follow up @SeanKilleen, it’s very much appreciated :slight_smile: