1Panel-dev/1Panel · error · ValueError
missing-artifact
Error message
missing-artifact
What it means
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.
Source
Thrown at scripts/openresty-modules/diagnose-install.sh:277
pattern = re.compile(r"^\s*load_module\s+([^;]+);", re.MULTILINE)
failed = False
print("config\tcontainer_path\thost_path\tresult")
if config_root.exists():
for config in sorted(config_root.glob("1panel-module-*.conf")):
content = config.read_text(encoding="utf-8")
for value in pattern.findall(content):
container_path = value.strip().strip('"\'')
result = "OK"
host_path = ""
try:
if not container_path.startswith(container_prefix):
raise ValueError("unexpected-container-path")
relative = pathlib.PurePosixPath(container_path[len(container_prefix):])
if ".." in relative.parts:
raise ValueError("unsafe-path")
resolved = (modules_root / pathlib.Path(*relative.parts)).resolve(strict=True)
if modules_root not in resolved.parents or not resolved.is_file():
raise ValueError("missing-artifact")
host_path = str(resolved)
except Exception as error:
result = str(error)
failed = True
print("\t".join([config.name, container_path, host_path, result]))
sys.exit(1 if failed else 0)
PY
then
mark_passed "managed load_module configs"
else
mark_failed "managed load_module configs"
fi
}
collect_compose_state() {
local compose_file="${INSTALL_DIR}/docker-compose.yml"
if [[ ! -f "${compose_file}" ]]; then
mark_failed "docker-compose.yml is missing"View on GitHub (pinned to 5ac7c80881)
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
Example fix
# config references a removed module load_module /usr/local/bin/1panel/modules/resty/foo.so; # file absent # fix: either reinstall module, or remove the stale config rm conf.d/1panel-module-foo.conf
Defensive patterns
Strategy: validation
Validate before calling
python3 - <<'PY'
import pathlib, re
root = pathlib.Path('/opt/1panel/openresty/modules')
prefix = '/usr/local/bin/1panel/modules/'
for conf in pathlib.Path('/opt/1panel/apps/openresty/openresty/conf/conf.d').glob('1panel-module-*.conf'):
for m in re.findall(r'load_module\s+([^;]+);', conf.read_text()):
rel = pathlib.PurePosixPath(m.strip().strip('"\'')[len(prefix):])
assert (root/rel).is_file(), f'{conf.name}: {rel}'
print('all load_module targets present')
PY Prevention
- 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
When it happens
Trigger: 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.
Common situations: Module was removed while its 1panel-module-*.conf stayed behind; failed/partial module install; artifacts dir moved after config generation.
Related errors
AI-assisted analysis of 1Panel-dev/1Panel@5ac7c80881 (2026-08-15).
Data as JSON: /api/errors/ac0b6bc283b7e041.
Report an issue: GitHub.