{"record":{"id":"b9a3befca2909626","repo":"phacility/phabricator","slug":"define-s-in-your-configuration-to-continue","errorCode":null,"errorMessage":"Define '%s' in your configuration to continue.","messagePattern":"Define '(.+?)' in your configuration to continue\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/env/PhabricatorEnv.php","lineNumber":523,"sourceCode":"  /**\n   * Build a concrete object from a configuration key.\n   *\n   * @task read\n   */\n  public static function newObjectFromConfig($key, $args = array()) {\n    $class = self::getEnvConfig($key);\n    return newv($class, $args);\n  }\n\n  public static function getAnyBaseURI() {\n    $base_uri = self::getEnvConfig('phabricator.base-uri');\n\n    if (!$base_uri) {\n      $base_uri = self::getRequestBaseURI();\n    }\n\n    if (!$base_uri) {\n      throw new Exception(\n        pht(\n          \"Define '%s' in your configuration to continue.\",\n          'phabricator.base-uri'));\n    }\n\n    return $base_uri;\n  }\n\n  public static function getRequestBaseURI() {\n    return self::$requestBaseURI;\n  }\n\n  public static function setRequestBaseURI($uri) {\n    self::$requestBaseURI = $uri;\n  }\n\n  public static function isReadOnly() {\n    if (self::$readOnly !== null) {","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/env/PhabricatorEnv.php#L505-L541","documentation":"PhabricatorEnv::getAnyBaseURI() returns the canonical instance URI used to build absolute links from daemons, CLI tools, and mail. It first reads the `phabricator.base-uri` config; if empty it falls back to a request-scoped base URI; with neither set it throws, because generating correct absolute URIs is impossible. Most commonly hit from contexts that have no HTTP request (workers, mail rendering, bin scripts).","triggerScenarios":"Running a daemon, worker task, or bin script (e.g. ./bin/mail render-test, or any code path calling PhabricatorEnv::getAnyBaseURI()) on an instance where `phabricator.base-uri` was never set and the fallback PhabricatorEnv::getRequestBaseURI() (set only during a web request) is null.","commonSituations":"Fresh installs that skipped the base-URI step and work fine in the browser (request fallback covers web) until the first mail or background task runs; multi-environment setups where local.json was cleared; Puppet/Chef provisioning that forgets this key.","solutions":["Set the config: `./bin/config set phabricator.base-uri 'https://phab.example.com/'` (scheme + host + trailing slash, matching how users reach the install).","If it is already set, check for a typo'd key or a config source that overrides it back to empty: `./bin/config get phabricator.base-uri` shows the effective value and its source.","Restart daemons after fixing so long-running workers pick up the new config."],"exampleFix":"# before: nothing set, daemon/mail generation fails\n$ ./bin/mail render-test --to admin ...\nException: Define 'phabricator.base-uri' in your configuration to continue.\n\n# after\n$ ./bin/config set phabricator.base-uri 'https://phab.example.com/'\n$ ./bin/phd restart","handlingStrategy":"validation","validationCode":"if (!PhabricatorEnv::getEnvConfig('phabricator.base-uri')) {\n  die('Set phabricator.base-uri before running this script.\\n');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make phabricator.base-uri step one of every install and every restore.","Include the key in your provisioning manifests; assert it in deploy pre-flight (./bin/config get phabricator.base-uri is non-empty).","Remember the web UI works without it (request fallback) - test daemons and mail too."],"tags":["phabricator","config","base-uri","environment","daemons","cli"],"backgroundTag":"missing-base-url-config","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}