{"record":{"id":"df856460fb14a9ff","repo":"apache/seatunnel","slug":"received-empty-or-null-config-from-metadataprovide","errorCode":null,"errorMessage":"Received empty or null config from MetadataProvider for metadata_datasource_id: {}","messagePattern":"Received empty or null config from MetadataProvider for metadata_datasource_id: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/MetadataProviderManager.java","lineNumber":206,"sourceCode":"            return connectorConfig;\n        }\n\n        String datasourceId = datasourceIdOptional.get();\n        String connectorIdentifier = getConnectorIdentifier(connectorConfig);\n\n        log.info(\n                \"Resolving datasource config for connector: {}, metadata_datasource_id: {}, provider: {}\",\n                connectorIdentifier,\n                datasourceId,\n                providerKind);\n\n        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    }","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/MetadataProviderManager.java#L188-L224","documentation":"MetadataProviderManager.resolveConnectorConfig fetches a datasource's connection config from the configured MetadataProvider and merges it into the connector config. If the provider returns null or an empty map for the given metadata_datasource_id, the merge is skipped with this warning and the original connectorConfig is returned unchanged.","triggerScenarios":"Calling resolveConnectorConfig with a connector config containing a metadata_datasource_id that the metadata service has no (or an empty) datasource record for.","commonSituations":"Typo or stale datasource id in the job config; the datasource was deleted from the metadata service; metadata service permissions hide the datasource; metadata service returns empty on failure instead of erroring.","solutions":["Verify metadata_datasource_id in the job config matches an existing datasource in the metadata service.","Check the metadata service UI/API to confirm the datasource exists and has connection settings filled in.","Check permissions/authentication of the metadata service account used by the provider.","If intentional fallback to inline config is desired, ignore the warning; otherwise populate the datasource record."],"exampleFix":"// before (job config)\nmetadata_datasource_id = \"12345\" // missing in metadata service\n// after\nmetadata_datasource_id = \"1001\" // existing datasource id\n// or remove the key and supply inline connection config:\nurl = \"jdbc:mysql://localhost:3306/db\"","handlingStrategy":"validation","validationCode":"// confirm datasource exists before job submit\nMap<String,Object> ds = metadataService.getDatasource(datasourceId);\nif (ds == null || ds.isEmpty()) throw new IllegalArgumentException(\"unknown metadata_datasource_id: \" + datasourceId);","typeGuard":"if (datasourceConfig == null || datasourceConfig.isEmpty()) { /* fallback to inline config */ }","tryCatchPattern":"// merge is skipped gracefully; validate ids pre-submit instead of catching","preventionTips":["Validate datasource ids against the metadata service during config linting","Keep datasource records in sync with job configs","Use stable, documented ids rather than ad-hoc numbers","Add a pre-submit config check that all referenced metadata datasources exist"],"tags":["metadata-provider","configuration","empty-result"],"backgroundTag":"empty-result-set","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"}