decaporg / decaporg/decap-cms

Unable to access a collection: Unexpected end of JSON input

Open
#5,102 17 comments 0 reactions 0 assignees View on GitHub
area: extensions/backends area: extensions/backends/bitbucket type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Hello, we are currently maintaining a site using Gatsby.js and Netlify CMS. Last week the CMS started failing to load a collection(file collection) of pages returning the error: `Unexpected end of JSON input`. We are getting the error on mediaLibrary.js and entrie.js resulting in the CMs not loading that collection. This issue only happens when we run the project locally, on production the CMS is working as expected.

**Describe the bug**
1. we have a site with a collection named pages
2. we have a site with over 1000 images
3. we are using bitbucket as the backend
4. mediaLibrary.js and entries.js fails with the Unexpected end of JSON input error, hence those collections are inaccessible

**Applicable Versions:**

- Netlify CMS version: 2.14.3
- Git provider: Bitbucket
- OS: Mac OS Catalina

- Node.JS version: 12+

**CMS configuration**
```javascript
init({
config: {
slug: {
clean_accents: true,
},
backend: {
name: 'bitbucket',
repo: [our-repo-name],
branch,
cmsLabelPrefix: branch,
auth_type: 'implicit',
app_id: process.env.NETLIFY_APP_ID,
},
media_folder: 'static/uploads',
public_folder: '/uploads',
publish_mode: 'editorial_workflow',
local_backend: env === 'local',
collections: CMS_COLLECTIONS,
},
});
```

I appreciate it if you guys could help us figure out this error, we have been trying to debug it ourselves but we haven't found what is causing those errors to throw. If you need more information I'll happily add it.

Regards

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.