{"record":{"id":"595d3c8ce2441238","repo":"HelloZeroNet/ZeroNet","slug":"optional-file-not-allowed-s","errorCode":null,"errorMessage":"Optional file not allowed: %s","messagePattern":"Optional file not allowed: (.+?)","errorType":"validation","errorClass":"VerifyError","httpStatus":null,"severity":"error","filePath":"src/Content/ContentManager.py","lineNumber":920,"sourceCode":"            if content_size > rules[\"max_size\"]:\n                raise VerifyError(\"Include too large %sB > %sB\" % (content_size, rules[\"max_size\"]))\n\n        if rules.get(\"max_size_optional\") is not None:  # Include optional files limit\n            if content_size_optional > rules[\"max_size_optional\"]:\n                raise VerifyError(\"Include optional files too large %sB > %sB\" % (\n                    content_size_optional, rules[\"max_size_optional\"])\n                )\n\n        # Filename limit\n        if rules.get(\"files_allowed\"):\n            for file_inner_path in list(content[\"files\"].keys()):\n                if not SafeRe.match(r\"^%s$\" % rules[\"files_allowed\"], file_inner_path):\n                    raise VerifyError(\"File not allowed: %s\" % file_inner_path)\n\n        if rules.get(\"files_allowed_optional\"):\n            for file_inner_path in list(content.get(\"files_optional\", {}).keys()):\n                if not SafeRe.match(r\"^%s$\" % rules[\"files_allowed_optional\"], file_inner_path):\n                    raise VerifyError(\"Optional file not allowed: %s\" % file_inner_path)\n\n        # Check if content includes allowed\n        if rules.get(\"includes_allowed\") is False and content.get(\"includes\"):\n            raise VerifyError(\"Includes not allowed\")\n\n        return True  # All good\n\n    # Verify file validity\n    # Return: None = Same as before, False = Invalid, True = Valid\n    def verifyFile(self, inner_path, file, ignore_same=True):\n        if inner_path.endswith(\"content.json\"):  # content.json: Check using sign\n            from Crypt import CryptBitcoin\n            try:\n                if type(file) is dict:\n                    new_content = file\n                else:\n                    try:\n                        if sys.version_info.major == 3 and sys.version_info.minor < 6:","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/src/Content/ContentManager.py#L902-L938","documentation":"VerifyError raised in verifyContentInclude when the total size of optional files in the include exceeds the parent rules' max_size_optional limit. The input at fault is content_size_optional being larger than the declared cap, so the include is rejected during content verification.","triggerScenarios":"Thrown at src/Content/ContentManager.py:920 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shrink or remove optional files until the total fits within max_size_optional","Raise max_size_optional in the parent content.json rules and re-sign if larger optional content is intended","Catch VerifyError and surface which include failed size validation"],"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"}