{"record":{"id":"7acefc4458776910","repo":"deepseek-ai/deepseek-harness","slug":"subprocess-e2b-remote-login-home-is-invalid-js","errorCode":null,"errorMessage":"subprocess-e2b: remote login home is invalid: ${JSON.stringify(home)}","messagePattern":"subprocess-e2b: remote login home is invalid: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/e2b/subprocess-e2b/src/environment.ts","lineNumber":50,"sourceCode":"    'set -o pipefail; dsh_e2b_passwd=\"$(getent passwd \"$(id -u)\")\"; IFS=: read -r _ _ _ _ _ dsh_e2b_home _ <<<\"$dsh_e2b_passwd\"; test -n \"$dsh_e2b_home\" -a -d \"$dsh_e2b_home\"; printf \\'%s\\' \"$dsh_e2b_home\" | base64 -w 0; printf \\'\\\\n\\'; env -0 | base64 -w 0',\n    { envs: e2bControlEnvs(), ...(signal === undefined ? {} : { signal }) },\n  )\n  const lines = result.stdout.trim().split('\\n')\n  if (lines.length !== 2 || !lines.every(line => BASE64.test(line))) {\n    throw new Error('subprocess-e2b: remote environment transport returned invalid base64')\n  }\n  const [encodedHome, encodedEnvironment] = lines as [string, string]\n  let home: string\n  let raw: string\n  try {\n    const decoder = new TextDecoder('utf-8', { fatal: true })\n    home = decoder.decode(Buffer.from(encodedHome, 'base64'))\n    raw = decoder.decode(Buffer.from(encodedEnvironment, 'base64'))\n  } catch (error: unknown) {\n    throw new Error('subprocess-e2b: remote environment is not valid UTF-8', { cause: error })\n  }\n  if (!posix.isAbsolute(home) || home.includes('\\0')) {\n    throw new Error(`subprocess-e2b: remote login home is invalid: ${JSON.stringify(home)}`)\n  }\n  const environment = new Map(remoteEnvironmentEntries(raw))\n  environment.set('HOME', home)\n  return [...environment].map(([name, value]) => `${name}=${value}\\0`).join('')\n}\n\n/**\n * Parse an E2B NUL-delimited environment while removing harness-private and credential-shaped names.\n * @param raw - The complete NUL-delimited remote environment.\n * @returns Mutable retained entries for the caller to overlay and serialize.\n */\nexport function scrubRemoteEnvironment(raw: string): Map<string, string> {\n  const environment = new Map<string, string>()\n  for (const [name, value] of remoteEnvironmentEntries(raw)) {\n    if (name.startsWith('DSH_') || SENSITIVE_ENV_PATTERN.test(name)) continue\n    environment.set(name, value)\n  }\n  return environment","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/subprocess-e2b/src/environment.ts#L32-L68","documentation":"Error \"subprocess-e2b: remote login home is invalid: ${JSON.stringify(home)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/subprocess-e2b/src/environment.ts:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}