{"record":{"id":"bc23a0cb419aaa66","repo":"HelloZeroNet/ZeroNet","slug":"directory-not-exists-s","errorCode":null,"errorMessage":"Directory not exists: %s","messagePattern":"Directory not exists: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Site/SiteStorage.py","lineNumber":44,"sourceCode":"\n\n@PluginManager.acceptPlugins\nclass SiteStorage(object):\n    def __init__(self, site, allow_create=True):\n        self.site = site\n        self.directory = \"%s/%s\" % (config.data_dir, self.site.address)  # Site data diretory\n        self.allowed_dir = os.path.abspath(self.directory)  # Only serve file within this dir\n        self.log = site.log\n        self.db = None  # Db class\n        self.db_checked = False  # Checked db tables since startup\n        self.event_db_busy = None  # Gevent AsyncResult if db is working on rebuild\n        self.has_db = self.isFile(\"dbschema.json\")  # The site has schema\n\n        if not os.path.isdir(self.directory):\n            if allow_create:\n                os.mkdir(self.directory)  # Create directory if not found\n            else:\n                raise Exception(\"Directory not exists: %s\" % self.directory)\n\n    def getDbFile(self):\n        if self.db:\n            return self.db.schema[\"db_file\"]\n        else:\n            if self.isFile(\"dbschema.json\"):\n                schema = self.loadJson(\"dbschema.json\")\n                return schema[\"db_file\"]\n            else:\n                return False\n\n    # Create new databaseobject  with the site's schema\n    def openDb(self, close_idle=False):\n        schema = self.getDbSchema()\n        db_path = self.getPath(schema[\"db_file\"])\n        return Db(schema, db_path, close_idle=close_idle)\n\n    def closeDb(self, reason=\"Unknown (SiteStorage)\"):","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/src/Site/SiteStorage.py#L26-L62","documentation":"Guard raised by SiteStorage.__init__ when the site's data directory (config.data_dir/<address>) does not exist on disk and creation is not allowed. The input at fault is the site address whose expected directory is missing, typically after deletion or a data-dir misconfiguration.","triggerScenarios":"Thrown at src/Site/SiteStorage.py:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the site directory or re-download the site so data/<address> exists","Pass allow_create=True when SiteStorage is constructed for a new site","Verify config.data_dir points to the correct location before touching site storage"],"exampleFix":null,"handlingStrategy":"fallback","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"}