这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG]: 500 error when malformed .json file exists in documents folder #3846

@XBZD-WDD

Description

@XBZD-WDD

How are you running AnythingLLM?

Docker (local)

What happened?

Bug Description

When there's a .json file in a document subfolder that is malformed or incomplete (e.g. empty, partially written), the API /api/system/local-files crashes with a 500 Internal Server Error.

This only happens after recent updates (within the last 2-3 days). Previously the same documents would load fine.

How to Reproduce

  1. Add a .json file with invalid content (e.g. empty, {})
  2. Start the server
  3. Call /api/system/local-files
  4. Response is 500, and logs show:

Are there known steps to reproduce?

Why this is critical

One broken file causes the entire API to fail, making the UI unable to load any document folders.

Suggested Fix

Wrap the fileToPickerData(...) in a .catch() block or add a try/catch in viewLocalFiles() to ensure broken files don’t crash the whole interface.

System Info

  • Container: mintplexlabs/anythingllm:latest
  • Reproducible: Yes
  • Workaround: Manually remove problematic .json files

Metadata

Metadata

Labels

bugSomething isn't workingneeds info / can't replicateIssues that require additional information and/or cannot currently be replicated, but possible bugpossible bugBug was reported but is not confirmed or is unable to be replicated.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions