Page MenuHomePhabricator

Set `TERM` to prevent `No entry for terminal type "unknown"` messages during fetch
ClosedPublic

Authored by alexmv on Dec 21 2016, 10:58 PM.
Tags
None
Referenced Files
F13060513: D17100.diff
Fri, Apr 19, 5:57 PM
Unknown Object (File)
Fri, Apr 5, 7:30 PM
Unknown Object (File)
Wed, Apr 3, 7:28 PM
Unknown Object (File)
Wed, Apr 3, 3:41 PM
Unknown Object (File)
Tue, Apr 2, 2:26 PM
Unknown Object (File)
Sun, Mar 31, 1:28 AM
Unknown Object (File)
Sun, Mar 31, 1:18 AM
Unknown Object (File)
Mon, Mar 25, 7:20 AM
Subscribers

Details

Summary

Fetches cause output in /var/tmp/phd/log/daemons.log as
follows:

PHLOG: 'Unexpected output while updating repository "rREPONAME": No entry for terminal type "unknown";
using dumb terminal settings.
' at [/path/to/phabricator/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:455]

These warnings come from PHP itself. Silence these warnings by providing a
known value for TERM before shelling out to the PHP script.

See also D9744 (reverted in D11644) and T4990/T7119, which are a similar issue,
but in the pre-receive hooks, not the pull daemons.

Test Plan

Enabled in production, observed errors to be silenced and
no SSH hangs

Diff Detail

Repository
rP Phabricator
Branch
silence-fetch-warnings (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15021
Build 19704: Run Core Tests
Build 19703: arc lint + arc unit

Event Timeline

epriestley added a reviewer: epriestley.

An alternative approach might be to add this by default to all subprocesses in PhutilExecutableFuture, but that feels a little muddy since this issue is unique to PHP subprocesses.

I think we only execute PHP subprocesses in a couple of cases -- the ones that spring to mind are here, and from the Daemon Overseer. If that one eventually turns out to be causing problems we could try lifting this out and doing it in PhutilExecutableFuture or similar but I think this is fine for now. Thanks!

This revision is now accepted and ready to land.Dec 21 2016, 11:07 PM