scam
July 8, 2020, 5:29pm
1
I’ve just tried to share a Gatsby / Netlify CMS project with a colleague. The project works great on my machine. On hers, the CMS appears unable to load existing data. When navigating to edit a collection from the dashboard, we notice a SyntaxError: Unexpected end of JSON
input error in the browser console 5 times (we have 5 files in this collection). If we delete those files and attempt to create new data, we see API_ERROR: Unknown error
/ ENTRY_PERSIST_FAILURE: Failed to persist entry
. We both have the proxy running in the same way, same version of Node etc. Any ideas as to why this might be the case would be much appreciated! Thanks, Simon
jen
July 11, 2020, 10:25pm
2
Hey @scam ,
Very strange! Are these public repos you’d be willing to share?
In the meantime, I wonder if any of these errors descriptions match what your setup is?
opened 07:24PM - 31 Oct 19 UTC
area: api
area: extensions/backends
area: error-handling
pinned
Related to #1693
**Is your feature request related to a problem? Please desc… ribe.**
<!--
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->
The CMS passes along error messages from the individual backends, resulting in some pretty cryptic notifications. It would be nice to provide some context or instructions on how to deal with these errors, since the different ways to resolve them are often pretty straightforward.
**Describe the solution you'd like**
The error messages shouldn't disappear without being explicitly dismissed by the user. They should give a clear description as to why they occur, as well a way to resolve them. There is a bunch of different API errors:
___
```
API_ERROR: {"message":"404 File Not Found"}
```
As far as I know there are two scenarios that cause this error:
- The collection `folder` or `file` property is missing a value (a dedicated file or folder, can't be blank or root). The file or folder should be relative to root (so `src/posts` for example).
- There are subfolders within the collection folder
___
```
API_ERROR: Not Found
```
- The media library folder is missing, or the value of the media library property within `config.yml` isn't correct.
___
```
Failed to load entries: API_ERROR: Not Found
```
- Git Gateway is not enabled: Enable Git Gateway from the Netlify Identity settings or refresh the token
- There aren't any entries for a given collection. Not sure if we should throw this error at all actually.
___
```
Failed to load entry: API_ERROR: Not Found
```
- The collection `folder` or `file` property is missing a value (a dedicated file or folder, can't be blank or root). The file or folder should be relative to root (so `src/posts` for example).
- There aren't any entries for a given collection.
___
```
Failed to persist entry: API_ERROR: Not Found
```
- The org account needs to grant access to your Netlify CMS instance: https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/requesting-organization-approval-for-oauth-apps
___
```
Failed to persist entry: API_ERROR: Reference update failed
```
- You're using the editorial workflow but already have a branch called `cms`. This error is fixed by removing the `cms` branch from the repo.
___
Not really an API error but pretty easy to resolve:
```
Failed to load settings from /.netlify/identity
```
- Netlify Identity isn't enabled
- `config.yml` has git-gateway as a backend on a site that isn't hosted on Netlify