[Common Issue] Netlify CMS API_ERROR. Now what?

@cobbie Have you set the right branch in your config?

Yup, branch is set correct. Such as the ff right?

backend:
  name: git-gateway
  branch: master

Looks reasonable to me. This of course could only work if we are hosting the site live - to use our hosted git-gateway as the backend.

I could create a new post, a new page using Netlify CMS before but today I get the following error message:

API_ERROR: tree.path contains a malformed path component

Here is my config.yml file

# using git as backend store
backend:
  name: git-gateway
  branch: master
publish_mode: editorial_workflow
media_folder: "/static/media" # Folder where user uploaded files should go
public_folder: "/media"
site_url: https://joelgie.com
editor:
  preview: true
locale: 'fr'

# Allow local visit
# You need to run at the root of the project `npx netlify-cms-proxy-server`
local_backend: true

# i18n https://www.netlifycms.org/docs/beta-features/#i18n-support
i18n:
  structure: multiple_folders
  locales: [ en, fr ]
  default_locale: en

collections:
  - name: "post" # Used in routes, e.g., /admin/collections/blog
    label: "Post" # Used in the UI
    folder: "content/post" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{day}}-{{month}}-{{year}}{{slug}}" # Filename template, e.g., DD-MM-YYYY-title.md
    nested:
      depth: 100 
    path: "{{filename}}/index"  
    fields: # The fields for each document, usually in front matter
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Categories", name: "categories", widget: "list"}
      - {label: "Body", name: "body", widget: "markdown"}

  - name: "pages" # Used in routes, e.g., /admin/collections/pages
    label: "Pages" # Used in the UI
    folder: "content/page" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{slug}}" # Filename template, e.g., title.md
    nested:
      depth: 100 
    path: "{{filename}}/index" 
    fields: # The fields for each document, usually in front matter
      - {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Body", name: "body", widget: "markdown"}

Hiya,

It’s worth mentioning that Netlify CMS is now managed by DeCap CMS. I’d encourage you to reach out to them for assistance. i’ll of course leave this thread open as we still have some CMS experts who will be happy to chime in.

1 Like

I was not aware of such change.

Thanks a lot @SamO!

Anyone here coming across similar issues?