decaporg / decaporg/decap-cms

🐛 API error when saving entry

Open
#6,116 25 comments 7 reactions 0 assignees View on GitHub
area: api echoes/effort: S exp: beginner hot pinned type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

cc: @jackDevAu @pierssinclairssw

Hi,

**Describe the bug**
Some of our users are getting an error when they try to save an entry.

Failed to persist entry: API_ERROR: Not Found

![image](https://user-images.githubusercontent.com/38869720/148878880-4a63b1e0-d6ff-4974-896b-c7b2e637c61d.png)
**Figure: Error when saving**

After some investigation, it looks like the error occurs when Netlify CMS tries to compare the cms changes branch on the users fork with the main branch on the base repository.
e.g. `https://api.github.com/repos/SSWConsulting/SSW.Rules.Content/compare/main...JackDevAU:cms/JackDevAU/SSW.Rules.Content/rule/appointments-do-you-show-all-the-necessary-information-in-the-subject/rule`

the `JackDevAU:cms/JackDevAU/SSW.Rules.Content/rule/appointments-do-you-show-all-the-necessary-information-in-the-subject/rule` branch was not created. It is not clear why (see video).
The results are the same when using an incoginto window in a different browser.

The problem is resolved after updating the users fork. To try reproduce the problem, we reverted a fork to an old commit, then made a change, but the entry still saved.

**To Reproduce**
We cannot consistently reproduce this error as it is only happening to some of our users. See our video attached below demoing the problem.

**Expected behavior**
The entry should save without error.

**Applicable Versions:**
- Netlify CMS core version: 2.54.0
- Netlify CMS app version: 2.15.59
- Git provider: GitHub

**CMS configuration**
https://github.com/SSWConsulting/SSW.Rules/blob/main/src/cms/config.js

**Additional context**
https://github.com/SSWConsulting/SSW.Rules/issues/801

https://user-images.githubusercontent.com/38869720/148888815-fba3ec44-c978-45a0-8f3f-d3e99713ef13.mp4

**Figure: Demo of the error**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.