langgenius/dify · warning · AgentConfigServiceError

no_file

no_file

Error message

no skill file uploaded

What it means

Raised as AgentConfigServiceError (code=no_file, HTTP 400) from _read_single_upload: the multipart form-data contained no field named 'file'. The skill-upload endpoint requires exactly one file attachment under that key; absence is treated as a client error, not a missing resource.

Source

Thrown at api/controllers/console/app/agent_config_inspector.py:462

        config_version_id=target.version_id,
        config_version_kind=target.version_kind,
        user_id=target.account_id,
    )


def _file_list_response(target: _ResolvedConsoleTarget) -> dict[str, object]:
    return _service().list_files(
        tenant_id=target.tenant_id,
        agent_id=target.agent_id,
        config_version_id=target.version_id,
        config_version_kind=target.version_kind,
        user_id=target.account_id,
    )


def _read_single_upload() -> tuple[bytes, str]:
    if "file" not in request.files:
        raise AgentConfigServiceError("no_file", "no skill file uploaded", status_code=400)
    if len(request.files) > 1:
        raise AgentConfigServiceError("too_many_files", "only one skill file is allowed", status_code=400)
    upload = request.files["file"]
    return upload.stream.read(), upload.filename or ""


def _skill_upload_response(target: _ResolvedConsoleTarget) -> tuple[dict[str, object], int]:
    return _upload_skill_for_target(
        tenant_id=target.tenant_id,
        agent_id=target.agent_id,
        user_id=target.account_id,
        version_id=target.version_id,
        version_kind=target.version_kind,
    )


def _upload_skill_for_target(
    *,

View on GitHub (pinned to ef8544b173)

Solutions

  1. Send the file as multipart/form-data under the field name 'file'.
  2. Confirm Content-Type is multipart/form-data;boundary=... and the part name is exactly 'file'.
  3. If the client uses a helper (e.g. FormData), append the file under the key 'file'.
  4. Verify no front proxy/load balancer is dropping the file part.

Example fix

// before
const fd = new FormData(); fd.append('upload', blob);
// after
const fd = new FormData(); fd.append('file', blob);
Defensive patterns

Strategy: validation

Validate before calling

def ensure_single_file_part(request) -> None:
    if 'file' not in request.files:
        raise ValueError('multipart form must include a file part named "file"')

Try / catch

from services.errors.agent_config import AgentConfigServiceError

try:
    resp = client.post(upload_url, files={'file': blob})
except AgentConfigServiceError as exc:
    if exc.code == 'no_file':
        resp = client.post(upload_url, files={'file': blob}, headers={'Content-Type': 'multipart/form-data'})
    raise

Prevention

When it happens

Trigger: POSTing to the agent-config skill upload endpoint with an empty form, a JSON body instead of multipart, or a file under a different field name (e.g. 'upload', 'document', 'skill').

Common situations: Client using the wrong field name; sending JSON instead of multipart/form-data; a frontend upload component that attaches the file under a custom key; proxy that strips the file part.

Related errors


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/fc23f5aa3ee9cafe. Report an issue: GitHub.