{"record":{"id":"771ec6a017645460","repo":"apache/superset","slug":"field-cannot-be-decoded-by-json-msg-s","errorCode":null,"errorMessage":"Field cannot be decoded by JSON. %(msg)s","messagePattern":"Field cannot be decoded by JSON\\. (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":422,"severity":"error","filePath":"superset/databases/schemas.py","lineNumber":250,"sourceCode":"    Validate the server certificate\n    \"\"\"\n    if value:\n        try:\n            parse_ssl_cert(value)\n        except CertificateException as ex:\n            raise ValidationError([_(\"Invalid certificate\")]) from ex\n    return value\n\n\ndef encrypted_extra_validator(value: str | None) -> None:\n    \"\"\"\n    Validate that encrypted extra is a valid JSON string\n    \"\"\"\n    if value:\n        try:\n            json.loads(value)\n        except json.JSONDecodeError as ex:\n            raise ValidationError(\n                [_(\"Field cannot be decoded by JSON. %(msg)s\", msg=str(ex))]\n            ) from ex\n\n\ndef masked_encrypted_extra_validator(value: str) -> None:\n    \"\"\"\n    Validate that `masked_encrypted_extra` is a valid non-empty JSON string\n    \"\"\"\n    if value == \"{}\":\n        raise ValidationError([_(\"Field cannot be empty.\")])\n    encrypted_extra_validator(value)\n\n\ndef extra_validator(value: str) -> str:\n    \"\"\"\n    Validate that extra is a valid JSON string, and that metadata_params\n    keys are on the call signature for SQLAlchemy Metadata\n    \"\"\"","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/databases/schemas.py#L232-L268","documentation":"Error \"Field cannot be decoded by JSON. %(msg)s\" thrown in apache/superset.","triggerScenarios":"A database connection parameter field contains text that is not valid JSON.","commonSituations":"Submitting a database config field (e.g., encrypted_extra) whose value is not valid JSON.","solutions":["Provide valid JSON in the extra/encrypted_extra field, or clear the field.","Escape quotes and special characters correctly in the JSON payload."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}