Page MenuHomePhabricator

Repository import daemon repeatedly crashes and restarts if phabricator.base-uri is not configured
Closed, ResolvedPublic

Description

When importing a repository, if you have no phabricator.base-uri configured, then the repository remains on "Importing" status and seems quite happy (although seemingly making no progress), despite the log showing that the daemon is repeatedly crashing and restarting. This crashing stopped (and my import completion percent started to rise above 0.00%) as soon as I ran the suggested command to fix phabricator.base-uri. From bin/phd log:

Daemon 4 WAIT [Tue, 30 Dec 2014 05:49:56 +0000] Waiting to restart process.
Daemon 3 INIT [Tue, 30 Dec 2014 05:49:56 +0000] Starting process.
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000] [2014-12-30 05:49:57] EXCEPTION: (PhutilProxyException) Error while executing task ID 741 from queue. {>} (Exception) Define 'phabricator.base-uri' in your configuration to continue. at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:386]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #0 PhabricatorEnv::getAnyBaseURI() called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:317]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #1 PhabricatorEnv::getProductionURI(string) called at [<phabricator>/src/applications/differential/conduit/DifferentialParseCommitMessageConduitAPIMethod.php:89]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #2 DifferentialParseCommitMessageConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:65]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #3 ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:130]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #4 ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:80]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #5 ConduitCall::execute() called at [<phabricator>/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php:41]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #6 DiffusionLowLevelCommitFieldsQuery::executeQuery() called at [<phabricator>/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php:23]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #7 DiffusionLowLevelQuery::execute() called at [<phabricator>/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php:63]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #8 PhabricatorRepositoryCommitMessageParserWorker::updateCommitData(DiffusionCommitRef) called at [<phabricator>/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php:15]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #9 PhabricatorRepositoryGitCommitMessageParserWorker::parseCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:44]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #10 PhabricatorRepositoryCommitParserWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:91]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #11 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:156]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #12 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #13 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:91]
Daemon 3 STDE [Tue, 30 Dec 2014 05:49:57 +0000]   #14 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]
Daemon 3 FAIL [Tue, 30 Dec 2014 05:49:57 +0000] (255) Process exited with error 255.
Daemon 3 WAIT [Tue, 30 Dec 2014 05:49:57 +0000] Waiting to restart process.

I think this is a valid issue, but if it's not because I didn't bother to set up my local test instance properly then I wouldn't be too surprised.

Event Timeline

Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair added a project: Repositories.
Krenair updated the task description. (Show Details)
Krenair added a subscriber: Krenair.

The text shown in the unresolved setup issues was "The base URI for this install is not configured. Configuring it will improve security and enable features." - I would expect it to tell me that this needs to be set up before I can import a repository, not silently fail in the background.

base_uri breaks lots of random things, which is why we ask you to set it (though some people use it fine without, in limited ability). The full setup message also states scripts and daemons will likely have issues.

https://github.com/phacility/phabricator/blob/63ce0e66c926222a5a805d5199c8ea98cc4bc129/src/applications/config/check/PhabricatorSetupCheckBaseURI.php#L37

Specifically, one of the features that will be enabled is repository imports.

I'll make the setup warning more severe, but it's expected that you need to configure this before using an install to do anything meaningful.

Possibly we should just prevent the daemons from launching if this isn't defined, although maybe that's too severe. We could look at that if more users run into trouble.

We could also think about making setup warnings have a few more severity levels. Right now there are effectively two levels: "fatal" errors like "unable to connect to database" (which use the "setup error" UI, block progress, and must be resolved) and all other errors.

I think setup checks have been really successful, though, and we now have a ton of them, including some which are fairly advisory (e.g., all the search configuration stuff and things like "install pygments for syntax highlighting"). We could separate them into "Important" (like this one) and "Advisory" or similar, if users are hitting too many warnings and having a hard time figuring out which ones are most important to resolve. I'm not sure if that's the case here.

I still had this problem, in a fresh install. Had to run

./bin/config set phabricator.base-uri 'http://phab.localhost/'