apache/superset · error · ValidationError

Field cannot be decoded by JSON. %(msg)s

Error message

Field cannot be decoded by JSON. %(msg)s

What it means

Error "Field cannot be decoded by JSON. %(msg)s" thrown in apache/superset.

Source

Thrown at superset/databases/schemas.py:250

    Validate the server certificate
    """
    if value:
        try:
            parse_ssl_cert(value)
        except CertificateException as ex:
            raise ValidationError([_("Invalid certificate")]) from ex
    return value


def encrypted_extra_validator(value: str | None) -> None:
    """
    Validate that encrypted extra is a valid JSON string
    """
    if value:
        try:
            json.loads(value)
        except json.JSONDecodeError as ex:
            raise ValidationError(
                [_("Field cannot be decoded by JSON. %(msg)s", msg=str(ex))]
            ) from ex


def masked_encrypted_extra_validator(value: str) -> None:
    """
    Validate that `masked_encrypted_extra` is a valid non-empty JSON string
    """
    if value == "{}":
        raise ValidationError([_("Field cannot be empty.")])
    encrypted_extra_validator(value)


def extra_validator(value: str) -> str:
    """
    Validate that extra is a valid JSON string, and that metadata_params
    keys are on the call signature for SQLAlchemy Metadata
    """

View on GitHub (pinned to f4587218dd)

Solutions

  1. Provide valid JSON in the extra/encrypted_extra field, or clear the field.
  2. Escape quotes and special characters correctly in the JSON payload.

When it happens

Trigger: A database connection parameter field contains text that is not valid JSON.

Common situations: Submitting a database config field (e.g., encrypted_extra) whose value is not valid JSON.


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/771ec6a017645460. Report an issue: GitHub.