Page MenuHomePhabricator

Diviner fails to create all books, path is error
Open, Needs TriagePublic

Description

COMMAND
'/phab/web/www/phabricator/bin/diviner' atomize --ugly --book 'phabricator/src/docs/book/phabricator.book' --atomizer 'DivinerPHPAtomizer' -- 'src/view/control/AphrontTokenizerTemplateView.php' 'src/view/control/AphrontCursorPagerView.php' 'src/view/control/AphrontTypeaheadTemplateView.php' 'src/view/control/AphrontTableView.php' 'src/view/control/PhabricatorObjectSelectorDialog.php' 'src/view/page/PhabricatorStandardPageView.php' 'src/view/page/menu/PhabricatorMainMenuSearchView.php' 'src/view/page/menu/PhabricatorMainMenuView.php' 'src/view/page/PhabricatorBarePageView.php' 'src/view/page/AphrontPageView.php' 'src/view/form/PHUIFormPageView.php' 'src/view/form/PHUIFormInsetView.php' 'src/view/form/AphrontFormView.php' 'src/view/form/control/AphrontFormTypeaheadControl.php' 'src/view/form/control/PhabricatorRemarkupControl.php' 'src/view/form/control/AphrontFormTextControl.php' 'src/view/form/control/AphrontFormDividerControl.php' 'src/view/form/control/AphrontFormSubmitControl.php' '... (771 more bytes) ...

STDOUT
(empty)

STDERR
[2015-08-03 10:37:46] EXCEPTION: (FilesystemException) File system entity `/phab/web/www/phabricator/phabricator/src/docs/book/phabricator.book' does not exist. at [<phutil>/src/filesystem/Filesystem.php:1006]
arcanist(head=stable, ref.master=0d6f3328a08f, ref.stable=5fcf7b5a3b9e), phabricator(head=stable, ref.stable=535c1a5f255e), phutil(head=stable, ref.master=aa6cd8f7e5e5, ref.stable=aa6cd8f7e5e5)

#0 Filesystem::assertExists(string) called at [<phutil>/src/filesystem/Filesystem.php:37]
#1 Filesystem::readFile(string) called at [<phabricator>/src/applications/diviner/workflow/DivinerWorkflow.php:28]
#2 DivinerWorkflow::readBookConfiguration(string) called at [<phabricator>/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php:33]
#3 DivinerAtomizeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
#4 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.ph... (113 more bytes) ... at [<phutil>/src/future/exec/ExecFuture.php:416]

arcanist(head=stable, ref.master=0d6f3328a08f, ref.stable=5fcf7b5a3b9e), phabricator(head=stable, ref.stable=535c1a5f255e), phutil(head=stable, ref.master=aa6cd8f7e5e5, ref.stable=aa6cd8f7e5e5)

#0 <#2> ExecFuture::resolvex(NULL) called at [<phutil>/src/future/exec/ExecFuture.php:438]
#1 <#2> ExecFuture::resolveJSON() called at [<phabricator>/src/applications/diviner/workflow/DivinerGenerateWorkflow.php:390]
#2 phlog(CommandException) called at [<phabricator>/src/applications/diviner/workflow/DivinerGenerateWorkflow.php:400]
#3 DivinerGenerateWorkflow::resolveAtomizerFutures(array, array) called at [<phabricator>/src/applications/diviner/workflow/DivinerGenerateWorkflow.php:249]
#4 DivinerGenerateWorkflow::buildAtomCache() called at [<phabricator>/src/applications/diviner/workflow/DivinerGenerateWorkflow.php:176]
#5 DivinerGenerateWorkflow::generateBook(string, PhutilArgumentParser) called at [<phabricator>/src/applications/diviner/workflow/DivinerGenerateWorkflow.php:80]
#6 DivinerGenerateWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
#7 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
#8 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/diviner/diviner.php:21]

[2015-08-03 10:37:46] EXCEPTION: (CommandException) Command failed with error #255!
COMMAND
'/phab/web/www/phabricator/bin/diviner' atomize --ugly --book 'phabricator/src/docs/book/phabricator.book' --atomizer 'DivinerPHPAtomizer' -- 'src/view/form/control/AphrontFormControl.php' 'src/view/form/control/AphrontFormPolicyControl.php' 'src/view/form/control/AphrontFormMarkupControl.php' 'src/view/form/control/AphrontFormTextAreaControl.php' 'src/view/form/control/AphrontFormStaticControl.php' 'src/view/form/PHUIFormLayoutView.php' 'src/view/form/PHUIPagedFormView.php' 'src/view/form/PHUIInfoView.php' 'src/view/AphrontTagView.php' 'src/view/viewutils.php' 'src/__tests__/PhabricatorConduitTestCase.php' 'src/__tests__/PhabricatorCelerityTestCase.php' 'src/__tests__/PhabricatorLibraryTestCase.php' 'src/__tests__/PhabricatorInfrastructureTestCase.php' 'src/__phutil_library_init.php' 'src/infrastructure/query/order/tests__/PhabricatorQueryOrderTestCase.php' 'src/infrastructure/query/order/PhabricatorQueryOrderVector.php' 'src/infrastructure/query/order/PhabricatorQueryOrderItem.ph... (882 more bytes) ...

Event Timeline

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

bin/diviner generate works for me, what specific command are you running?

just running the bin/diviner generate
it seems the path is error

`/phab/web/www/phabricator/phabricator/src/docs/book/phabricator.book'

should be

`/phab/web/www/phabricator/src/docs/book/phabricator.book'

I'm not able to reproduce that error

it seems "./bin/diviner generate" can work

but

"./phabricator/bin/diviner gerenate" fails

So the current directory path matters.

./bin/diviner generate

will find 4 books and works well
contributor.book flavor.book phabricator.book user.book

./phabricator/bin/diviner generate

will find 6 books and fails.

This comment was removed by lianghu.

I see the same behavior noted by @lianghu in T9042#129510.

It seems that diviner generate must be run from within the root of the Phabricator install. This is a bit counterintuitive, as so far every other tool in bin/ is happy when run outside the Phabricator root.

The issue is further compounded by the errors not being terribly helpful as when generate is run from outside the Phabricator root, the final path element before src/ for each book is duplicated. This creates a red herring while searching for the cause.

(For a quick and easy way to demonstrate the problem, try prepending the full path to bin/ to your $PATH and then run diviner generate from $HOME. Assuming that the home directory isn’t your Phabricator root, you should see the errors.)