1Panel-dev/1Panel · error · ValueError

not-regular-file

Error message

not-regular-file

What it means

Raised when the resolved path exists and is inside the modules root but is not a regular file (full_path.is_file() is false): it is a directory, fifo, socket, device, or was deleted between resolve and the check.

Source

Thrown at scripts/openresty-modules/diagnose-install.sh:225

    for build in module.get("builds") or []:
        target_key = (build.get("target") or {}).get("key", "")
        for artifact in build.get("artifacts") or []:
            relative = artifact.get("path", "")
            expected = artifact.get("checksum", "")
            result = "OK"
            actual = ""
            try:
                pure = pathlib.PurePosixPath(relative)
                if not relative or pure.is_absolute() or ".." in pure.parts or "\\" in relative:
                    raise ValueError("unsafe-path")
                candidate = modules_root / pathlib.Path(*pure.parts)
                if candidate.is_symlink():
                    raise ValueError("symlink-not-allowed")
                full_path = candidate.resolve(strict=True)
                if modules_root not in full_path.parents:
                    raise ValueError("outside-module-root")
                if not full_path.is_file():
                    raise ValueError("not-regular-file")
                digest = hashlib.sha256()
                with full_path.open("rb") as handle:
                    for chunk in iter(lambda: handle.read(1024 * 1024), b""):
                        digest.update(chunk)
                actual = digest.hexdigest()
                if actual.lower() != expected.lower():
                    raise ValueError("checksum-mismatch")
            except Exception as error:
                result = str(error)
                failed = True
            print("\t".join([
                module.get("name", ""), build.get("status", ""), target_key,
                relative, expected, actual, result,
            ]))
sys.exit(1 if failed else 0)
PY
    then
        mark_passed "artifact paths and checksums"

View on GitHub (pinned to 5ac7c80881)

Solutions

  1. Point the manifest entry at the actual module file (the .so/.lua file), not its directory
  2. Rebuild the module so the real artifact is produced under the modules root, then re-run diagnose-install.sh
  3. If it is intermittent, stop concurrent openresty upgrade/clean jobs before diagnosing

Example fix

// manifest before
{"path": "lua/resty/http", "checksum": "..."}
// manifest after
{"path": "lua/resty/http.lua", "checksum": "..."}
Defensive patterns

Strategy: validation

Validate before calling

python3 -c "import pathlib; p=pathlib.Path('/opt/1panel/openresty/modules')/artifact_rel; assert p.is_file(), p"

Prevention

When it happens

Trigger: A manifest artifact 'path' names a directory (e.g. 'lua/lib'); the artifact is a unix socket or fifo; a concurrent cleanup removed the file after resolve(strict=True) succeeded.

Common situations: Manifest recorded the output directory instead of the .so file; a failed build left only directories; another process (upgrader, cleaner) raced the diagnostic.

Related errors


AI-assisted analysis of 1Panel-dev/1Panel@5ac7c80881 (2026-08-15). Data as JSON: /api/errors/507a6dc081a2a7d6. Report an issue: GitHub.