{"record":{"id":"1677c38eacfade9f","repo":"HelloZeroNet/ZeroNet","slug":"file-not-in-content-json","errorCode":null,"errorMessage":"File not in content.json","messagePattern":"File not in content\\.json","errorType":"validation","errorClass":"VerifyError","httpStatus":null,"severity":"error","filePath":"src/Content/ContentManager.py","lineNumber":1023,"sourceCode":"                self.log.warning(\"%s: verify sign error: %s\" % (inner_path, Debug.formatException(err)))\n                raise err\n\n        else:  # Check using sha512 hash\n            file_info = self.getFileInfo(inner_path)\n            if file_info:\n                if CryptHash.sha512sum(file) != file_info.get(\"sha512\", \"\"):\n                    raise VerifyError(\"Invalid hash\")\n\n                if file_info.get(\"size\", 0) != file.tell():\n                    raise VerifyError(\n                        \"File size does not match %s <> %s\" %\n                        (inner_path, file.tell(), file_info.get(\"size\", 0))\n                    )\n\n                return True\n\n            else:  # File not in content.json\n                raise VerifyError(\"File not in content.json\")\n\n    def optionalDelete(self, inner_path):\n        self.site.storage.delete(inner_path)\n\n    def optionalDownloaded(self, inner_path, hash_id, size=None, own=False):\n        if size is None:\n            size = self.site.storage.getSize(inner_path)\n\n        done = self.hashfield.appendHashId(hash_id)\n        self.site.settings[\"optional_downloaded\"] += size\n        return done\n\n    def optionalRemoved(self, inner_path, hash_id, size=None):\n        if size is None:\n            size = self.site.storage.getSize(inner_path)\n        done = self.hashfield.removeHashId(hash_id)\n\n        self.site.settings[\"optional_downloaded\"] -= size","sourceCodeStart":1005,"sourceCodeEnd":1041,"githubUrl":"https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/src/Content/ContentManager.py#L1005-L1041","documentation":"VerifyError raised in verifyFile when getFileInfo(inner_path) returns None, i.e. the file being verified is not listed in the site's content.json. The input at fault is an inner_path with no manifest entry, so there is no hash/size to verify against and the file cannot be trusted.","triggerScenarios":"Thrown at src/Content/ContentManager.py:1023 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the inner_path is correct and actually listed in content.json before calling verifyFile","Add the file to content.json (and re-sign) if it is a legitimate new site file","Treat unlisted files as untrusted: delete them or refuse to serve them"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"454c0b2e7e000fda7000cba49027541fbf327b96","analyzedAt":"2026-09-02T19:46:57.278Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}