{"record":{"id":"3a90c799ff7be556","repo":"apache/superset","slug":"invalid-parameters-error","errorCode":"INVALID_PARAMETERS_ERROR","errorMessage":"{errors}","messagePattern":"\\{errors\\}","errorType":"exception","errorClass":"InvalidParametersError","httpStatus":422,"severity":"error","filePath":"superset/databases/api.py","lineNumber":2069,"sourceCode":"              $ref: '#/components/responses/400'\n            422:\n              $ref: '#/components/responses/422'\n            500:\n              $ref: '#/components/responses/500'\n        \"\"\"\n        try:\n            payload = DatabaseValidateParametersSchema().load(request.json)\n        except ValidationError as ex:\n            errors = [\n                SupersetError(\n                    message=\"\\n\".join(messages),\n                    error_type=SupersetErrorType.INVALID_PAYLOAD_SCHEMA_ERROR,\n                    level=ErrorLevel.ERROR,\n                    extra={\"invalid\": [attribute]},\n                )\n                for attribute, messages in ex.messages.items()\n            ]\n            raise InvalidParametersError(errors) from ex\n\n        command = ValidateDatabaseParametersCommand(payload)\n        command.run()\n        return self.response(200, message=\"OK\")\n\n    @expose(\"/<int:pk>/schemas_access_for_file_upload/\")\n    @protect()\n    @safe\n    @statsd_metrics\n    @event_logger.log_this_with_context(\n        action=lambda self, *args, **kwargs: (\n            f\"{self.__class__.__name__}.schemas_access_for_file_upload\"\n        ),\n        log_to_statsd=False,\n    )\n    def schemas_access_for_file_upload(self, pk: int) -> Response:\n        \"\"\"The list of the database schemas where to upload information.\n        ---","sourceCodeStart":2051,"sourceCodeEnd":2087,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/databases/api.py#L2051-L2087","documentation":"Raised by POST /api/v1/database/validate_parameters/ when DatabaseValidateParametersSchema().load(request.json) fails. Each invalid attribute is converted into a SupersetError joining its marshmallow messages, and the list is wrapped in InvalidParametersError (INVALID_PARAMETERS_ERROR). Typical failures: missing required driver fields or wrong types for the engine's parameters schema.","triggerScenarios":"Calling validate_parameters with a payload missing required keys (e.g. no database name for engines that require it), wrong value types, or unknown parameter names not defined for the selected engine.","commonSituations":"Connection forms that skip conditional required fields; switching engine type without resetting the form; payloads hand-built against an outdated parameters schema for the engine spec.","solutions":["Read errors[].message and extra.invalid in the response — they name each failing attribute and why.","Fetch the required parameters for the engine (GET /api/v1/database/form_extra) and build the payload to match.","Ensure conditional fields required by the chosen engine (e.g. certain auth fields) are present and correctly typed."],"exampleFix":"// before\n{\"engine\": \"postgresql\", \"parameters\": {\"host\": \"db\", \"port\": 5432}}  // missing database/name\n\n// after\n{\"engine\": \"postgresql\", \"parameters\": {\"host\": \"db\", \"port\": 5432, \"database\": \"analytics\", \"username\": \"u\"}}","handlingStrategy":"validation","validationCode":"from superset.databases.schemas import DatabaseValidateParametersSchema\nerrors = DatabaseValidateParametersSchema().validate(payload)\nif errors:\n    raise ValueError(f\"parameter problems: {errors}\")","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/api/v1/database/validate_parameters/\", json=payload)\nif resp.status_code == 422:\n    for e in resp.json()[\"errors\"]:\n        print(e[\"extra\"][\"invalid\"], e[\"message\"])\n    # fix each named attribute, then retry","preventionTips":["Fetch the engine's parameter form (form_extra endpoint) and build payloads from it.","Reset conditional fields when the user switches engine type in the connection form."],"tags":["validation","database","connection-parameters","api"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}