Skip to content

Troubleshooting

This page focuses on common failure modes in the current Netherframe CLI workflow.

For shorter conceptual questions, see FAQ.

1. pyproject.toml not found

Most CLI workflows expect to run from a project that contains pyproject.toml with a [tool.nf] section.

Minimal working example:

[tool.nf]
python = ["uv", "run", "python"]
hybrid_apps = ["app:app"]

If the file exists but the CLI still fails, confirm you are invoking nf from the correct project root.

2. No apps configured

The CLI found pyproject.toml, but [tool.nf] does not define usable legacy_apps or hybrid_apps.

Example:

[tool.nf]
legacy_apps = ["app:app"]
hybrid_apps = ["hybrid_app:app"]

Each app entry must be a module:object import spec.

3. Import errors when loading an app

Common causes:

  • the interpreter from [tool.nf].python does not have Netherframe installed
  • generated provider packages are missing from that same environment
  • the CLI is running from a different environment than the app imports expect

Useful checks:

nf list apps
uv run python -c 'import app'

4. No stacks found after a compatibility export

If nf list stacks or nf plan --stack ... cannot find stacks, check the inventory outdir assumptions:

  • [tool.nf].outdir
  • [tool.nf.config].outdir
  • command-level --outdir

Typical legacy layout:

.nf.out/my-app/network/nf.tf.json

Useful checks:

nf list apps
nf list stacks

5. nf plan or nf deploy Fails Immediately

First classify the execution path:

  • legacy apps from [tool.nf].legacy_apps
  • hybrid apps from [tool.nf].hybrid_apps

Legacy-path failures often mean:

  • Terraform or the selected legacy binary is not installed
  • synthesized output is missing
  • provider configuration is incomplete

Hybrid-path failures often mean:

  • app selection is wrong
  • provider configuration is wrong
  • backend/runtime setup is incomplete

6. --app and --stack Behave Differently Across Commands

This is expected.

For plan, apply, destroy, and deploy:

  • --stack can select synthesized legacy stacks or configured legacy app stacks
  • --app selects app-scoped direct execution

Configured legacy apps also support stack-scoped direct execution through selectors like app/stack.

If you need raw Terraform/OpenTofu passthrough arguments or --legacy-bin, stay on the legacy --stack path.

If a stack was synthesized into phaseN/ Terraform directories, the CLI now rejects that stack on the legacy --stack path. Use --app to run the direct execution engine instead. Configured direct execution still supports those circular-dependency stacks; the phase logic is applied inside the planner/orchestrator rather than by running the generated phase directories locally.

nf list stacks still shows those stack roots so you can inspect or hand them off, but they are labeled phased-export / export-only rather than implying they are runnable local stack targets.

7. Automatic Naming Behaves Unexpectedly

If construct IDs are not what you expected:

  • pass explicit nf_id values
  • re-run with nf synth --no-auto-naming
  • reduce the example until the naming issue is obvious

8. Cloud Provider Errors After Synthesis

If synthesis succeeds but plan/apply/deploy fails:

  • verify provider settings such as region, URL, or credentials
  • confirm the environment actually exposes the credentials expected by the provider
  • use debug logging to separate model issues from access issues

Example:

nf plan --stack network --log-level DEBUG

9. Backend Or State Problems

If the failure looks backend- or state-related:

nf backend show
nf backend validate
nf state --stack network list

Typical causes:

  • backend resources do not exist yet
  • the current environment cannot reach the backend
  • migration from local to remote state is incomplete

10. Drift, Import, And Migration Confusion

These workflows solve different problems:

  • nf discover: inventory what exists
  • nf import: bring modeled resources under stack management
  • nf drift: compare code with actual or saved state

Use the narrower tool for the job instead of expecting one command to cover the entire adoption workflow.

11. gRPC Fork Diagnostics During Provider or Command Startup

A run may print native gRPC diagnostics while starting another provider or runtime command:

Other threads are currently calling into gRPC, skipping fork() handlers
FD from fork parent still in poll list

These have been reproduced on macOS arm64 when Python launches a child through fork/exec while existing provider gRPC threads are active. Depending on the Python build, subprocess.Popen can take this path even for an absolute executable path: its posix_spawn path with close_fds=True requires platform support such as os.POSIX_SPAWN_CLOSEFROM.

The nf console command and python -m netherframe.cli default GRPC_ENABLE_FORK_SUPPORT to 0 before importing the CLI application or gRPC. This disables gRPC's fork-support machinery for provider and runtime-command launches that immediately exec another program. An explicit environment setting is preserved and inherited by subprocesses unless their environment overrides it.

With --log-level DEBUG or --trace, the CLI logs the setting, its purpose, and how to opt out. To enable gRPC fork support instead, set the variable before starting Python:

GRPC_ENABLE_FORK_SUPPORT=1 uv run nf plan --app my-app
GRPC_ENABLE_FORK_SUPPORT=1 uv run nf apply --app my-app

For an installed nf command, use GRPC_ENABLE_FORK_SUPPORT=1 nf ... instead. Unsetting the variable restores the CLI default of 0; it does not opt out. Changing it in an app after gRPC has initialized is unreliable.

This disables gRPC's fork-support machinery for that execution. It does not filter stderr, disable normal gRPC error reporting, or change subprocess descriptor cleanup. Do not work around these messages with close_fds=False: that can expose parent descriptors to executed programs. Setting a broader gRPC log threshold can hide unrelated diagnostics.

The messages alone do not establish an RPC failure or a descriptor leak into the executed program. Offline traffic and real Kubernetes-provider schema probes completed successfully with and without the workaround, including continuity checks on an existing channel, closure of deliberately inheritable sentinel descriptors after exec, and provider process cleanup. This is separate from an unsupported provider Stop RPC warning. Investigate any accompanying RPC failures, hangs, or crashes separately.

Library imports, including importing the CLI modules, do not set this variable. Applications embedding Netherframe that fork children and continue using inherited gRPC objects without exec must manage their own gRPC fork configuration. CLI-loaded apps with that behavior must explicitly opt out of the CLI default. Disabling fork support does not make inherited gRPC objects safe to use in a child without exec.

Offline validation covered macOS arm64 (Python 3.14.3 and 3.15.2, grpcio 1.85.1) and Linux x86_64 (Python 3.14.9, grpcio 1.85.1). The tested Linux build used posix_spawn by default; forced-fork probes also passed. These checks do not establish support for every platform or for fork-without-exec applications. See the upstream gRPC fork-support guidance.