Netlify-cms: Failed to persist entry: TypeError: Cannot read property 'match' of undefined

Created on 15 Jun 2020  路  5Comments  路  Source: netlify/netlify-cms

Describe the bug

I've deployed a GatsbyJS site with the Netlify CMS at envyforge.com/admin. The Netlify CMS, in production, does load and I'm able to view each of the collection entries defined in the admin/config.yml. However, on save of new or existing cms entries, I get the following error:

Failed to persist entry: TypeError: Cannot read property 'match' of undefined

As a note: I am able to save in local development using npx netlify-cms-proxy-server.

To Reproduce

  1. Go to 'envyforge.com/admin'
  2. Click on 'blog' collection
  3. Create new blog entry (use the hint text if you have questions on what the fields are for)
  4. Click on 'Save'
  5. See error

Expected behavior

To be able to save in product deployment as I am in local dev.

Screenshots

Screen Shot 2020-06-15 at 1 18 07 AM

Applicable Versions:

  • Netlify CMS version: 2.12.14
  • Git provider: Bitbucket
  • OS: macOS 10.15.5
  • Browser version: Google Chrome 83.0.4103.97 (Official Build) (64-bit)
  • Node.JS version (local): v13.3.0
  • Note.JS version (production): AWS Amplify - Node.JS: v10.16.0

CMS configuration

backend:
  name: bitbucket
  repo: envyforge/envyforge.com
  branch: develop
  auth_type: implicit
  app_id: myappid

local_backend: true
publish_mode: editorial_workflow
media_folder: static/images
public_folder: src/data/images
site_url: https://envyforge.com/contribute

collections:
  - name: "blog"
    label: "Blog"
    folder: "src/data/blogs"
    create: true
    editor:
      preview: false
    fields:
      - {
          label: "Title",
          name: "title",
          widget: "string",
          hint: "This is the title that will be shown on the blog page.",
        }
      - {
          label: "Path",
          name: "slugPath",
          widget: "string",
          default: "/blog/",
          hint: "Must be /blog/ to control the path that the blog page will render in.",
        }
      - { label: "Date", name: "date", widget: "datetime" }
      - {
          label: "Author",
          name: "author",
          widget: "string",
          default: "Matt Ortiz",
          hint: "Values: Matt Ortiz or Envy Forge.",
        }
      - {
          label: "Format",
          name: "format",
          widget: "string",
          default: "image",
          hint: "Values: image, quote, video, link or gallery.",
        }
      - {
          label: "Image",
          name: "image",
          widget: "string",
          default: "../images/envyforge-spark-persona-app.png",
          hint: "E.g.: ../images/envyforge-spark-persona-app.png.",
        }
      - {
          label: "Category",
          name: "category",
          widget: "string",
          hint: "E.g.: technology, products & services, practices, this is value creation",
        }
      - {
          label: "Tags",
          name: "tags",
          widget: "list",
          hint: "E.g.: value-creation, product-management, product-development, growth, investment, agile, lean-startup",
        }
      - {
          label: "Featured",
          name: "is_featured",
          widget: "boolean",
          default: false,
          hint: "This controls whether the post will show as a featured item on the blog.",
        }
      - { label: "Body", name: "body", widget: "markdown" }
  - name: "service"
    label: "Service"
    folder: "src/data/services"
    create: true
    editor:
      preview: false
    fields:
      - {
          label: "Sort Order",
          name: "sortOrder",
          widget: "string",
          hint: "This is the order (ascending) that the service or practice card will render on the home page within each Category (services or practices).",
        }
      - {
          label: "Title",
          name: "title",
          widget: "string",
          hint: "This is the title that will be shown on the home page service or practice card.",
        }
      - {
          label: "Description",
          name: "description",
          widget: "string",
          hint: "This is the description (or overview) that will be shown on the home page service or practice card.",
        }
      - {
          label: "Path",
          name: "slugPath",
          widget: "string",
          default: "/service/",
          hint: "Must be /services/ to control the path the services page will render in.",
        }
      - { label: "Date", name: "date", widget: "datetime" }
      - {
          label: "Author",
          name: "author",
          widget: "string",
          default: "Matt Ortiz",
          hint: "Values: Matt Ortiz or Envy Forge.",
        }
      - {
          label: "Format",
          name: "format",
          widget: "string",
          default: "image",
          hint: "Values: image, quote, video, link or gallery.",
        }
      - {
          label: "Image",
          name: "image",
          widget: "string",
          default: "../images/envyforge-spark-persona-app.png",
          hint: "E.g.: ../images/envyforge-spark-persona-app.png.",
        }
      - {
          label: "Image Alt",
          name: "imageAlt",
          widget: "string",
          hint: "This is the image alt text that will show for accessiblity.",
        }
      - {
          label: "Category",
          name: "category",
          widget: "string",
          hint: "Values: services or practices.",
        }
      - {
          label: "Read More",
          name: "readMore",
          widget: "boolean",
          default: false,
          hint: "This setting controls the services and practices cards on the home page. False means no Read More link will be on the services and practices cards on the home page. True means a Read More link will be placed on the home page (services and practices sections) that goes to the underlying content (full body and post).",
        }
      - {
          label: "Tags",
          name: "tags",
          widget: "list",
          hint: "E.g.: value-creation, product-management, product-development, growth, investment, agile, lean-startup",
        }
      - {
          label: "Featured",
          name: "is_featured",
          widget: "boolean",
          default: false,
          hint: "This controls whether the post will show as a featured item on the blog (yes, even if a service).",
        }
      - { label: "Body", name: "body", widget: "markdown" }

