Error on Netlify CMS admin access through /admin/ page

On accessing NetlifyCMS through “the site”/admin/ hosted on netlify.com I’m receiving an error:

Failed to load entry: TypeError: Cannot read property 'split' of null

Uncaught (in promise) 
{type: "ENTRIES_FAILURE", error: "Failed to load entries", payload: "TypeError: Cannot read property 'split' of null", meta: {…}}
error: "Failed to load entries"
meta: {collection: "blog"}
payload: "TypeError: Cannot read property 'split' of null"
type: "ENTRIES_FAILURE"
__proto__: Object
backend.js:1 TypeError: Cannot read property 'split' of null
    at t.default.getCursorFromHeaders (netlify-cms-app.js:65)
    at netlify-cms-app.js:65
    at async Promise.all (/admin/index 0)
    at async t.default.listAllFiles (netlify-cms-app.js:65)
    at async Promise.all (/admin/index 0)
r	@	backend.js:1
(anonymous)	@	netlify-cms-app.js:13
Promise.catch (async)		
(anonymous)	@	netlify-cms-app.js:13

Background:
This installation was done for a friend to add Netlify CMS functionality to an existing Gatsby site on netlify.com

Prior to deploying to his site I developed and tested successfully on a completely independent netlify.com account (mine). I do not see the error on my account and it works fine.

Any ideas?

Hi @witcradg, can you provide a link to the actual site that you’re having trouble with? Thanks.

the url is codestaff.io
Site name wizardly-khorana-afc7ac

Can I supply you with anything else?

Hi @witcradg, you’ll need to make sure that there is at least one markdown file in the content/blog folder. I think that’s the reason you are getting that error. Let me know if that helps.

The repository has markdown blog posts as can be seen from the GitLab page below. If they are not present on netlify.com that would seem to be a deployment issue. Can we actually see the markdown files on netlify?

I’m not sure I’m on the same page. Where is the GitLab page you are referring to? Note that the CMS admin page will use the Gitlab API to access your repository directly. It is not able to find a markdown file in the folder in your repo. That said, this is not a deploy-related issue.

Note that during the deploy, your build process will likely build out your page and won’t directly include your markdown files. It’ll only include files inside the publish directory that you’ve set in your settings.

Let’s try this again. (I tried replying with gmail and it dropped this part:
|Name|Last commit|Last update|
angularjs-your-job-interview-study-sheet.md|force refresh of blog content|3 days ago
getting-started-with-node-red.md|force refresh of blog content|3 days ago|
linkedin-marketing.md|force refresh of blog content|3 days ago|
php-interview-study-sheet.md|force refresh of blog content|3 days ago|
welcome-to-your-blog-post-editor.md|force refresh of blog content|3 days ago|

posting here directly instead of sending a reply through gmail.

Note: I have used this same process to deploy markdown in the development work I did for this site on my personal account. The markdown is the same the directories are the same…

The site we’re talking about is a production site for my friend. I developed it on my personal account and just moved it. That site works including the markdown. Everything I have been able to find is the same…

To elaborate: I created the site first on my personal gitlab account and deployed it to my personal netlify site. Once that was satisfactory and the /admin/ functionality was working, I created a new repository on gitlab on my friends account and pushed the code to that repo. I then setup and wired in an account for him on netlify.com pulling from the new gitlab account. The basic site works, but the /admin/ functionality is not.
… hope this helps

By the way, I may not have been clear on this point. The blog posts appear on the site. I just can’t use the /admin/ functionality.
… hope this helps

Hmm judging by that stack trace, I’d say the files response through Git Gateway has no Link header.

@witcradg you said you have two roughly identical sites, but only one is broken - can you confirm that both are using Netlify Identity, Git Gateway, and a GitLab repository? Also the number of blog posts in each repo might be informative.

I can confirm both are using Netlify Identity, Git Gateway and a GitLab repo.
Thanks for your help.
P.S. re: I’d say the files response through Git Gateway has no Link header.
Can you expand on this?

The site I’m trying to fix is a production site, but as test I cloned the repository it’s connected to and created a new repository with the same content and a different name. I then created a test site (csio-prod-test) with the same code on the same account.

It works when all I do is rename the site, set up Identity (leave registration open) and set git gateway.

To me this suggests I managed to screw something up in the process of setting it up on app.netlify.com. If I had to hazard a guess I would think it was in changing the site from open to “invite only” but that is a WAG.

I hate to do it, but it may be necessary for me to delete the production site and set it up again.
(or continue setting up the test site and switch it over when ready)

Hi @witcradg, were you able to resolve the issue or rebuild the site?

Hi,
I was able to create a new netlify site with the same repo and migrate the production custom URL to that new netlify site. I was especially pleased that netlify.com was able to copy the netlifyDNS settings directly from the old site automatically. The whole process was much easier than I thought and with virtually no downtime.

:beetle:
BUG:
That said, I think there is a small bug in the display of the netlifyDNS settings. When the DNS records were copied over, the NETLIFY type DNS records are copied over as well. These are the records that indicate the original netlify.com site name. That name indicates the value of the old site and not the new one.

Example: The site that was not working was on wizardly-khorana-afc7ac.netlify.com. When I created the new site and the DNS records were copied over, that is still the value in the NETLIFY type DNS records of the new site even though that site no longer exists ".

However, the site works just fine :smile:

If I’d known the process was so easy and quick I would not have spent so much time trying to fix the original :wink:

Thanks for all your help,
Dean

@futuregerald & @erquhart,

I started having this issue within the last few days. We have a netlify site that’s been up and running successfully since May. All of the sudden we logged into admin and we’re getting the: “Failed to load entry: TypeError: Cannot read property ‘split’ of null”

And this morning I’m getting “Failed to load entry: TypeError: i is null” which are seemingly being caused by 500 errors when requesting data from the git repo. Ex:

Request URL:https://handbook-weare5stones.netlify.com/.netlify/git/gitlab/repository/tree?path=src%2F...&ref=master&ts=1573830944305
Request method:HEAD
Remote address:xxx.xxx.xxx.xxx:xxx
Status code:
500
Version:HTTP/2.0
Referrer Policy:no-referrer-when-downgrade

Any ideas as to why this has happened? No configuration has been changed on our end.

There’s an issue with git gateway, here’s our status page for tracking: https://www.netlifystatus.com/

I received the same error because I had files with an untracked file format (mp4) in my uploads folder.

Was this issue resolved? We’re running into the same scenario.

Admin was working fine for months. No changes/edits. We relinked the repo after copying it, and now we’re running into errors (all content missing in Netlify CMS). Tried regenerating Deploy Keys with no success.

Site frontend is OK. Backend has no content. Collections are all there but blank.