Read the Docs ".readthedocs.yaml" config invalid in CI
Read the Docs requires a valid .readthedocs.yaml at the repo root. A missing file, a missing build.os/build.tools, or a schema error makes the build fail before installing dependencies.
What this error means
The RTD build fails early with "Invalid .readthedocs.yaml" or "Config validation error", naming the missing or wrong key (often build.os or build.tools).
readthedocs
Problem in your project's configuration. Invalid ".readthedocs.yaml":
config.build.os: required key not providedCommon causes
Missing required build keys
The v2 config requires build.os and build.tools; omitting them fails schema validation.
A malformed or misplaced config file
The file is not at the repo root, has invalid YAML, or uses keys not in the schema, so RTD rejects it.
How to fix it
Provide a valid v2 config
- Place
.readthedocs.yamlat the repository root. - Set
version: 2, abuild.os, andbuild.toolsversions. - Declare your docs builder (sphinx or mkdocs).
.readthedocs.yaml
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.pyValidate the YAML
Lint the file so a YAML syntax error does not masquerade as a schema problem.
Terminal
python -c "import yaml,sys; yaml.safe_load(open('.readthedocs.yaml'))"How to prevent it
- Keep
.readthedocs.yamlat the repo root withversion: 2. - Always set
build.osandbuild.tools. - Lint the YAML before pushing.
Related guides
Read the Docs build failed installing requirements in CIFix Read the Docs builds that fail while installing requirements - the python.install step did not point at t…
Sphinx "Could not import extension" build error in CIFix Sphinx "Could not import extension X (exception: No module named X)" in CI - an extension listed in conf.…
MkDocs "Aborted with a BuildError" in CIFix MkDocs "Aborted with a BuildError!" in CI - a strict build or a plugin raised a fatal error. The specific…