Page MenuHomePhabricator

Diffusion "Locate File" typeahead silently failing
Closed, ResolvedPublic


The Locate File typehead is not working on my install here at work. I began investigating and noticed that the ajax call that is initially fired off was returning the following error:

for (;;);{"error":{"code":"CommandException","info":"Command failed with error #-1!\nCOMMAND\ngit ls-tree --name-only -r -z '6449f413a2f9c1a0c9de4fc7a30fa4e94aa7f102' -- ''\n\nSTDOUT\nunctions\u0000lib\/external\/phpexcel\/Classes\/PHPExcel\/locale\/sv\/config\u0000lib\/external\/phpexcel\/Classes\/PHPExcel\/locale\/sv\/functions\u0000lib\/funcs.php\u0000lib\/js\/.htaccess\u0000lib\/js\/XPath.js\u0000lib\/js\/api.js\u0000lib\/js\/form_functions.js\u0000lib\/js\/index.php\u0000lib\/js\/jquery-1.4.2.min.js\u0000lib\/js\/jquery-1.7.1.min.js\u0000lib\/js\/jquery-ui-1.8.18.custom.min.js\u0000lib\/js\/jquery.ocupload-1.1.2.min.js\u0000lib\/js\/js.js\u0000lib\/js\/md5.js\u0000scripts\/net-test.php\u0000tests\/API\/API\/AuthTest.php\u0000tests\/API\/API\/CCTest.php\u0000tests\/API\/API\/DataObjectTest.php\u0000tests\/API\/API\/DataType\/BooleanTest.php\u0000tests\/API\/API\/DataType\/CryptTest.php\u0000tests\/API\/API\/DataType\/EnumTest.php\u0000tests\/API\/API\/DataType\/FormattedIntegerTest.php\u0000tests\/API\/API\/DataType\/IPAddressTest.php\u0000tests\/API\/API\/DataType\/IntegerTest.php\u0000tests\/API\/API\/DataType\/MD5Test.php\u0000tests\/API\/API\/DataType\/MultiOneLinkTest.php\u0000tests\/API\/API\/DataType\/ObjectTest.php\u0000tests\/API\/API\/DataType\/OneLinkTest.php\u0000tests\/API\/API\/DataType\/ParentLinkTest.php\u0000tests\/API\/API\/DataType\/TimeStampTest.php\u0000tests\/API\/API\/DataType\/TypeLinkTe... (10,110 more bytes) ...\n\nSTDERR\n(empty)"},"payload":null,"javelin_behaviors":{"dark-console":[{"uri":"\/diffusion\/ONN\/pathtree\/master\/","key":"oirhcvk4fx5t6acwmmut6ss2","color":"#ff0000","quicksand":false}]},"javelin_resources":["http:\/\/\/res\/phabricator\/e7393ebb\/darkconsole.pkg.js","http:\/\/\/res\/phabricator\/59d01bb7\/core.pkg.js","http:\/\/\/res\/phabricator\/3010e992\/rsrc\/externals\/javelin\/core\/init.js"]}

I'm unsure what is actually parsing out the return from git ls-tree so I wasn't able to take this any further.

Event Timeline

ftdysa updated the task description. (Show Details)Apr 30 2015, 1:13 PM
ftdysa added a project: Diffusion.
ftdysa added a subscriber: ftdysa.
ftdysa created this task.
ftdysa raised the priority of this task from to Needs Triage.

Does this command work properly when run from /var/repo/XYZ, where 'XYZ' is the repository callsign?

$ git ls-tree --name-only -r -z '6449f413a2f9c1a0c9de4fc7a30fa4e94aa7f102' --

Particularly, does it exit nonzero? You can tell by echoing $? afterward:

$ echo $?

ftdysa added a comment.May 4 2015, 3:03 PM

Seems to work fine.

phabricator-1:# pwd
phabricator-1:# git ls-tree --name-only -r -z '6449f413a2f9c1a0c9de4fc7a30fa4e94aa7f102' --
... large blob of files ...
phabricator-1:# echo $?

Hmm, I'm not sure then. It doesn't look like it's producing that much output, either ("... (10,110 more bytes) ..."), so I can't imagine it's any sort of resource exhaustion or OOM-killer kind of issue.

It's vaguely possible that the git in your CLI path and the git in the webserver path are different and the webserver one is broken and error-y, but I'd expect a lot more stuff to not work if that was the case.

ftdysa added a comment.May 4 2015, 3:13 PM

Ok, I'll see if I can get a test case with LinesOfALargeExecFuture that reproduces it.

ftdysa added a comment.May 4 2015, 3:31 PM

And further, it seems to work fine as the web user.

phabricator-1:# sudo -u nginx -H /usr/bin/git ls-tree --name-only -r -z '6449f413a2f9c1a0c9de4fc7a30fa4e94aa7f102' --
... text ...
phabricator-1:# echo $?
ftdysa added a comment.EditedMay 8 2015, 2:03 PM

Reproducible with P1777. Any chance you guys compile php from source and I could get the output of php -i | grep configure?

ftdysa closed this task as Resolved.May 8 2015, 4:04 PM
ftdysa claimed this task.

I think this is due to the fact that I had --enable-sigchild in my compiled php, but I can't confirm. Finally configured with the following and I am gtg.

I say I "think", because I forgot to run a make clean until before this configuration. Woops.

./configure \
	--enable-opcache \
	--enable-pcntl \
	--enable-posix \
	--with-gd \
	--enable-fpm \
	--enable-cli \
	--with-png-dir=/usr \
	--with-jpeg-dir=/usr \
	--with-curl \
	--with-openssl \
	--prefix=/web/local/php5.6.4 \
	--with-pdo-mysql=mysqlnd \
	--enable-mbstring \
	--with-zlib \
	--with-freetype-dir \
	--with-pdo-mysql \

We can potentially detect this by looking for --enable-sigchild in phpinfo() or running an empirical test, but I'd want to wait until at least one other person runs into it.

ftdysa added a comment.May 8 2015, 6:26 PM

Because I wasted enough time on this, I went ahead and reproduced it so hopefully no one else does. Proof in P1779.