{"record":{"id":"92c3204ca6044849","repo":"bitwarden/server","slug":"resource-not-found-92c320","errorCode":null,"errorMessage":"Resource not found.","messagePattern":"Resource not found\\.","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs","lineNumber":83,"sourceCode":"        }\n\n        switch (model.Type)\n        {\n            case OrganizationConnectionType.CloudBillingSync:\n                return await CreateOrUpdateOrganizationConnectionAsync<BillingSyncConfig>(null, model, ValidateBillingSyncConfig);\n            case OrganizationConnectionType.Scim:\n                return await CreateOrUpdateOrganizationConnectionAsync<ScimConfig>(null, model);\n            default:\n                throw new BadRequestException($\"Unknown Organization connection Type: {model.Type}\");\n        }\n    }\n\n    [HttpPut(\"{organizationConnectionId}\")]\n    public async Task<OrganizationConnectionResponseModel> UpdateConnection(Guid organizationConnectionId, [FromBody] OrganizationConnectionRequestModel model)\n    {\n        if (model == null)\n        {\n            throw new NotFoundException();\n        }\n\n        var existingOrganizationConnection = await _organizationConnectionRepository.GetByIdOrganizationIdAsync(organizationConnectionId, model.OrganizationId);\n        if (existingOrganizationConnection == null)\n        {\n            throw new NotFoundException();\n        }\n\n        if (!await HasPermissionAsync(existingOrganizationConnection.OrganizationId, existingOrganizationConnection.Type))\n        {\n            throw new BadRequestException(\"You do not have permission to update this connection.\");\n        }\n\n        if (model.Type != existingOrganizationConnection.Type)\n        {\n            throw new BadRequestException(\"The connection type cannot be changed.\");\n        }\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/AdminConsole/Controllers/OrganizationConnectionsController.cs#L65-L101","documentation":"Thrown as NotFoundException by UpdateConnection (PUT /organizations/connections/{id}) when the request body model is null — i.e., the client sent an empty body or one that failed to bind to OrganizationConnectionRequestModel. The controller intentionally returns 404 (not 400) for a missing body, which is a deliberate choice to avoid leaking information about route validity. Maps to HTTP 404.","triggerScenarios":"PUT /organizations/connections/{organizationConnectionId} with an empty request body, a Content-Type that prevents model binding (e.g., missing application/json), or a malformed JSON payload that the binder rejects as null.","commonSituations":"A client sending PUT with no body; a proxy stripping the body; a Content-Type header set to text/plain or omitted so the JSON binder never runs; a serialization bug on the client that emits an empty stream.","solutions":["Send a well-formed OrganizationConnectionRequestModel JSON object in the PUT body.","Set the Content-Type header to application/json (and ensure the body is not empty).","Verify the client serializer actually wrote the object and the stream was not disposed early.","Add an integration assertion that the request body is non-empty before sending."],"exampleFix":"// before\nawait client.PutAsync($\"organizations/connections/{id}\", null);\n// after\nvar json = new StringContent(JsonSerializer.Serialize(model), Encoding.UTF8, \"application/json\");\nawait client.PutAsync($\"organizations/connections/{id}\", json);","handlingStrategy":"validation","validationCode":"if (model == null) throw new ArgumentNullException(nameof(model));\nvar json = JsonSerializer.Serialize(model);\nif (string.IsNullOrWhiteSpace(json) || json == \"null\")\n    throw new InvalidOperationException(\"Request body must be a non-null OrganizationConnectionRequestModel.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set Content-Type: application/json on PUT bodies.","Serialize the model and assert the body is non-empty before sending.","Do not call PUT with a null/empty body — the server returns 404, not 400."],"tags":["request-binding","organization-connections","http-400","http-404"],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}