HelloZeroNet/ZeroNet · error · VerifyError

Optional file not allowed: %s

Error message

Optional file not allowed: %s

What it means

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.

Source

Thrown at src/Content/ContentManager.py:920

            if content_size > rules["max_size"]:
                raise VerifyError("Include too large %sB > %sB" % (content_size, rules["max_size"]))

        if rules.get("max_size_optional") is not None:  # Include optional files limit
            if content_size_optional > rules["max_size_optional"]:
                raise VerifyError("Include optional files too large %sB > %sB" % (
                    content_size_optional, rules["max_size_optional"])
                )

        # Filename limit
        if rules.get("files_allowed"):
            for file_inner_path in list(content["files"].keys()):
                if not SafeRe.match(r"^%s$" % rules["files_allowed"], file_inner_path):
                    raise VerifyError("File not allowed: %s" % file_inner_path)

        if rules.get("files_allowed_optional"):
            for file_inner_path in list(content.get("files_optional", {}).keys()):
                if not SafeRe.match(r"^%s$" % rules["files_allowed_optional"], file_inner_path):
                    raise VerifyError("Optional file not allowed: %s" % file_inner_path)

        # Check if content includes allowed
        if rules.get("includes_allowed") is False and content.get("includes"):
            raise VerifyError("Includes not allowed")

        return True  # All good

    # Verify file validity
    # Return: None = Same as before, False = Invalid, True = Valid
    def verifyFile(self, inner_path, file, ignore_same=True):
        if inner_path.endswith("content.json"):  # content.json: Check using sign
            from Crypt import CryptBitcoin
            try:
                if type(file) is dict:
                    new_content = file
                else:
                    try:
                        if sys.version_info.major == 3 and sys.version_info.minor < 6:

View on GitHub (pinned to 454c0b2e7e)

Solutions

  1. Shrink or remove optional files until the total fits within max_size_optional
  2. Raise max_size_optional in the parent content.json rules and re-sign if larger optional content is intended
  3. Catch VerifyError and surface which include failed size validation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/Content/ContentManager.py:920 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HelloZeroNet/ZeroNet@454c0b2e7e (2026-09-02). Data as JSON: /api/errors/595d3c8ce2441238. Report an issue: GitHub.