{"record":{"id":"89f23d4abba6a4ab","repo":"medusajs/medusa","slug":"user-with-id-id-was-not-found-89f23d","errorCode":null,"errorMessage":"User with id: ${id} was not found","messagePattern":"User with id: (.+?) was not found","errorType":"exception","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/users/me/route.ts","lineNumber":32,"sourceCode":"  res: MedusaResponse<HttpTypes.AdminUserResponse>\n) => {\n  const id = req.auth_context.actor_id\n  const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n\n  if (!id) {\n    throw new MedusaError(MedusaError.Types.NOT_FOUND, `User ID not found`)\n  }\n\n  const query = remoteQueryObjectFromString({\n    entryPoint: \"user\",\n    variables: { id },\n    fields: req.queryConfig.fields,\n  })\n\n  const [user] = await remoteQuery(query)\n\n  if (!user) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `User with id: ${id} was not found`\n    )\n  }\n\n  res.status(200).json({ user })\n}\n","sourceCodeStart":14,"sourceCodeEnd":40,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/users/me/route.ts#L14-L40","documentation":"Thrown by GET /admin/users/me when a user id exists in the auth context but no matching user row is found via remote query.","triggerScenarios":"Valid JWT with an actor_id pointing to a deleted or nonexistent user; data drift between auth identities and the user module.","commonSituations":"User deleted directly in the database while tokens remain valid; user module data out of sync with auth module after imports or migrations.","solutions":["Verify the user exists in the user module and recreate if needed","Invalidate outstanding JWTs after deleting users","Re-authenticate to obtain a token tied to an existing user"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (e.type === 'not_found') logoutAndReauth() }","preventionTips":["Invalidate tokens when deleting users","Monitor auth/user data drift"],"tags":["auth","users","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}