{"record":{"id":"1005087352b9f341","repo":"hcengineering/platform","slug":"account-not-found-name","errorCode":null,"errorMessage":"Account not found: ${name}","messagePattern":"Account not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/huly.ts","lineNumber":551,"sourceCode":"\n    const socialId = await this.client.findOne(contact.class.SocialIdentity, {\n      type: SocialIdType.EMAIL,\n      value: email\n    })\n\n    if (socialId === undefined) {\n      throw new Error(`Social ID not found for email: ${email}`)\n    }\n\n    this.personIdByEmail.set(email, socialId._id)\n\n    return socialId._id\n  }\n\n  private findAccountByName (name: string): AccountUuid {\n    const account = this.accountsByName.get(name)\n    if (account === undefined) {\n      throw new Error(`Account not found: ${name}`)\n    }\n    return account\n  }\n\n  private findEmployeeByName (name: string): Ref<Employee> {\n    const employee = this.employeesByName.get(name)\n    if (employee === undefined) {\n      throw new Error(`Employee not found: ${name}`)\n    }\n    return employee\n  }\n\n  private async processDocumentsRecursively (\n    builder: ImportWorkspaceBuilder,\n    teamspacePath: string,\n    currentPath: string,\n    parentDocPath?: string\n  ): Promise<void> {","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/huly.ts#L533-L569","documentation":"findAccountByName resolves a member name to an AccountUuid via the accountsByName map populated when loading the target workspace's accounts. If the name has no matching account, the importer throws, because project/team/org space membership would otherwise reference a non-existent account.","triggerScenarios":"processProject, processTeamspace, or processOrgSpace resolves a member/owner name from a space's YAML settings; the name is absent from accountsByName (user missing from target workspace, renamed, or spelled differently).","commonSituations":"Space members exported from workspace A that do not exist in workspace B; renamed users; trailing spaces or case differences in names in the YAML config; removed/deactivated accounts still listed as members.","solutions":["Ensure each named member exists as an account in the target workspace with the exact same display name","Update member names in the space YAML to match existing accounts","Remove stale members from the space config who no longer exist","Re-export after the target workspace accounts are aligned with the source"],"exampleFix":"// before (space yaml)\nmembers:\n  - Jane Smyth\n// after (matches an actual account)\nmembers:\n  - Jane Smith","handlingStrategy":"validation","validationCode":"const memberNames = [...new Set(spaceConfigs.flatMap(c => c.members ?? []))]\nconst missing = memberNames.filter(n => !accountNames.has(n))\nif (missing.length) throw new Error(`Accounts missing in target workspace: ${missing.join(', ')}`)","typeGuard":null,"tryCatchPattern":"try {\n  await importer.workspaceData(folder)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Account not found:')) {\n    const name = e.message.slice('Account not found:'.length).trim()\n    console.error(`Space member \"${name}\" does not exist in the target workspace`)\n  } else throw e\n}","preventionTips":["Sync the target workspace accounts with the source before import","Remove or remap members who left the organization in the space YAML","Match display names exactly (no extra spaces, consistent casing)","Re-export whenever membership changes"],"tags":["importer","account-lookup","membership"],"backgroundTag":"referenced-user-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}