{"record":{"id":"a67c23c2680d2d8f","repo":"bitwarden/server","slug":"resource-not-found","errorCode":null,"errorMessage":"Resource not found.","messagePattern":"Resource not found\\.","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs","lineNumber":38,"sourceCode":"\n\n    public CreateProjectCommand(\n        IAccessPolicyRepository accessPolicyRepository,\n        IOrganizationUserRepository organizationUserRepository,\n        IProjectRepository projectRepository,\n        ICurrentContext currentContext)\n    {\n        _accessPolicyRepository = accessPolicyRepository;\n        _organizationUserRepository = organizationUserRepository;\n        _projectRepository = projectRepository;\n        _currentContext = currentContext;\n    }\n\n    public async Task<Project> CreateAsync(Project project, Guid id, IdentityClientType identityClientType)\n    {\n        if (identityClientType != IdentityClientType.User && identityClientType != IdentityClientType.ServiceAccount)\n        {\n            throw new NotFoundException();\n        }\n\n        var createdProject = await _projectRepository.CreateAsync(project);\n\n        if (identityClientType == IdentityClientType.User)\n        {\n            var orgUser = await _organizationUserRepository.GetByOrganizationAsync(createdProject.OrganizationId, id);\n\n            var accessPolicy = new UserProjectAccessPolicy()\n            {\n                OrganizationUserId = orgUser.Id,\n                GrantedProjectId = createdProject.Id,\n                Read = true,\n                Write = true,\n            };\n\n            await _accessPolicyRepository.CreateManyAsync(new List<BaseAccessPolicy> { accessPolicy });\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/bitwarden_license/src/Commercial.Core/SecretsManager/Commands/Projects/CreateProjectCommand.cs#L20-L56","documentation":"Error \"Resource not found.\" thrown in bitwarden/server.","triggerScenarios":"Thrown by CreateProjectCommand when the organization (or related resource) referenced by the project creation request does not exist or is not accessible to the requesting identity.","commonSituations":"See trigger scenarios.","solutions":["Confirm the organization ID in the request exists and the caller has access to it.","Refresh the client or list projects for the organization to get the current valid identifiers.","If the resource was recently deleted, remove the stale reference and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}