anomalyco/sst · error

uv pip install timed out after 15 minutes - check network co

Error message

uv pip install timed out after 15 minutes - check network connectivity and try again

What it means

During Lambda Python builds, SST runs `uv pip install` with a hard 15-minute context deadline (build.go:921). If the install does not finish within that window, the process is killed, any partial dependency cache is deleted (os.RemoveAll(depsCacheDir)), and this error is returned from copySyncedDependencies. It means dependency resolution/download was too slow or hung, most often due to network problems, a slow package index, or an extremely large dependency set.

Source

Thrown at pkg/runtime/python/build.go:971

		resultChan <- cmdResult{output, err}
	}()

	var installOutput []byte
	select {
	case result := <-resultChan:
		close(progressDone)
		installOutput = result.output
		err = result.err
	case <-installCtx.Done():
		close(progressDone)
		if installCmd.Process != nil {
			installCmd.Process.Kill()
		}
		// Remove partial cache on timeout
		if cacheKey != "" {
			os.RemoveAll(depsCacheDir)
		}
		return fmt.Errorf("uv pip install timed out after 15 minutes - check network connectivity and try again")
	}

	if err != nil {
		slog.Error("uv pip install failed",
			"command", strings.Join(installCmd.Args, " "),
			"error", err,
			"output", string(installOutput),
			"functionID", input.FunctionID,
			"handler", input.Handler,
			"workingDir", installWorkspaceDir,
			"pyprojectPath", projectInfo.PyprojectPath)
		if cacheKey != "" {
			os.RemoveAll(depsCacheDir)
		}
		return fmt.Errorf("failed to run uv pip install: %v\n%s\n\nFunction: %s\nHandler: %s\nWorking directory: %s\nPyproject path: %s",
			err, string(installOutput), input.FunctionID, input.Handler, installWorkspaceDir, projectInfo.PyprojectPath)
	}

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Verify network connectivity to your package index from the build machine (curl -I https://pypi.org/simple/); fix proxy/VPN/DNS if unreachable
  2. Configure a fast mirror or internal index (UV_INDEX_URL / --index-url in pyproject.toml or requirements.txt)
  3. Trim or split heavyweight dependencies (e.g. CPU-only torch wheels) to reduce download time
  4. Increase availability by ensuring private-index credentials are available non-interactively (UV_INDEX env vars or netrc) so uv does not hang on a prompt
  5. Retry the deploy — the partial cache was already removed, so a rerun starts clean

Example fix

// before: uv resolves slowly over a flaky network
cmd: sst deploy  # times out after 15m

// after: pin a fast mirror before deploying
export UV_DEFAULT_INDEX="https://pypi.org/simple"
export UV_HTTP_TIMEOUT=120
cmd: sst deploy
Defensive patterns

Strategy: retry

Validate before calling

// before deploying, verify index reachability
curl -fsSI --max-time 10 https://pypi.org/simple/ >/dev/null && echo "index reachable" || echo "network problem"
// and confirm uv is installed and fast:
uv --version && time uv pip compile pyproject.toml -o /dev/null

Prevention

When it happens

Trigger: Specifically: uv pip install started by copySyncedDependencies (via installDependenciesForLambda) does not complete before the 15-minute context.WithTimeout fires; the select falls into the installCtx.Done() branch, kills installCmd.Process, purges the partial depsCacheDir, and returns this error.

Common situations: Corporate proxy/firewall silently dropping connections to PyPI; using a slow internal index or no index mirror; huge wheels (torch, tensorflow, cuda packages) exceeding the budget; uv hanging waiting on an auth prompt for a private index; IPv6 issues in containers.

Understand the failure class

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/c422bdf605b5cef9. Report an issue: GitHub.