{"record":{"id":"70e491c3dc3a3fdf","repo":"apache/superset","slug":"chart-parameters-are-invalid-70e491","errorCode":null,"errorMessage":"Chart parameters are invalid.","messagePattern":"Chart parameters are invalid\\.","errorType":"validation","errorClass":"ChartInvalidError","httpStatus":422,"severity":"error","filePath":"superset/commands/chart/update.py","lineNumber":230,"sourceCode":"            except ValidationError as ex:\n                exceptions.append(ex)\n\n        # Validate/Populate dashboards only if it's a list\n        if dashboard_ids is not None:\n            # First, verify all requested dashboards exist\n            dashboards = DashboardDAO.find_by_ids(\n                dashboard_ids,\n                skip_base_filter=True,\n            )\n            if len(dashboards) != len(dashboard_ids):\n                exceptions.append(DashboardsNotFoundValidationError())\n            else:\n                # Then, validate user has access to any NEW dashboard relationships\n                self._validate_new_dashboard_access(dashboards, exceptions)\n            self._properties[\"dashboards\"] = dashboards\n\n        if exceptions:\n            raise ChartInvalidError(exceptions=exceptions)\n","sourceCodeStart":212,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/chart/update.py#L212-L231","documentation":"Raised as ChartInvalidError(exceptions=[...]) at the end of UpdateChartCommand.validate() when one or more non-fatal validation errors accumulated: dashboard ids that do not resolve (DashboardsNotFoundValidationError), a missing datasource_type when datasource_id is given, invalid tags, or subject-computation errors. The exception carries the list of specific ValidationErrors to inspect.","triggerScenarios":"PUT /api/v1/chart/{id} with dashboards=[...] containing nonexistent dashboard ids; providing datasource_id without datasource_type; tag_ids referencing tags that fail validate_tags.","commonSituations":"Stale dashboard ids after cleanup; partial payloads copied between environments; tag references to deleted tags.","solutions":["Read the nested exceptions list in the error payload — it names exactly which validations failed.","Fix each item: verify dashboard ids via GET /api/v1/dashboard/, include datasource_type whenever datasource_id is sent, drop invalid tag ids.","Retry the update with only resolvable references."],"exampleFix":"# before\nclient.put('/api/v1/chart/42', json={'datasource_id': 7})  # ChartInvalidError\n\n# after: always pair id with type\nclient.put('/api/v1/chart/42', json={'datasource_id': 7, 'datasource_type': 'table'})","handlingStrategy":"validation","validationCode":"if 'datasource_id' in props and not props.get('datasource_type'):\n    raise ValueError('datasource_type required with datasource_id')\nif 'dashboards' in props:\n    found = DashboardDAO.find_by_ids(props['dashboards'], skip_base_filter=True)\n    if len(found) != len(props['dashboards']):\n        raise ValueError('some dashboard ids do not exist')","typeGuard":null,"tryCatchPattern":"from superset.commands.chart.exceptions import ChartInvalidError\ntry:\n    UpdateChartCommand(chart_id, props).run()\nexcept ChartInvalidError as ex:\n    for ve in ex.exceptions:\n        logger.error('validation failed: %r', ve)  # fix each and retry","preventionTips":["Always send datasource_type alongside datasource_id.","Resolve dashboard/tag ids against live API data before updates.","Log and iterate over the nested validation exceptions."],"tags":["chart","update","validation","api"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}