Page MenuHomePhabricator

Filter potentially problematic $_ENV variables
ClosedPublic

Authored by epriestley on Apr 27 2015, 12:21 PM.
Tags
None
Referenced Files
F14079689: D12571.diff
Fri, Nov 22, 9:21 AM
Unknown Object (File)
Wed, Nov 20, 10:16 PM
Unknown Object (File)
Sun, Nov 17, 8:11 AM
Unknown Object (File)
Fri, Nov 1, 1:13 PM
Unknown Object (File)
Thu, Oct 31, 9:50 AM
Unknown Object (File)
Thu, Oct 31, 9:16 AM
Unknown Object (File)
Thu, Oct 31, 9:16 AM
Unknown Object (File)
Thu, Oct 31, 8:50 AM
Subscribers
Tokens
"Haypence" token, awarded by btrahan.

Details

Reviewers
btrahan
Commits
Restricted Diffusion Commit
rP52b9e5ec1423: Filter potentially problematic $_ENV variables
Summary

Caught this in the production error logs. We can end up with argv defined and set to an array in an nginx + php-fpm configuration.

When we later run ExecFuture subprocesses, they won't be able to forward the value.

The error this produces looks like this:

015/04/27 12:17:35 [error] 10948#0: *674 FastCGI sent in stderr: "PHP message: [2015-04-27 12:17:35] ERROR 8: Array to string conversion at [/core/lib/libphutil/src/future/exec/ExecFuture.php:667]
PHP message: arcanist(head=master, ref.master=805ae12408e8), phabricator(head=master, ref.master=8ce8a761efe9), phutil(head=master, ref.master=fccf03d48e08)
PHP message:   #0 ExecFuture::isReady() called at [<phutil>/src/future/Future.php:39]
PHP message:   #1 Future::resolve(NULL) called at [<phutil>/src/future/exec/ExecFuture.php:413]
PHP message:   #2 ExecFuture::resolvex() called at [<phabricator>/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php:40]
PHP message:   #3 DiffusionGitRawDiffQuery::executeQuery() called at [<phabricator>/src/applications/diffusion/query/rawdiff/DiffusionRawDiffQuery.php:17]
PHP message:   #4 DiffusionRawDiffQuery::loadRawDiff() called at [<phabricator>/src/applications/diffusion/conduit/DiffusionRawDiffQueryConduitAPIMethod.php:56]
PHP message:   #5 DiffusionRawDiffQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phabricator>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:135]
PHP message:   #6 DiffusionQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:90]
PHP message:   #7 ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:134]
PHP message:   #8 ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:84]
PHP message:   #9 ConduitCall::execute() called at [<phabricator>/src/applications/diffusion/query/DiffusionQuery.php:81]
PHP message:   #10 DiffusionQuery::callConduitWithDiffusionRequest(PhabricatorUser, DiffusionGitRequest, string, array) called at [<phabricator>/src/applications/diffusion/controller/DiffusionController.php:184]
PHP message:   #11 DiffusionController::callConduitWithDiffusionRequest(string, array) called at [<phabricat
Test Plan

I'm just going to push this to make sure it fixes things, since I can't repro it locally.

Diff Detail

Repository
rP Phabricator
Branch
env1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5533
Build 5552: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Filter potentially problematic $_ENV variables.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
This revision was automatically updated to reflect the committed changes.

This appears in the logs here and there since January, I just happened to catch it now.