Additional context

Happy to provide additional context.

Thanks,

Matt

extensionbackends unconfirmed bug

Most helpful comment

Hi @mattortiz, seems like a permissions issue with the OAuth consumer.

Can you try setting the permissions to:
image

We should probably add a note here that Pull requests permissions is required for editorial workflow

All 5 comments

HI Netlify CMS team,

Here is some additional context from Chrome Dev Tools from envyforge.com/admin:

Failed to load resource: the server responded with a status of 404 ()
https://api.bitbucket.org/2.0/repositories/envyforge/envyforge.com/src/c7f473a40160bfc62f3535464f84283cdc914b94/.gitattributes
This 404 was expected and handled appropriately.

Checking for Unpublished entries
implementation.js:364
This 404 was expected and handled appropriately. API.js:600

Failed to load resource: the server responded with a status of 403 ()
https://api.bitbucket.org/2.0/repositories/envyforge/envyforge.com/pullrequests?pagelen=50&q=source.repository.full_name%20%3D%20%22envyforge%2Fenvyforge.com%22%20%20AND%20state%20%3D%20%22OPEN%22%20%20AND%20destination.branch.name%20%3D%20%22develop%22%20AND%20comment_count%20%3E%200%20AND%20source.branch.name%20~%20%22cms%2F%22

Pausing requests for 1 second due to fetch failures: Cannot read property 'match' of undefined

--> repeats till error comes up on the UI

Note: I also get the same error (above) when navigating to the Workflow tab (not just on save of new post).

Screenshot of chrome tools console output is attached below.

Seems a permissions issue but I'm logging in to the CMS using my bitbucket account. I am, however, the bitbucket private repo owner. Any support is appreciated.

BTW, I really appreciate what the team is doing for the community!

Regards,

Matt

Screen Shot 2020-06-16 at 5 12 53 PM

I am, however, able to upload media to the Netlify CMS and it creates a new file in the dev branch as expected. Don't know if this provides any related context or not.

blob:https://www.envyforge.com/09eb1f37-b323-4e2a-bb84-7e1eab0ea42f (blog: needs to be included in url, btw)

Screenshot of repo/branch where CMS Media uploads land:
Screen Shot 2020-06-16 at 5 29 47 PM

Hi @mattortiz, seems like a permissions issue with the OAuth consumer.

Can you try setting the permissions to:
image

We should probably add a note here that Pull requests permissions is required for editorial workflow

Hi @erezrokah ,

That did the trick! Thank you very much. Was stumped and spun around.

I've gone ahead and updated the documentation using Netlify CMS. So a PR is awaiting review. ;-)

Was this page helpful?
0 / 5 - 0 ratings