{"record":{"id":"a0e51df2333b8c04","repo":"plandex-ai/plandex","slug":"error-reading-request-body-a0e51d","errorCode":null,"errorMessage":"Error reading request body: ","messagePattern":"Error reading request body: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/orgs.go","lineNumber":76,"sourceCode":"\tif os.Getenv(\"IS_CLOUD\") != \"\" {\n\t\twriteApiError(w, shared.ApiError{\n\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\tStatus: http.StatusForbidden,\n\t\t\tMsg:    \"Plandex Cloud orgs can only be created by starting a trial\",\n\t\t})\n\t\treturn\n\t}\n\n\tauth := Authenticate(w, r, false)\n\tif auth == nil {\n\t\treturn\n\t}\n\n\t// read the request body\n\tbody, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\tlog.Printf(\"Error reading request body: %v\\n\", err)\n\t\thttp.Error(w, \"Error reading request body: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar req shared.CreateOrgRequest\n\terr = json.Unmarshal(body, &req)\n\tif err != nil {\n\t\tlog.Printf(\"Error unmarshalling request: %v\\n\", err)\n\t\thttp.Error(w, \"Error unmarshalling request: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar apiErr *shared.ApiError\n\tvar org *db.Org\n\terr = db.WithTx(r.Context(), \"create org\", func(tx *sqlx.Tx) error {\n\t\tvar err error\n\t\tvar domain *string\n\t\tif req.AutoAddDomainUsers {\n\t\t\tif shared.IsEmailServiceDomain(auth.User.Domain) {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/orgs.go#L58-L94","documentation":"CreateOrgHandler: io.ReadAll(r.Body) fails while reading the create-org request payload, producing a 500. Client disconnected mid-body or a body size/transport error — the request bytes never arrived complete.","triggerScenarios":"Thrown at app/server/handlers/orgs.go:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request from the client","Check for client disconnects or proxies truncating bodies","Ensure the client sends a correct Content-Length"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}