{"record":{"id":"ed512ddba0cdf3a5","repo":"phacility/phabricator","slug":"no-storage-namespace-configured","errorCode":null,"errorMessage":"No storage namespace configured!","messagePattern":"No storage namespace configured!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/lisk/PhabricatorLiskDAO.php","lineNumber":46,"sourceCode":"  }\n\n  /**\n   * @task config\n   */\n  public static function getDefaultStorageNamespace() {\n    return PhabricatorEnv::getEnvConfig('storage.default-namespace');\n  }\n\n  /**\n   * @task config\n   */\n  public static function getStorageNamespace() {\n    $namespace = end(self::$namespaceStack);\n    if (!strlen($namespace)) {\n      $namespace = self::getDefaultStorageNamespace();\n    }\n    if ($namespace === null || !strlen($namespace)) {\n      throw new Exception(pht('No storage namespace configured!'));\n    }\n    return $namespace;\n  }\n\n  public function setForcedStorageNamespace($namespace) {\n    $this->forcedNamespace = $namespace;\n    return $this;\n  }\n\n  /**\n   * @task config\n   */\n  protected function establishLiveConnection($mode) {\n    $namespace = self::getStorageNamespace();\n    $database = $namespace.'_'.$this->getApplicationName();\n\n    $is_readonly = PhabricatorEnv::isReadOnly();\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php#L28-L64","documentation":"Every PhabricatorLiskDAO computes its database name from a storage namespace: a per-request stack (set for unit tests, shell tools, re-namespacing) falling back to the storage.default-namespace configuration. If the stack is empty and the configuration is null or empty, no database name can be built and the DAO refuses to continue with this Exception. It is a bootstrap/configuration failure, not a database failure.","triggerScenarios":"Using any DAO before PhabricatorEnv and configuration are initialized; a fresh install where storage.default-namespace was never set; scripts that include Lisk code without the standard Phabricator script bootstrap; a config file missing the key after hand-editing.","commonSituations":"New deployments that skipped setup; custom scripts, cron jobs, or tests invoking Lisk directly; config regenerated/restored without the storage keys; running tools with a config selection that resolves to nothing.","solutions":["Set the namespace: phabricator/bin/config set storage.default-namespace phabricator (or your chosen prefix)","Make sure scripts use the standard bootstrap (bin/init.php / PhabricatorEnv initialization) before touching DAOs","Verify the configuration actually loads: phabricator/bin/config get storage.default-namespace should print a non-empty value in the environment you run","For tests and tooling that must target a scratch database, push a namespace with setForcedStorageNamespace()/the namespace stack instead of leaving it empty"],"exampleFix":"# before: DAOs touched before configuration exists\n$ php my_script.php   # => No storage namespace configured!\n\n# after: set the default namespace, and bootstrap like other tools\nphabricator/bin/config set storage.default-namespace phabricator\n# my_script.php:\n#   require_once __DIR__.'/../__init_script__.php';","handlingStrategy":"validation","validationCode":"// At bootstrap, before any DAO use, confirm configuration is live:\nif (!strlen((string)PhabricatorEnv::getEnvConfig('storage.default-namespace'))) {\n  throw new Exception(\n    'storage.default-namespace is unset; run setup or set it via bin/config.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always enter through the standard Phabricator bootstrap (__init_script__.php) in custom scripts","Set storage.default-namespace as the first step of provisioning a new environment","For tests/tools targeting scratch databases, use setForcedStorageNamespace() / the namespace stack rather than leaving it empty","Smoke-test new environments with bin/storage probe before enabling traffic"],"tags":["configuration","storage-namespace","bootstrap","setup","lisk"],"backgroundTag":"missing-configuration","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}