{"record":{"id":"3d1ac780a0659f40","repo":"Dokploy/dokploy","slug":"not-found-3d1ac7","errorCode":"NOT_FOUND","errorMessage":"Gitlab Provider not found","messagePattern":"Gitlab Provider not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/gitlab.ts","lineNumber":57,"sourceCode":"\t\t\t.values({\n\t\t\t\t...input,\n\t\t\t\tgitProviderId: newGitProvider?.gitProviderId,\n\t\t\t})\n\t\t\t.returning()\n\t\t\t.then((response) => response[0]);\n\t});\n};\n\nexport const findGitlabById = async (gitlabId: string) => {\n\tconst gitlabProviderResult = await db.query.gitlab.findFirst({\n\t\twhere: eq(gitlab.gitlabId, gitlabId),\n\t\twith: {\n\t\t\tgitProvider: true,\n\t\t},\n\t});\n\n\tif (!gitlabProviderResult) {\n\t\tthrow new TRPCError({\n\t\t\tcode: \"NOT_FOUND\",\n\t\t\tmessage: \"Gitlab Provider not found\",\n\t\t});\n\t}\n\n\treturn gitlabProviderResult;\n};\n\nexport const updateGitlab = async (\n\tgitlabId: string,\n\tinput: Partial<Gitlab>,\n) => {\n\treturn await db\n\t\t.update(gitlab)\n\t\t.set({\n\t\t\t...input,\n\t\t})\n\t\t.where(eq(gitlab.gitlabId, gitlabId))","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/gitlab.ts#L39-L75","documentation":"Thrown by findGitlabById when the GitLab provider lookup (Drizzle query with gitProvider relation) returns null for the given provider ID. It is a standard NOT_FOUND lookup failure: no git provider row matches the requested id.","triggerScenarios":"Calling findGitlabById with a providerId that does not exist in the database — e.g. after the provider was deleted, or a stale ID passed from the client/UI.","commonSituations":"UI holding a stale provider reference after another team member deleted it, passing a projectId instead of providerId, or querying right after a DB reset/restore.","solutions":["Verify the provider ID exists: SELECT * FROM git_provider WHERE id = <id>","Refresh the provider list in the client to drop stale IDs","If it should exist, check whether you're connected to the right database/environment"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const providers = await trpc.gitlab.list.query();\nconst exists = providers.some(p => p.gitProviderId === providerId);","typeGuard":"const hasGitProvider = (r: unknown): r is GitlabProvider =>\n  typeof r === 'object' && r !== null && 'gitProvider' in r;","tryCatchPattern":"try { return await findGitlabById(id); } catch (e) { if (e instanceof TRPCError && e.code === 'NOT_FOUND') return null; throw e; }","preventionTips":["Refetch provider lists after deletions","Never persist provider IDs across sessions without revalidation"],"tags":["database","not-found","git-provider","lookup"],"backgroundTag":"resource-not-found-by-id","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}