{"record":{"id":"141020721c81003d","repo":"withastro/astro","slug":"timeout-141020","errorCode":null,"errorMessage":"Timeout","messagePattern":"Timeout","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/upgrade/src/shell.ts","lineNumber":72,"sourceCode":"\ttry {\n\t\tconst [resolvedCommand, resolvedFlags] = resolveCommand(command, flags);\n\t\tchild = spawn(resolvedCommand, resolvedFlags, {\n\t\t\tcwd: opts.cwd,\n\t\t\tstdio: opts.stdio,\n\t\t\ttimeout: opts.timeout,\n\t\t});\n\t\tconst done = new Promise<void>((resolve, reject) => {\n\t\t\tchild.once('error', reject);\n\t\t\tchild.once('close', () => resolve());\n\t\t});\n\t\t[stdout, stderr] = await Promise.all([text(child.stdout), text(child.stderr), done]);\n\t} catch (e) {\n\t\tconst message = e instanceof Error ? e.message : stderr || 'Unknown error';\n\t\tthrow new Error(message);\n\t}\n\tconst { exitCode } = child;\n\tif (exitCode === null) {\n\t\tthrow new Error('Timeout');\n\t}\n\tif (exitCode !== 0) {\n\t\tthrow new Error(stderr || stdout || `Process exited with code ${exitCode}`);\n\t}\n\treturn { stdout, stderr, exitCode };\n}\n","sourceCodeStart":54,"sourceCodeEnd":79,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/upgrade/src/shell.ts#L54-L79","documentation":"The upgrade tool's minimal execa-like `shell()` spawns child processes (package manager install/update commands) with Node's `spawn` `timeout` option. When the timeout fires, Node kills the child with a signal, so `exitCode` is `null`; the wrapper reports that state as \"Timeout\". It means the spawned command exceeded its allotted time without exiting cleanly.","triggerScenarios":"A child command (e.g. `npm install` run by `astro upgrade`) hanging: waiting for interactive input in a TTY-less CI shell, a stalled network fetch on a slow registry, a package manager lock wait (concurrent npm process holding package-lock), all exceeding the configured timeout in milliseconds.","commonSituations":"Running `astro upgrade` in CI where npm prompts for confirmation and blocks; corporate proxies that stall registry requests; a leftover package-manager process holding a lockfile; very large dependency trees on slow disks.","solutions":["Kill stale package-manager processes that may hold locks (`ps aux | grep npm`), then rerun the upgrade","Ensure the environment is non-interactive and won't prompt (set `CI=true`, configure registry auth)","Pre-warm the package manager cache (`npm cache verify`) or fix registry connectivity, then retry","If the timeout is genuinely too short for the install, run the install manually with your package manager and use `astro upgrade` only for the version bumping"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runUpgrade();\n} catch (e) {\n  if (e instanceof Error && e.message === 'Timeout') {\n    // child install command hung: clear locks/prompts and retry once\n  }\n}","preventionTips":["Run upgrades in a non-interactive shell (CI=true) so package managers never block on prompts","Avoid concurrent package-manager invocations in the same project","Warm the package cache on slow networks before upgrading"],"tags":["upgrade","child-process","timeout","package-manager"],"backgroundTag":"command-timeout","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}