{"record":{"id":"ac0b6bc283b7e041","repo":"1Panel-dev/1Panel","slug":"missing-artifact","errorCode":null,"errorMessage":"missing-artifact","messagePattern":"missing-artifact","errorType":"console","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/openresty-modules/diagnose-install.sh","lineNumber":277,"sourceCode":"pattern = re.compile(r\"^\\s*load_module\\s+([^;]+);\", re.MULTILINE)\nfailed = False\nprint(\"config\\tcontainer_path\\thost_path\\tresult\")\nif config_root.exists():\n    for config in sorted(config_root.glob(\"1panel-module-*.conf\")):\n        content = config.read_text(encoding=\"utf-8\")\n        for value in pattern.findall(content):\n            container_path = value.strip().strip('\"\\'')\n            result = \"OK\"\n            host_path = \"\"\n            try:\n                if not container_path.startswith(container_prefix):\n                    raise ValueError(\"unexpected-container-path\")\n                relative = pathlib.PurePosixPath(container_path[len(container_prefix):])\n                if \"..\" in relative.parts:\n                    raise ValueError(\"unsafe-path\")\n                resolved = (modules_root / pathlib.Path(*relative.parts)).resolve(strict=True)\n                if modules_root not in resolved.parents or not resolved.is_file():\n                    raise ValueError(\"missing-artifact\")\n                host_path = str(resolved)\n            except Exception as error:\n                result = str(error)\n                failed = True\n            print(\"\\t\".join([config.name, container_path, host_path, result]))\nsys.exit(1 if failed else 0)\nPY\n    then\n        mark_passed \"managed load_module configs\"\n    else\n        mark_failed \"managed load_module configs\"\n    fi\n}\n\ncollect_compose_state() {\n    local compose_file=\"${INSTALL_DIR}/docker-compose.yml\"\n    if [[ ! -f \"${compose_file}\" ]]; then\n        mark_failed \"docker-compose.yml is missing\"","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/1Panel-dev/1Panel/blob/5ac7c808815b0691009cd390414f03471312262f/scripts/openresty-modules/diagnose-install.sh#L259-L295","documentation":"Raised when a managed config's load_module path passes the prefix and traversal checks but the resolved host file is missing, outside the modules root, or not a regular file (resolve(strict=True) raises FileNotFoundError for missing paths, or the parents/is_file guard fails). It links config expectations to artifacts that should exist.","triggerScenarios":"load_module points at <prefix>/resty/foo.so but modules_root/resty/foo.so does not exist (module never installed, uninstalled, or upgrade removed it); also when an intermediate symlink resolves the file outside modules_root.","commonSituations":"Module was removed while its 1panel-module-*.conf stayed behind; failed/partial module install; artifacts dir moved after config generation.","solutions":["Reinstall the module through 1Panel so the artifact is restored under the modules root","Or, if the module is intentionally gone, delete its stale 1panel-module-*.conf so nginx stops loading it","Verify with: ls <modules_root>/<relative path from the config> and check it is a regular file inside the root"],"exampleFix":"# config references a removed module\nload_module /usr/local/bin/1panel/modules/resty/foo.so;  # file absent\n# fix: either reinstall module, or remove the stale config\nrm conf.d/1panel-module-foo.conf","handlingStrategy":"validation","validationCode":"python3 - <<'PY'\nimport pathlib, re\nroot = pathlib.Path('/opt/1panel/openresty/modules')\nprefix = '/usr/local/bin/1panel/modules/'\nfor conf in pathlib.Path('/opt/1panel/apps/openresty/openresty/conf/conf.d').glob('1panel-module-*.conf'):\n    for m in re.findall(r'load_module\\s+([^;]+);', conf.read_text()):\n        rel = pathlib.PurePosixPath(m.strip().strip('\"\\'')[len(prefix):])\n        assert (root/rel).is_file(), f'{conf.name}: {rel}'\nprint('all load_module targets present')\nPY","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete a module's managed config together with its artifacts (uninstall, not rm -rf)","After upgrades, re-run diagnose-install.sh to catch stale references"],"tags":["nginx","missing-file","openresty","load-module"],"backgroundTag":null,"analyzedSha":"5ac7c808815b0691009cd390414f03471312262f","analyzedAt":"2026-08-15T14:02:06.953Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}