{"record":{"id":"a8192068983dd7f6","repo":"SigNoz/signoz","slug":"removing-a-selected-field-is-not-allowed-please-r","errorCode":null,"errorMessage":"removing a selected field is not allowed, please reach out to support.","messagePattern":"removing a selected field is not allowed, please reach out to support\\.","errorType":"http","errorClass":"model.ApiError","httpStatus":403,"severity":"warning","filePath":"pkg/query-service/app/clickhouseReader/reader.go","lineNumber":2691,"sourceCode":"\t\tif overrideFieldType != \"\" {\n\t\t\tfield.Type = overrideFieldType\n\t\t}\n\t\t// all static fields are assumed to be selected as we don't allow changing them\n\t\tif isColumn(tableStatement, field.Type, field.Name, field.DataType) {\n\t\t\tresponse.Selected = append(response.Selected, field)\n\t\t} else {\n\t\t\tresponse.Interesting = append(response.Interesting, field)\n\t\t}\n\t}\n}\n\nfunc (r *ClickHouseReader) UpdateLogField(ctx context.Context, field *model.UpdateField) *model.ApiError {\n\tctx = ctxtypes.NewContextWithCommentVals(ctx, map[string]string{\n\t\tinstrumentationtypes.CodeNamespace:    \"clickhouse-reader\",\n\t\tinstrumentationtypes.CodeFunctionName: \"UpdateLogField\",\n\t})\n\tif !field.Selected {\n\t\treturn model.ForbiddenError(errors.New(\"removing a selected field is not allowed, please reach out to support.\"))\n\t}\n\n\tcolname := utils.GetClickhouseColumnNameV2(field.Type, field.DataType, field.Name)\n\n\tfield.DataType = strings.ToLower(field.DataType)\n\tdataType := constants.MaterializedDataTypeMap[field.DataType]\n\tchDataType := constants.ChDataTypeMap[field.DataType]\n\n\tattrColName := fmt.Sprintf(\"%s_%s\", field.Type, dataType)\n\tfor _, table := range []string{r.logsLocalTableV2, r.logsTableV2} {\n\t\tq := \"ALTER TABLE %s.%s ON CLUSTER %s ADD COLUMN IF NOT EXISTS `%s` %s DEFAULT %s['%s'] CODEC(ZSTD(1))\"\n\t\tquery := fmt.Sprintf(q,\n\t\t\tr.logsDB, table,\n\t\t\tr.cluster,\n\t\t\tcolname, chDataType,\n\t\t\tattrColName,\n\t\t\tfield.Name,\n\t\t)","sourceCodeStart":2673,"sourceCodeEnd":2709,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/clickhouseReader/reader.go#L2673-L2709","documentation":"UpdateLogField refuses requests where field.Selected is false — once a log field column has been materialized/selected in ClickHouse, unselecting it via the API is not allowed and requires support intervention.","triggerScenarios":"PUT/PATCH to the update-log-field endpoint with {\"selected\": false} in the body.","commonSituations":"Users trying to reduce cardinally materialized columns from the UI; cleanup attempts after accidentally selecting too many fields.","solutions":["Reach out to support to unselect/materialize-column removal for log fields","Instead of unselecting, adjust which fields you select going forward and stop adding new ones","Review selected fields carefully before enabling them, since the operation is effectively irreversible via API"],"exampleFix":"// before\n{\"type\":\"log\",\"name\":\"user.id\",\"dataType\":\"string\",\"selected\":false}\n// after\n// (no API fix — contact support; avoid unselecting already-selected fields)","handlingStrategy":"type-guard","validationCode":"if !field.Selected && wasPreviouslySelected(field) {\n    return errors.New(\"unsupported\", \"unselecting selected fields requires support\")\n}","typeGuard":"func isUnselectRequest(f *model.UpdateField) bool { return f != nil && !f.Selected }","tryCatchPattern":"if apiErr := updateLogField(ctx, field); apiErr != nil && apiErr.IsForbidden() {\n    // surface 'contact support' message\n}","preventionTips":["Treat field selection as irreversible; review before enabling","Track materialized fields in IaC so accidental selections are caught in review"],"tags":["clickhouse","logs","schema","forbidden-operation","query-service"],"backgroundTag":"irreversible-operation-blocked","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}