{"record":{"id":"d5bd4229cfd6ccf0","repo":"podman-container-tools/podman","slug":"please-invoke-me-from-the-base-repo-dir","errorCode":null,"errorMessage":"Please invoke me from the base repo dir","messagePattern":"Please invoke me from the base repo dir","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"hack/markdown-preprocess","lineNumber":280,"sourceCode":"            # 'pod' not in lhs, must be in rhs\n            if not re.match('.*pod([^m]|$)', rhs, re.IGNORECASE):\n                raise Exception(f\"'{matchobj[0]}' does not match 'pod' in either side\")\n            if self.pod_or_container == 'pod':\n                return rhs\n            return lhs\n\n        return re.sub(r'<<[^\\|>]*\\|[^\\|>]*>>', replwith, line)\n\n\ndef main():\n    \"script entry point\"\n    script_dir = os.path.abspath(os.path.dirname(__file__))\n    man_dir = os.path.join(script_dir,\"../docs/source/markdown\")\n\n    try:\n        os.chdir(man_dir)\n    except FileNotFoundError as ex:\n        raise Exception(\"Please invoke me from the base repo dir\") from ex\n\n    # No longer possible to invoke us with args: reject any such invocation\n    if len(sys.argv) > 1:\n        raise Exception(\"This script accepts no arguments\")\n\n    preprocessor = Preprocessor()\n    for infile in sorted(glob.glob('*.md.in')):\n        preprocessor.process(infile)\n\n    # Now rewrite all option files\n    preprocessor.rewrite_optionfiles()\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":262,"sourceCodeEnd":295,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/hack/markdown-preprocess#L262-L295","documentation":"Raised by main() when os.chdir(script_dir/../docs/source/markdown) raises FileNotFoundError — the man-page directory next to the script's own location does not exist. Despite the message wording, the check is based on the script's __file__ location, not on the caller's current working directory: the script needs a complete checkout where hack/ and docs/source/markdown/ are siblings. Running a copied/relocated script or a partial archive triggers it.","triggerScenarios":"Invoking hack/markdown-preprocess from a tarball or sparse checkout that omitted docs/source/markdown; moving or symlinking the script out of the repo; running it after docs/ was renamed; filesystem case-sensitivity mismatches on case-insensitive mounts.","commonSituations":"Packagers or CI jobs trying to run the script standalone from an installed location; contributors with partial clones (e.g. sparse-checkout without docs); accidental execution from a vendored copy of hack/ inside another tree.","solutions":["Run from a full clone of the containers/podman repo, where hack/markdown-preprocess sits next to docs/source/markdown","Restore the missing directory: git checkout HEAD -- docs/source/markdown or disable sparse-checkout for it","Confirm layout: test -d \"$(dirname $(realpath hack/markdown-preprocess))/../docs/source/markdown\""],"exampleFix":"# before\ncp hack/markdown-preprocess /tmp/ && cd /tmp && ./markdown-preprocess\n\n# after\ngit clone https://github.com/containers/podman && cd podman && ./hack/markdown-preprocess","handlingStrategy":"validation","validationCode":"#!/bin/sh\n# Verify repo layout relative to the script before invoking it\nscript=$(realpath \"$1\" 2>/dev/null || echo hack/markdown-preprocess)\nmandir=$(dirname \"$script\")/../docs/source/markdown\n[ -d \"$mandir\" ] || { echo \"missing $mandir — use a full podman checkout\" >&2; exit 1; }\nexec \"$script\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the script only from a full clone of containers/podman where hack/ and docs/source/markdown are siblings","In CI, clone with full depth/sparse patterns that include docs/source/markdown","The check keys off the script's own path, not your cwd — copying the script elsewhere will always fail"],"tags":["docs","build","repo-layout"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}