{"record":{"id":"6d1f6931a1ab5a7c","repo":"1Panel-dev/1Panel","slug":"checksum-mismatch","errorCode":null,"errorMessage":"checksum-mismatch","messagePattern":"checksum-mismatch","errorType":"console","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/openresty-modules/diagnose-install.sh","lineNumber":232,"sourceCode":"            try:\n                pure = pathlib.PurePosixPath(relative)\n                if not relative or pure.is_absolute() or \"..\" in pure.parts or \"\\\\\" in relative:\n                    raise ValueError(\"unsafe-path\")\n                candidate = modules_root / pathlib.Path(*pure.parts)\n                if candidate.is_symlink():\n                    raise ValueError(\"symlink-not-allowed\")\n                full_path = candidate.resolve(strict=True)\n                if modules_root not in full_path.parents:\n                    raise ValueError(\"outside-module-root\")\n                if not full_path.is_file():\n                    raise ValueError(\"not-regular-file\")\n                digest = hashlib.sha256()\n                with full_path.open(\"rb\") as handle:\n                    for chunk in iter(lambda: handle.read(1024 * 1024), b\"\"):\n                        digest.update(chunk)\n                actual = digest.hexdigest()\n                if actual.lower() != expected.lower():\n                    raise ValueError(\"checksum-mismatch\")\n            except Exception as error:\n                result = str(error)\n                failed = True\n            print(\"\\t\".join([\n                module.get(\"name\", \"\"), build.get(\"status\", \"\"), target_key,\n                relative, expected, actual, result,\n            ]))\nsys.exit(1 if failed else 0)\nPY\n    then\n        mark_passed \"artifact paths and checksums\"\n    else\n        mark_failed \"artifact paths or checksums\"\n    fi\n}\n\nvalidate_managed_configs() {\n    if python3 - \"${INSTALL_DIR}/conf/modules-enabled\" \"${INSTALL_DIR}/modules\" \\","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/1Panel-dev/1Panel/blob/5ac7c808815b0691009cd390414f03471312262f/scripts/openresty-modules/diagnose-install.sh#L214-L250","documentation":"Raised when the SHA-256 of the artifact file (computed in 1 MiB chunks) does not match, case-insensitively, the 'checksum' recorded in the manifest. It means the file on disk is not the bytes the build produced: truncated download, partial write, wrong version, or bit rot.","triggerScenarios":"diagnose-install.sh iterates build.artifacts, hashes modules_root/<path>, and actual.lower() != expected.lower() — e.g. a half-written .so after an interrupted install, or an artifact replaced by a different build of the same name.","commonSituations":"Interrupted upgrade (out of disk during unpack); a module recompiled locally with different flags but the manifest kept the CI checksum; download proxy corrupted the tarball; case mismatch is tolerated so that part is not the cause.","solutions":["Re-download/reinstall the module artifact from the trusted source so the file matches the manifest checksum (sha256sum <file> to confirm)","If the file was rebuilt intentionally, regenerate the manifest checksum from the new artifact","Check disk space and filesystem health if corruption recurs (df -h; dmesg | tail)"],"exampleFix":"# before: file on disk mismatches manifest\nsha256sum modules/resty/http.so   # a1b2...\n# after: reinstall from trusted source\n1pctl reinstall openresty-module <name>   # or restore artifact, then\nsha256sum modules/resty/http.so   # must equal manifest checksum","handlingStrategy":"validation","validationCode":"python3 -c \"import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())\" <modules_root>/<path>  # compare to manifest checksum","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Checksum artifacts at build time and re-verify right after download/copy","Make installs atomic: download to temp, verify, then rename into the modules root"],"tags":["checksum","integrity","sha256","openresty"],"backgroundTag":null,"analyzedSha":"5ac7c808815b0691009cd390414f03471312262f","analyzedAt":"2026-08-15T14:02:06.953Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}