{"record":{"id":"9d1092a759ee9eae","repo":"chenhg5/cc-connect","slug":"cloud-web-register-rejected","errorCode":null,"errorMessage":"cloud_web: register rejected","messagePattern":"cloud_web: register rejected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/cloud-web/protocol.go","lineNumber":206,"sourceCode":"\t\tMetadata: map[string]any{\n\t\t\t\"protocol_version\": protocolVersion,\n\t\t},\n\t}\n}\n\nfunc parseRegisterAck(raw []byte) (map[string]bool, error) {\n\tvar ack wireRegisterAck\n\tif err := json.Unmarshal(raw, &ack); err != nil {\n\t\treturn nil, fmt.Errorf(\"cloud_web: parse register_ack: %w\", err)\n\t}\n\tif ack.Type != \"register_ack\" {\n\t\treturn nil, fmt.Errorf(\"cloud_web: expected register_ack, got %q\", ack.Type)\n\t}\n\tif !ack.OK {\n\t\tif ack.Error != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cloud_web: register rejected: %s\", ack.Error)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"cloud_web: register rejected\")\n\t}\n\tif len(ack.Capabilities) == 0 {\n\t\treturn defaultCapabilities(), nil\n\t}\n\treturn capabilitySet(ack.Capabilities), nil\n}\n\nfunc decodeImages(items []wireImage) []core.ImageAttachment {\n\tvar out []core.ImageAttachment\n\tfor _, img := range items {\n\t\tdata, err := base64.StdEncoding.DecodeString(img.Data)\n\t\tif err != nil {\n\t\t\tslog.Debug(\"cloud_web: invalid image base64\", \"error\", err)\n\t\t\tcontinue\n\t\t}\n\t\tout = append(out, core.ImageAttachment{\n\t\t\tMimeType: img.MimeType,\n\t\t\tData:     data,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/cloud-web/protocol.go#L188-L224","documentation":"Same rejection path as 1012 but the server sent ok=false with an empty Error field, so no remote reason is available. parseRegisterAck returns this generic 'register rejected' error and closes the connection. It means the cloud-web hub refused registration without explaining why.","triggerScenarios":"Server responds {\"type\":\"register_ack\",\"ok\":false} with no error text — rejection with no diagnostic detail.","commonSituations":"Older server versions that don't populate the error field; server policy refusal (banned client, invalid token) that doesn't disclose reasons; auth middleware rejecting at hub level without a message.","solutions":["Check the cloud-web server logs for the rejection reason at the time of connection","Regenerate/refresh the auth token in config","Confirm the client's agent id is registered/allowed on the hub","Upgrade server so register_ack rejections include an error message for diagnosability"],"exampleFix":"// before (server)\nack{Type:\"register_ack\", OK:false}\n// after (server, include reason)\nack{Type:\"register_ack\", OK:false, Error:\"invalid token for agent \" + agentID}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// No reason available: fall back to server logs and capped retries\nif err := register(ctx); err != nil {\n    if strings.Contains(err.Error(), \"cloud_web: register rejected\") {\n        slog.Error(\"cloud-web rejected registration without reason; check server logs\")\n        return backoff.AndRetry(ctx, register, maxAttempts)\n    }\n}","preventionTips":["Upgrade the server so rejections always include an error message","Cross-check server logs whenever you see the reason-less variant","Validate tokens and client ids against the hub before deployment","Monitor registration failure rates to catch policy changes"],"tags":["websocket","authentication","registration","cloud-web"],"backgroundTag":"api-error-response","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}