OpenRA/OpenRA · error · YamlException

{nodes[i].Location}: File `{filename}` not found.

Error message

{nodes[i].Location}: File `{filename}` not found.

What it means

Thrown by the Manifest constructor while expanding Include nodes in mod.yaml. Each Include names a YAML file inside the mod package; if package.GetStream(filename) returns null the include target does not exist inside the package, and loading aborts with a YamlException that includes the source location of the offending Include line.

Source

Thrown at OpenRA.Game/Manifest.cs:107

		public readonly FrozenDictionary<string, MiniYaml> GlobalModData;

		public Manifest(string modId, IReadOnlyPackage package)
		{
			Id = modId;
			Package = package;

			var stringPool = new HashSet<string>(); // Reuse common strings in YAML
			var nodes = MiniYaml.FromStream(package.GetStream("mod.yaml"), $"{package.Name}:mod.yaml", stringPool: stringPool).ToList();
			for (var i = nodes.Count - 1; i >= 0; i--)
			{
				if (nodes[i].Key != "Include")
					continue;

				// Replace `Includes: filename.yaml` with the contents of filename.yaml
				var filename = nodes[i].Value.Value;
				var contents = package.GetStream(filename);
				if (contents == null)
					throw new YamlException($"{nodes[i].Location}: File `{filename}` not found.");

				nodes.RemoveAt(i);
				nodes.InsertRange(i, MiniYaml.FromStream(contents, $"{package.Name}:{filename}", stringPool: stringPool));
			}

			// Merge inherited overrides
			var yaml = new MiniYaml(null, MiniYaml.Merge([nodes])).ToDictionary();

			Metadata = FieldLoader.Load<ModMetadata>(yaml["Metadata"]);

			// TODO: Use fieldloader
			MapFolders = YamlDictionary(yaml, "MapFolders");

			if (!yaml.TryGetValue("FileSystem", out FileSystem))
				throw new InvalidDataException("`FileSystem` section is not defined.");

			Rules = YamlList(yaml, "Rules");
			Sequences = YamlList(yaml, "Sequences");

View on GitHub (pinned to a520984d91)

Solutions

  1. Check the filename in the Include line for typos and confirm the file exists inside the mod package (the location in the message points at the Include node).
  2. Remove the Include node if it is no longer needed.
  3. Restore or re-add the referenced YAML file to the package.

Example fix

# mod.yaml (before)
Include: rules/extra.yaml   # file does not exist
# mod.yaml (after)
Include: rules/extras.yaml   # corrected path
Defensive patterns

Strategy: validation

Validate before calling

// Validate every Include target exists in the package before expansion.
foreach (var node in modYamlNodes.Where(n => n.Key == "Include"))
    if (package.GetStream(node.Value.Value) == null)
        throw new YamlException($"{node.Location}: Include target `{node.Value.Value}` not found in package.");

Prevention

When it happens

Trigger: Manifest constructor: iterating mod.yaml nodes, an 'Include' node whose Value (a filename) is not resolvable via package.GetStream, i.e. the included file is absent from the mod package.

Common situations: An Include references a file that was renamed, moved out of the package, or never committed; a typo in the include path; or an include meant for a different mod package.

Related errors


AI-assisted analysis of OpenRA/OpenRA@a520984d91 (2026-08-13). Data as JSON: /api/errors/0fc3c7078b18b811. Report an issue: GitHub.