orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of once

Open Beginner friendly
#3,786 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@AdaAibaby is already working on this.

Since Nov 2, 2026.

  • #3787 by @AdaAibaby — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Start with the two call sites named in the issue: the useNFSCache check around packages/orchestrator/pkg/template/build/builder.go:304 and the one around packages/orchestrator/pkg/sandbox/template/cache.go:1218. The proposed helper belongs in packages/shared/pkg/storage next to storage.WrapInNFSCache. Done means the warning appears once per process, its text says NFS caching stays disabled until the cache dir is set, and a unit test covers the once-only behaviour.

Written by the indexing model from the issue text.

Description

Summary

When an NFS-cache feature flag is enabled but no cache path is configured, the orchestrator logs WARN "NFSCache feature flag is enabled but cache path is not set" on the hot path — once per template build, per sandbox launch, and per snapshot resume — and NFS caching is silently disabled. On a dev-default deployment this floods the logs (hundreds of identical lines observed) while telling the operator nothing new after the first line.

Why it happens by default

Three flags default to env.IsDevelopment() (i.e. on in dev):

  • use-nfs-for-building-templates (UseNFSCacheForBuildingTemplatesFlag)
  • use-nfs-for-snapshots (SnapshotFeatureFlag)
  • use-nfs-for-templates (TemplateFeatureFlag)

If the shared chunk cache dir is not set (common in a plain dev bring-up), each of the two call sites warns on every operation:

  • packages/orchestrator/pkg/template/build/builder.go:304 (useNFSCache, per build)
  • packages/orchestrator/pkg/sandbox/template/cache.go:1218 (useNFSCache, per launch/resume)

Both emit the identical message, and both return "cache disabled". So the warning is pure repetition — the path comes from immutable config and won't change within a process.

Proposal

Emit the warning once per process instead of on every operation, and make the message state the consequence (NFS caching disabled until the cache dir is configured). A shared WarnNFSCachePathUnsetOnce(ctx) in packages/shared/pkg/storage (already imported by both call sites, since both call storage.WrapInNFSCache) guarded by sync.Once keeps it to a single line and removes the duplicated string. Behavior (cache disabled) is unchanged.

Happy to send the PR (small, with a unit test).

Dominant language
Go
Stars
1.8k
Forks
503
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from e2b-dev/runtime

All issues in e2b-dev/runtime

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.