Mintplex-Labs/anything-llm · error

You are missing required metadata key:value pairs in your re

Error message

You are missing required metadata key:value pairs in your request. Required metadata key:values are ${requiredMetadata.map((v) => `'${v}'`).join(", ")}

What it means

Validation guard in the raw-text embed API: the request's metadata object is missing one or more required keys (at minimum 'title') or has them empty, so the endpoint responds 422 enumerating exactly which key:value pairs must be supplied.

Source

Thrown at server/endpoints/api/document/index.js:542

        if (!processingOnline) {
          return response
            .status(500)
            .json({
              success: false,
              error: `Document processing API is not online. Request will not be processed.`,
            })
            .end();
        }

        if (
          !requiredMetadata.every(
            (reqKey) =>
              Object.keys(metadata).includes(reqKey) && !!metadata[reqKey]
          )
        ) {
          return response
            .status(422)
            .json({
              success: false,
              error: `You are missing required metadata key:value pairs in your request. Required metadata key:values are ${requiredMetadata
                .map((v) => `'${v}'`)
                .join(", ")}`,
            })
            .end();
        }

        if (!textContent || textContent?.length === 0) {
          return response
            .status(422)
            .json({
              success: false,
              error: `The 'textContent' key cannot have an empty value.`,
            })
            .end();
        }

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Include all required metadata key:value pairs listed in the error in the request body.
  2. Check the workspace/document schema for the required metadata keys.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/endpoints/api/document/index.js:542 when the library encounters an invalid state.

Common situations: Submitting a document via the API without one or more metadata keys that the workspace configuration requires.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/9895063cebd6529b. Report an issue: GitHub.