Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JWesorick opened this issue Jun 6, 2021 · 4 comments
Open
Labels
area: local-proxy type: bug code to address defects in shipped code

Comments

@JWesorick
Copy link

JWesorick commented Jun 6, 2021

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:

  • Netlify CMS version: [e.g. 2.0.4] netlify-cms-app@2.15.17
  • Git provider: [e.g. GitHub, BitBucket] GitHub
  • OS: [e.g. Windows 7] MacOS (M1)
  • Browser version [e.g. chrome 22, safari 11] Chrome 91.0.4472.77, Firefox 89.0
  • Node.JS version: 14.3.0
  • NPM: 7.10.0
  • Gatsby: 3.6.2

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"}

@JWesorick JWesorick added the type: bug code to address defects in shipped code label Jun 6, 2021
@dev6rodn
Copy link
Contributor

dev6rodn commented Oct 7, 2021

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

@erezrokah
Copy link
Contributor

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
Copy link

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

@airtonix
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: local-proxy type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

5 participants