Troubleshooting

Every entry below was hit for real while building and testing Scaffolder, except the ones under Windows and the Ubuntu python3-venv entry, which describe known behaviour of the tools involved and have not yet been confirmed on a real machine. If one of them is wrong or incomplete for you, please report it.

Setup and tools

permission denied: ./scripts/sdlc

Your unzip tool dropped the executable bit. Run chmod +x scripts/*, or call python3 scripts/sdlc.py <command> instead.

Python >= 3.12 is required ... but the newest Python found is 3.9 (from setup or doctor)

The ./scripts/sdlc tooling runs on Python 3.9+, but the backend needs the version in your config (default 3.12), and macOS ships 3.9. setup already searches for a suitable interpreter by itself (python3.12, newer ones, then python3). If it finds none, it tells you, and in a terminal it offers to install one with uv, Homebrew or (on Windows) winget. Nothing is installed unless you answer y (or set SDLC_INSTALL_PYTHON=yes for scripts and CI). To install it yourself:

brew install python@3.12
./scripts/sdlc setup

Other options are uv python install 3.12 or pyenv install 3.12. If Python is installed somewhere unusual, point at it once: SDLC_PYTHON=/path/to/python3.12 ./scripts/sdlc setup. An explicit SDLC_PYTHON is never silently replaced by another interpreter.

ERROR: Package '...-backend' requires a different Python: 3.9.6 not in '>=3.12' (the raw pip error)

Your project was generated by an older Scaffolder that didn't check the Python version first. Either download a fresh zip, or work around it once:

brew install python@3.12 && PATH="$(brew --prefix python@3.12)/libexec/bin:$PATH" ./scripts/sdlc setup

The failed attempt may have left a backend/.venv built with the wrong Python. New projects replace it automatically (venv --clear); with an old script, delete it first: rm -rf backend/.venv.

Node errors during setup or build

The web app needs Node 22.12 or newer.

The virtual environment was not created successfully / ensurepip is not available (Ubuntu, Debian)

Python's venv module is a separate package on Debian-based systems. Install it for the version you use: sudo apt install python3-venv (or python3.12-venv). Then run setup again; it replaces the half-made backend/.venv.

Windows

The Windows support has unit tests that simulate its logic and a CI job that runs the real thing on windows-latest; these entries come from how Windows and its tools behave, not from a failure observed on a real machine.

.\scripts\sdlc is not recognized, or opens an editor

scripts/sdlc is a bash script. In PowerShell or cmd use the launcher with its extension: .\scripts\sdlc.cmd doctor (cmd: scripts\sdlc.cmd doctor). Without a project folder at hand you can always run py -3 scripts\sdlc.py doctor.

Windows: Python was not found or the Microsoft Store opens

Windows ships a python.exe / python3.exe stub that opens the Store instead of running Python. The sdlc launcher uses the py launcher, which the python.org installer provides, and ignores the stub. Install Python and open a new terminal:

winget install -e --id Python.Python.3.12

Then check py -3.12 --version and run .\scripts\sdlc.cmd doctor again. To get rid of the stub for other tools too: Settings, Apps, Advanced app settings, App execution aliases, and turn off python.exe and python3.exe. If Python is installed somewhere unusual: $env:SDLC_PYTHON='C:\path\to\python.exe'; .\scripts\sdlc.cmd setup.

Windows: filename too long or path too long

Windows limits paths to 260 characters unless long paths are enabled, and node_modules can get deep. Create the project in a short folder such as C:\dev\app, and enable long paths once (administrator PowerShell):

git config --system core.longpaths true

Also turn on LongPathsEnabled (Windows 10 1607 and later): see Microsoft's "Maximum Path Length Limitation" page.

Windows: scripts fail with \r: command not found or no such file or directory inside a container

The files have CRLF line endings, which Linux shells and Docker cannot read. Generated projects include a .gitattributes that keeps LF; a project made by an older version does not. Add the generated .gitattributes, then:

git add --renormalize .

Windows: image operating system "linux" cannot be used on this platform

Docker Desktop is in Windows-containers mode. Switch it to Linux containers (tray icon, Switch to Linux containers). Without Docker, verify --runtime local still works.

Windows: make is not recognized

make is not installed on Windows. Use the sdlc commands, and docker compose up -d --build / docker compose down instead of make up / make down.

Windows: deploying from Windows needs bash

sdlc deploy runs the generated bash deploy scripts. Install Git for Windows (it includes bash) or run the command from WSL. The generated cd.yml workflow deploys from a Linux runner and needs neither.

Windows: a server keeps running after a failed run, or a folder cannot be deleted

sdlc stops the whole process tree of the servers it starts. If a run was killed from outside (closing the terminal, Task Manager) a server can remain and keep its port: end the python.exe / node.exe process that listens on it (netstat -ano | findstr :8000, then taskkill /PID <pid> /T /F). Antivirus scanning can also lock node_modules; excluding the project folder helps.

Running the stack

ports are not available: ... address already in use

Something on your machine already uses the port. The database no longer claims a fixed host port (it picks a free one), but the backend (8000) and web (3000) do. Change them with BACKEND_PORT / WEB_PORT in .env, or in scaffolder.config.yaml (backend.port, web.port) and regenerate.

failed to connect to the docker API / docker compose up failed

Docker isn't running. Start Docker Desktop and retry, or use ./scripts/sdlc verify --runtime local.

... already responds: stop whatever uses that port first (local runtime)

Another process is answering on the service's port. Stop it; otherwise the facts would be checked against the wrong process.

A fact shows SKIP ... needs db

You are using --runtime local, which has no database. That is reported honestly as a skip, never as a pass. Use the Docker runtime for the full check.

Find the database port while Docker is running

docker compose port postgres 5432. To pin a fixed port, set POSTGRES_PORT=5432 in .env.

Gates

backend.lint fails on line length or formatting

cd backend && .venv/bin/ruff format ., then run the gate again.

S105 Possible hardcoded password on a line that isn't a password

A false alarm (for example token_type = "bearer"). Add a narrow, explained suppression on that one line: # noqa: S105 (the OAuth2 token type, not a password). Tests are already exempt from this rule.

backend.contract fails with a diff

The API changed. If the PRD says it should have, regenerate the snapshot and review the diff: cd backend && python -m app.export_openapi --write ../.ai/contract/openapi.json. If not, fix the code.

repo.secrets reports a hard-coded credential

Remove it, and rotate it if it was real. For a deliberate fake in application code add # sdlc:allow-secret to that line. Files under tests/ and .ai/specs/ are exempt from the keyword heuristic (fake credentials are normal there), but real key formats (cloud keys, tokens, private keys) are caught everywhere.

npm audit shows a warning

That gate is advisory on purpose. It reports vulnerabilities in transitive dependencies, some of which have no patched release yet. Look at the list, but it won't block you.

A deprecation warning about httpx2 in pytest output

Newer Starlette versions prefer a different HTTP test client. The tests pass; the warning is harmless.

Flutter

doctor shows MISS flutter, or flutter: command not found

The mobile app needs the Flutter SDK. On macOS brew install --cask flutter; elsewhere see https://docs.flutter.dev/get-started/install. Then flutter --version and ./scripts/sdlc doctor. Only the SDK is needed: the checks do not build an Android or iOS app, so no Android SDK or Xcode.

mobile.analyze fails with 'package:flutter/material.dart' is deprecated

From Flutter 3.47 Material lives in its own package, and the gate runs the analyzer with --fatal-infos, so the old import fails. Use import 'package:material_ui/material_ui.dart'; (it also exports the widgets layer, so a separate widgets.dart import is flagged as unnecessary). Cupertino is package:cupertino_ui/cupertino_ui.dart.

mobile.analyze fails and the log lists Changed lib/...

That is the formatter: those files are not in Dart's default layout (80 columns, no flags). Fix them with cd mobile && dart format . and commit.

mobile.unit fails with lib/x.dart is not loaded by any test

flutter test --coverage only lists the files a test loaded, so a file no test touches would never lower the figure. The gate counts such a file as a failure. Add a test that uses it (or delete the file if it is dead). lib/main.dart and generated files (*.g.dart, *.freezed.dart) are left out.

Failed to resolve package URI "package:flutter_lints/flutter.yaml" printed many times

You ran dart format (or an editor did) before the dependencies were installed. Run ./scripts/sdlc setup once. The gate itself runs flutter analyze first, which installs them, so it does not print this.

A project name is refused: "web" is the name of a package the app depends on

The project's name becomes the Dart package name, and a package cannot depend on itself (nor be a Dart reserved word such as class). Choose another name.

After flutter create, pubspec.lock changed

flutter create resolves the dependencies again and rewrites the lockfile. Commit it with the new android/ and ios/ folders; it still satisfies the CI install (flutter pub get --enforce-lockfile). flutter create leaves every other generated file as it was, and its own sample test is not written because the project already has test/widget_test.dart.

mobile.unit says exit 79 or No tests ran in a fact

A check's --plain-name "AC-00N" matched no test, because the test was renamed or deleted. Put the criterion's id at the start of the test's name again; do not edit the check to match (the spec is frozen while healing).

./scripts/sdlc spec

No such file or Unsupported file type

Pass an existing .pdf, .docx, .md, .markdown, .txt or .rst file. Convert other formats (for example .doc, .pages, Google Docs) to one of these first.

no text could be extracted

The PDF has no text layer (a scan or photo), or it is protected. The agent may still be able to read the file itself (the claude preset can read PDFs), but a reliable route is OCR first, or exporting the source document to .docx / .md.

the built-in basic extractor: text may be incomplete or out of order

No PDF tool was found, so the tool fell back to its basic reader, which handles ordinary text PDFs but can misorder complex layouts (columns, tables). Install poppler for much better results: brew install poppler (macOS) or apt install poppler-utils (Debian/Ubuntu), then run spec again.

The draft is still invalid after 3 attempts

The agent could not produce a well-formed spec. The problems are printed (for example a criterion with no check). Fix prd.md / acceptance.json by hand (skills write-prd, write-fact-checks), or raise --max-attempts. If the document is vague, the agent usually cannot make testable criteria out of it: improve the document.

INTEGRITY VIOLATION: spec drafting may only write files inside the new spec folder

The agent edited or created other files. Revert them (git checkout -- <path>, delete untracked files), then run again.

The agent could not draft a spec

The agent found nothing usable in the document for the scope you gave (or it is unreadable) and explained why instead of inventing a spec. Fix the document or widen --focus.

... already has a finished PRD; this would overwrite your work

A spec with that name exists and has no TODO(prd) markers. Choose another --name, or delete the folder if you really want to start over.

The draft looks wrong or invents things

That is why it is a draft. Fix it in prd.md / acceptance.json (the review checklist is the review-spec skill), or fix the document and run spec again under a new --name.

./scripts/sdlc implement

The spec is not ready to implement

The tool refuses to spend an agent's time on an unfinished spec. It lists what is missing: TODO(prd) placeholders still in prd.md, a criterion with no check, or a check that cites a criterion that doesn't exist. Fix prd.md / acceptance.json and run again.

The agent cannot run: ... is not installed or not on PATH

The agent's program isn't installed. The tool then lists every agent it knows (claude, codex, gemini, copilot, cursor, the Claude desktop app's engine and the desktop apps you can drive), which of them are installed on this machine and the install line for the rest. Pick one that is installed with ./scripts/sdlc agent (or ./scripts/sdlc agent codex), or install the missing one (links in the tutorial). For one run add --agent <name>. ./scripts/sdlc doctor shows which agent is used and which are installed.

agent said: API Error: 404 ... not_found_error ... model: claude-... / The agent could not use its AI model

The agent asked for an AI model that no longer exists, so it did nothing and the tool stopped. This almost always means the agent's CLI is out of date: an old install keeps asking for the model that was its default back then. The message prints which program ran and its version. Update it (npm install -g @anthropic-ai/claude-code@latest, or claude update). If you have several installs, the first on PATH is the one that runs: which -a claude (Windows: where claude) lists them, so remove or update the stale one. Then run the same command again. Or skip the CLI: the Claude desktop app keeps its own, current Claude Code, and ./scripts/sdlc agent claude-desktop uses it (details). If the agent that failed is claude-desktop, update the app instead: Claude > Check for Updates... (macOS) or Help > Check for Updates... (Windows).

The agent cannot run: the Claude desktop app's Claude Code was not found

The claude-desktop agent looks where the Claude desktop app keeps the Claude Code it downloads for its Code tab. Install the app (claude.ai/download), open it once and sign in, then run again. If it lives somewhere else, point the tool at it: SDLC_CLAUDE_DESKTOP="/path/to/claude". See Using a Desktop App.

a desktop app you drive needs a terminal to wait in, and this is not one

A handoff-* agent opens an app and waits for you to press Enter, so it cannot run in CI or with its input piped. Run it from a terminal, or choose an agent that runs by itself (./scripts/sdlc agent). See Using a Desktop App.

No agent is configured, so nothing can write the code

You (or the project) chose none, or the command is empty. Run ./scripts/sdlc agent to see the options and choose one, or add --agent <name> for one run.

You have uncommitted changes outside this feature's spec

implement wants a clean tree so the diff you review is only the agent's work. Commit or stash your changes, or pass --allow-dirty.

The project is already failing before any change

The baseline gates were red before the agent started. Fix that first (./scripts/sdlc gates), or pass --skip-baseline to let the agent try anyway.

The agent could not proceed without answers from you

The agent decided the spec was ambiguous and wrote questions instead of guessing. Answer them in prd.md / acceptance.json, then run again.

INTEGRITY VIOLATION: the agent changed files that define what 'correct' means

The agent edited your spec or the gate config. Revert with git checkout -- <path> (the tool lists the files) and run again. If it keeps happening, make the PRD clearer: an agent that "fixes" the spec usually found it contradictory.

The agent ran but nothing passes (exit 1 or 3)

Read .ai/evidence/latest/report.md, then the prompt the agent got (implement.prompt.md in the run folder under .ai/evidence/) and its output (*.agent.log). Exit 3 means the same failure repeated. A clear fix is usually in the PRD: add the missing detail and run again.

The agent made commits

implement warns if HEAD moved. The agent was told not to commit; review git log and undo with git reset --soft <commit> if you don't want them.

The loop and the specs

verify fails right after ./scripts/sdlc new

Expected. The new PRD still contains TODO(prd) placeholders. Finish the PRD and acceptance.json.

If you have a requirements document, don't use new: it only copies the empty template and never reads a file (it now refuses a .pdf/.docx/.md/.txt argument). Delete the empty .ai/specs/FEAT-00N-<name>/ folder and run ./scripts/sdlc spec requirements.pdf, which drafts both files from the document.

AC-00x has no check: an unverified requirement is not done

Add a check to acceptance.json with "covers": ["AC-00x"], or remove the criterion if it isn't a requirement.

Exit code 4 (integrity violation)

Something changed .ai/sdlc.json, scripts/sdlc*, .github/workflows/ or (while healing) .ai/specs/. If it wasn't you, an agent tried to change what "correct" means. Revert with git checkout -- <path> and re-run.

Exit code 3 (no progress)

The same failure repeated, so another iteration won't help. Read the failure in .ai/evidence/latest/report.md and the last heal prompt (heal-N.prompt.md in the run folder), then fix it yourself or change the approach.

Exit code 2 (needs a human)

No agent is configured and the loop isn't running in an interactive terminal, or the PRD is still a stub. The message tells you which.

Where is the full output of a failure?

.ai/evidence/latest/logs/<gate-id>.log. Runtime and container logs are in the same folder (runtime-*.log).

This page is docs/wiki/Troubleshooting.md in the repository, rendered here.