{"record":{"id":"e67d5fc48270ca87","repo":"SigNoz/signoz","slug":"ingestion-keys-search-response-not-as-expected","errorCode":null,"errorMessage":"ingestion keys search response not as expected","messagePattern":"ingestion keys search response not as expected","errorType":"http","errorClass":"basemodel.ApiError","httpStatus":500,"severity":"error","filePath":"ee/query-service/app/api/cloudIntegrations.go","lineNumber":245,"sourceCode":"\n\tif apiErr != nil {\n\t\treturn \"\", basemodel.WrapApiError(\n\t\t\tapiErr, \"couldn't search for cloudprovider ingestion key\",\n\t\t)\n\t}\n\n\tif searchResult.Status != \"success\" {\n\t\treturn \"\", basemodel.InternalError(fmt.Errorf(\n\t\t\t\"couldn't search for cloudprovider ingestion key: status: %s, error: %s\",\n\t\t\tsearchResult.Status, searchResult.Error,\n\t\t))\n\t}\n\n\tfor _, k := range searchResult.Data {\n\t\tif k.Name == cloudProviderKeyName {\n\t\t\tif len(k.Value) < 1 {\n\t\t\t\t// Fail early if actual response structure and expectation here ever diverge\n\t\t\t\treturn \"\", basemodel.InternalError(fmt.Errorf(\n\t\t\t\t\t\"ingestion keys search response not as expected\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\treturn k.Value, nil\n\t\t}\n\t}\n\n\tslog.InfoContext(ctx, \"no existing ingestion key found for cloud integration, creating a new one\",\n\t\t\"cloud_provider\", cloudProvider,\n\t)\n\tcreateKeyResult, apiErr := requestGateway[createIngestionKeyResponse](\n\t\tctx, gatewayUrl, licenseKey, \"/v1/workspaces/me/keys\",\n\t\tmap[string]any{\n\t\t\t\"name\": cloudProviderKeyName,\n\t\t\t\"tags\": []string{\"integration\", cloudProvider},\n\t\t},\n\t)","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/query-service/app/api/cloudIntegrations.go#L227-L263","documentation":"An ingestion key with the expected cloudProviderKeyName was found in the search results, but its Value field is empty. This guard fails early because an empty key cannot be used for connection params.","triggerScenarios":"The gateway search succeeds and returns a key entry named as expected but with an empty value — e.g. a key created but not yet materialized, or a response shape change dropping the value field.","commonSituations":"Eventual consistency on the gateway side right after key creation, partial key records, or upstream schema drift.","solutions":["Retry after a short delay to allow the key value to propagate","Inspect the raw search response to confirm the value field path is unchanged","Delete and recreate the malformed key via the gateway if it is permanently empty","Report schema drift if the field moved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"On empty-value errors, retry after a delay; if persistent, treat as schema drift and alert.","preventionTips":["Prefer the create path if search returns unusable keys","Monitor for keys with empty values"],"tags":["schema-validation","ingestion-key","cloud-integrations","gateway"],"backgroundTag":"schema-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}