{"record":{"id":"f3711ade9c5d5cb5","repo":"SigNoz/signoz","slug":"errcodeinvalidinput-f3711a","errorCode":"ErrCodeInvalidInput","errorMessage":"request must use either old fields (account_id, cloud_account_id) or new fields (cloudIntegrationId, providerAccountId), not both","messagePattern":"request must use either old fields \\(account_id, cloud_account_id\\) or new fields \\(cloudIntegrationId, providerAccountId\\), not both","errorType":"validation","errorClass":"errors SigNozError","httpStatus":400,"severity":"error","filePath":"pkg/types/cloudintegrationtypes/checkin.go","lineNumber":98,"sourceCode":"\t\tIntegrationConfig:  integrationConfig,\n\t\tRemovedAt:          removedAt,\n\t}\n}\n\nfunc (postable *PostableAgentCheckIn) UnmarshalJSON(data []byte) error {\n\ttype Alias PostableAgentCheckIn\n\n\tvar temp Alias\n\terr := json.Unmarshal(data, &temp)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\thasOldFields := temp.ID != \"\" || temp.AccountID != \"\"\n\thasNewFields := !temp.CloudIntegrationID.IsZero() || temp.ProviderAccountID != \"\"\n\n\tif hasOldFields && hasNewFields {\n\t\treturn errors.New(errors.TypeInvalidInput, ErrCodeInvalidInput,\n\t\t\t\"request must use either old fields (account_id, cloud_account_id) or new fields (cloudIntegrationId, providerAccountId), not both\")\n\t}\n\tif !hasOldFields && !hasNewFields {\n\t\treturn errors.New(errors.TypeInvalidInput, ErrCodeInvalidInput,\n\t\t\t\"request must provide either old fields (account_id, cloud_account_id) or new fields (cloudIntegrationId, providerAccountId)\")\n\t}\n\n\t*postable = PostableAgentCheckIn(temp)\n\treturn nil\n}\n","sourceCodeStart":80,"sourceCodeEnd":109,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/types/cloudintegrationtypes/checkin.go#L80-L109","documentation":"PostableAgentCheckIn.UnmarshalJSON rejects payloads that mix legacy identification fields (account_id / cloud_account_id mapped to temp.ID/AccountID) with the new fields (cloudIntegrationId, providerAccountId). Exactly one field set must be used.","triggerScenarios":"An agent check-in request body containing both account_id and cloudIntegrationId (or providerAccountId) — typically after an agent was upgraded mid-configuration or a config file has leftover legacy keys.","commonSituations":"Agent version mismatch where new config format appends cloudIntegrationId while the old account_id remains; manual config edits; migration scripts that add new keys without removing old ones.","solutions":["Remove the legacy account_id/cloud_account_id keys from the check-in payload/config","Or remove cloudIntegrationId/providerAccountId if you must stay on the legacy scheme","Upgrade/downgrade agents uniformly so all report the same field set","Add a config lint that fails when both field sets are present"],"exampleFix":"// before\n{\"account_id\":\"12345\",\"cloudIntegrationId\":\"01H...\",\"providerAccountId\":\"aws-1\"}\n// after\n{\"cloudIntegrationId\":\"01H...\",\"providerAccountId\":\"aws-1\"}\n","handlingStrategy":"validation","validationCode":"const hasOld = !!(body.account_id || body.cloud_account_id);\nconst hasNew = !!(body.cloudIntegrationId || body.providerAccountId);\nif (hasOld && hasNew) throw new Error('pick one field set');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin agent version to one config schema","Add config lint rejecting mixed field sets"],"tags":["agent","checkin","config-migration","validation","go"],"backgroundTag":"conflicting-request-fields","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}