decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.83k stars 3.04k forks source link

"API_ERROR: Unknown error" when using `npx netlify-cms-proxy-server` #5472

Open JWesorick opened 3 years ago

JWesorick commented 3 years ago

Describe the bug

When using netlify local backend, and navigating to edit pages, it fails with `API_ERROR: Unknown error". (On just viewing the edit page, not on save.)

To Reproduce

  1. npx netlify-cms-proxy-server
  2. gatsby develop
  3. Go to /admin.
  4. Click on a page to edit, in my case "Teachings", click on a teaching.

Expected behavior

Expect to be able to edit pages.

Screenshots

Screen Shot 2021-06-06 at 3 28 33 PM

Applicable Versions:

CMS configuration

Additional context

API_ERROR: Unknown error
    t http://localhost:8000/admin/netlify-cms-app.js:54
    i http://localhost:8000/admin/netlify-cms-app.js:54
    request http://localhost:8000/admin/netlify-cms-app.js:493
    getMedia http://localhost:8000/admin/netlify-cms-app.js:493
    getMedia http://localhost:8000/admin/netlify-cms-app.js:28
    f http://localhost:8000/admin/netlify-cms-app.js:34
    loadMedia http://localhost:8000/admin/netlify-cms-app.js:34
    r http://localhost:8000/admin/netlify-cms-app.js:164
    r http://localhost:8000/admin/netlify-cms-app.js:22
    componentDidMount http://localhost:8000/admin/netlify-cms-app.js:216
    React 12
    notify http://localhost:8000/admin/netlify-cms-app.js:22
    notifyNestedSubs http://localhost:8000/admin/netlify-cms-app.js:22
    handleChangeWrapper http://localhost:8000/admin/netlify-cms-app.js:22
    v http://localhost:8000/admin/netlify-cms-app.js:43
    waitUntilAction http://localhost:8000/admin/netlify-cms-app.js:58
    r http://localhost:8000/admin/netlify-cms-app.js:164
    dispatch http://localhost:8000/admin/netlify-cms-app.js:43
    authenticateUser http://localhost:8000/admin/netlify-cms-app.js:43
    promise callback*t.authenticateUser/< http://localhost:8000/admin/netlify-cms-app.js:43
    r http://localhost:8000/admin/netlify-cms-app.js:164
    _ http://localhost:8000/admin/netlify-cms-app.js:148
    loadConfig http://localhost:8000/admin/netlify-cms-app.js:43
    r http://localhost:8000/admin/netlify-cms-app.js:164
    _ http://localhost:8000/admin/netlify-cms-app.js:148
    js http://localhost:8000/admin/cms.js:14361
    factory http://localhost:8000/admin/cms.js:48787
    __webpack_require__ http://localhost:8000/admin/cms.js:48180
    <anonymous> http://localhost:8000/admin/cms.js:49495
    <anonymous> http://localhost:8000/admin/cms.js:49499
netlify-cms-app.js:34:39826
    f http://localhost:8000/admin/netlify-cms-app.js:34
    (Async: promise callback)
    f http://localhost:8000/admin/netlify-cms-app.js:34
    loadMedia http://localhost:8000/admin/netlify-cms-app.js:34
    r http://localhost:8000/admin/netlify-cms-app.js:164
    r http://localhost:8000/admin/netlify-cms-app.js:22
    componentDidMount http://localhost:8000/admin/netlify-cms-app.js:216
    React 12
    notify http://localhost:8000/admin/netlify-cms-app.js:22
    notifyNestedSubs http://localhost:8000/admin/netlify-cms-app.js:22
    handleChangeWrapper http://localhost:8000/admin/netlify-cms-app.js:22
    v http://localhost:8000/admin/netlify-cms-app.js:43
    waitUntilAction http://localhost:8000/admin/netlify-cms-app.js:58
    r http://localhost:8000/admin/netlify-cms-app.js:164
    dispatch http://localhost:8000/admin/netlify-cms-app.js:43
    authenticateUser http://localhost:8000/admin/netlify-cms-app.js:43
    (Async: promise callback)
    authenticateUser http://localhost:8000/admin/netlify-cms-app.js:43
    r http://localhost:8000/admin/netlify-cms-app.js:164
    _ http://localhost:8000/admin/netlify-cms-app.js:148
    loadConfig http://localhost:8000/admin/netlify-cms-app.js:43
    r http://localhost:8000/admin/netlify-cms-app.js:164
    _ http://localhost:8000/admin/netlify-cms-app.js:148
    js http://localhost:8000/admin/cms.js:14361
    factory http://localhost:8000/admin/cms.js:48787
    __webpack_require__ http://localhost:8000/admin/cms.js:48180
    <anonymous> http://localhost:8000/admin/cms.js:49495
    <anonymous> http://localhost:8000/admin/cms.js:49499

POST http://localhost:8081/api/v1 request: {"branch":"master","action":"getMedia","params":{"branch":"master","mediaFolder":"static/media"}} response: {"error":"Unknown error"}

dev6rodn commented 2 years ago

I'm encountering the same error with a much simpler configuration. Wondering if this is issue is on anyone's radar?

erezrokah commented 2 years ago

Hi @dev6rodn, no one is actively working on it.

You can probably get more information by running LOG_LEVEL=debug npx netlify-cms-proxy-server.

If you'd like to look into it, see our contributing guide.

The error is probably being caught here: https://github.com/netlify/netlify-cms/blob/bc59b51a30c6e6953343acc0413de288889a4384/packages/netlify-cms-proxy-server/src/middlewares/localFs/index.ts#L138

eddsalkield commented 2 years ago

Disabling publish_mode as in this suggestion resolved the issue for me.

airtonix commented 1 year ago

Disabling publish_mode as in this suggestion resolved the issue for me.

This didn't work, I did some git bisect'ish work and discovered that my guy had been uploading 30mb images (lol).

Removing a number of these suddenly made the error go away.

interesting to note: The error only occured when trying to view the CmsCollectionFile types of collections.