{"record":{"id":"ff8a031d3220119e","repo":"apache/seatunnel","slug":"failed-to-resolve-datasource-config-for-connector","errorCode":null,"errorMessage":"Failed to resolve datasource config for connector: %s, metadata_datasource_id: %s, provider: %s","messagePattern":"Failed to resolve datasource config for connector: (.+?), metadata_datasource_id: (.+?), provider: (.+?)","errorType":"exception","errorClass":"org.apache.seatunnel.api.metadata.MetadataProviderException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/MetadataProviderManager.java","lineNumber":218,"sourceCode":"        try {\n            // Fetch connection config from metadata service via provider\n            Map<String, Object> datasourceConfig =\n                    provider.datasourceMap(connectorIdentifier, datasourceId);\n\n            if (datasourceConfig == null || datasourceConfig.isEmpty()) {\n                log.warn(\n                        \"Received empty or null config from MetadataProvider for metadata_datasource_id: {}\",\n                        datasourceId);\n                return connectorConfig;\n            }\n\n            // Merge the fetched config into the original config\n            return mergeConfig(connectorConfig, datasourceConfig, datasourceId);\n\n        } catch (MetadataProviderException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new MetadataProviderException(\n                    String.format(\n                            \"Failed to resolve datasource config for connector: %s, metadata_datasource_id: %s, provider: %s\",\n                            connectorIdentifier, datasourceId, providerKind),\n                    e);\n        }\n    }\n\n    /**\n     * Gets the metadata_datasource_id from a connector config.\n     *\n     * <p>This method first checks at the root level, then looks inside the nested connector config.\n     *\n     * @param config the connector configuration\n     * @return Optional containing the metadata_datasource_id if present, empty otherwise\n     */\n    private static Optional<String> getDatasourceId(Config config) {\n        try {\n            // First check at root level (for configs like { Jdbc: {...}, metadata_datasource_id:","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/MetadataProviderManager.java#L200-L236","documentation":"MetadataProviderManager.resolveConnectorConfig caught a failure while asking the metadata provider (e.g. Gravitino) for the datasource connection config of a connector: either provider.datasourceMap(...) threw, or the returned map could not be merged. The message records the connector identifier, the metadata_datasource_id from the job config, and the provider kind, identifying exactly which datasource lookup failed.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/MetadataProviderManager.java:218 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the metadata_datasource_id exists and is accessible in the metadata service (e.g. Gravitino metalake)","Check that the provider kind configured for the datasource is loaded and its connection settings (uri, metalake) are valid","Inspect the logged cause chain for the underlying provider exception and fix that (network, auth, missing metalake)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}