{"record":{"id":"62a86f10b9918846","repo":"SigNoz/signoz","slug":"ingestion-key-creation-response-not-as-expected","errorCode":null,"errorMessage":"ingestion key creation response not as expected","messagePattern":"ingestion key creation response not as expected","errorType":"http","errorClass":"basemodel.ApiError","httpStatus":500,"severity":"error","filePath":"ee/query-service/app/api/cloudIntegrations.go","lineNumber":280,"sourceCode":"\t\t},\n\t)\n\tif apiErr != nil {\n\t\treturn \"\", basemodel.WrapApiError(\n\t\t\tapiErr, \"couldn't create cloudprovider ingestion key\",\n\t\t)\n\t}\n\n\tif createKeyResult.Status != \"success\" {\n\t\treturn \"\", basemodel.InternalError(fmt.Errorf(\n\t\t\t\"couldn't create cloudprovider ingestion key: status: %s, error: %s\",\n\t\t\tcreateKeyResult.Status, createKeyResult.Error,\n\t\t))\n\t}\n\n\tingestionKey := createKeyResult.Data.Value\n\tif len(ingestionKey) < 1 {\n\t\t// Fail early if actual response structure and expectation here ever diverge\n\t\treturn \"\", basemodel.InternalError(fmt.Errorf(\n\t\t\t\"ingestion key creation response not as expected\",\n\t\t))\n\t}\n\n\treturn ingestionKey, nil\n}\n\nfunc requestGateway[ResponseType any](\n\tctx context.Context, gatewayUrl string, licenseKey string, path string, payload any,\n) (*ResponseType, *basemodel.ApiError) {\n\n\tbaseUrl := strings.TrimSuffix(gatewayUrl, \"/\")\n\treqUrl := fmt.Sprintf(\"%s%s\", baseUrl, path)\n\n\theaders := map[string]string{\n\t\t\"X-Signoz-Cloud-Api-Key\": licenseKey,\n\t\t\"X-Consumer-Username\":    \"lid:00000000-0000-0000-0000-000000000000\",\n\t\t\"X-Consumer-Groups\":      \"ns:default\",","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/query-service/app/api/cloudIntegrations.go#L262-L298","documentation":"Key creation reported success but the returned data.value is empty. This fail-early guard prevents returning connection params with a useless empty ingestion key.","triggerScenarios":"createKeyResult.Status == \"success\" yet createKeyResult.Data.Value is empty — response shape drift or a gateway bug returning success without a key.","commonSituations":"Upstream API change moving the value field, or an eventual-consistency window where the created key is not yet readable.","solutions":["Log the full creation response to locate the actual key field","Retry the flow; the subsequent search path may then find the key with its value","Report the response-shape change if the value genuinely moved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Retry the full get-or-create flow once; if the value stays empty, alert on schema drift.","preventionTips":["Validate gateway responses in integration tests","Log full create responses when guards trip"],"tags":["schema-validation","ingestion-key","cloud-integrations"],"backgroundTag":"schema-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}