-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 API error when saving entry #6116
Comments
This is a becoming a major issue and makes it almost pointless using Netlify CMS. |
This was so painful. Please fix the problem.... or improve that error message please 😢
|
Hi all and thank you for reporting the issue. It seems there's a new API to sync forks, see https://docs.github.com/en/rest/reference/branches#sync-a-fork-branch-with-the-upstream-repository As I'm understanding the issue correctly, we should call that API before saving entries to resolve the issue? |
cc: @JackDevAU |
Sure @bradystroud, the relevant code is here: We can use the |
@erezrokah are you looking for something like this? async authenticateWithFork({
userData,
getPermissionToFork,
}: {
userData: User;
getPermissionToFork: () => Promise<boolean> | boolean;
}) {
// ...rest of the code for authenticateWithFork
if (await this.forkExists({ token })) {
return fetch(`${this.apiRoot}/repos/${userData.login}/${this.originRepo}/merge-upstream`, {
method: 'POST',
headers: {
Authorization: `token ${token}`,
},
body: JSON.stringify({
branch: this.branch,
}),
});
} else {
await getPermissionToFork();
const fork = await fetch(`${this.apiRoot}/repos/${this.originRepo}/forks`, {
method: 'POST',
headers: {
Authorization: `token ${token}`,
},
}).then(res => res.json());
this.useOpenAuthoring = true;
this.repo = fork.full_name;
return this.pollUntilForkExists({ repo: fork.full_name, token });
}
} I am also seeing this typescript error down the file, not sure what to make of it: |
Hey @asheerrizvi |
Here's the PR, let me know if you guys need any changes: #6504 😄 |
ping: needs to be resolved. |
This is a huge cause of pain for us, @martinjagodic could you please review and action the PR from @asheerrizvi |
We are aware of this problem, we will take a look at the PR soon after we establish the first Decap release. Thanks for your patience 🙏 |
Ping... what is the status of this one? |
Definitely not fixed - had the same issue a few times recently :( |
Have seen this issue come up many times recently. Would love to have this resolved! |
This issue is in our attention. We are waiting for the PR owner to solve merge conflicts. If he doesn't respond we will do that on a new PR. |
ping: any updates on this? |
The PR is in progress, more details are there. In essence, builds are failing and I was struggling to create a good repoduction. I hope to find some time soon to continue with this. Any help with the PR would speed things up. |
This is now released in 3.1.0-beta.1. Can anyone test and confirm that this is solved? @RMunschie92 @sethdailyssw @JeanThirion @adamcogan @pierssinclairssw @airtonix |
Can't tell if its fixed because there is a new bug |
@bradystroud I see that many of you are from SSW. Could you find some time together to contribute? |
Up, is there any update on this issue ? |
not really I'm afraid I'm willing to put some effort into this if we find a hero who would describe a very specific scenario on how to (somewhat consistently) reproduce this issue (maybe with a public repo?) |
@demshy Commenting as I had several people I know report the same thing. Somehow it got resolved by deleting and re-inviting the user in Netlify identity. Willing to help with testing but can't consistently reproduce it. However, it's a major blocker when it happens.. |
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
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:
CMS configuration
https://github.com/SSWConsulting/SSW.Rules/blob/main/src/cms/config.js
Additional context
SSWConsulting/SSW.Rules#801
netlify-api-error-video-final.mp4
Figure: Demo of the error
The text was updated successfully, but these errors were encountered: