Page MenuHomePhabricator

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

Authored by alexmv on Dec 21 2016, 10:58 PM.
Referenced Files
F12181954: D17100.id41135.diff
Wed, Sep 13, 1:54 AM
Wed, Sep 13, 1:54 AM
F12181952: D17100.diff
Wed, Sep 13, 1:54 AM
F12173182: D17100.diff
Fri, Sep 8, 11:11 PM
F12168545: D17100.diff
Thu, Sep 7, 4:51 AM
F12159749: D17100.diff
Wed, Sep 6, 2:35 AM
F12151278: D17100.id41135.diff
Sun, Sep 3, 3:19 AM
Unknown Object (File)
Aug 14 2023, 4:30 PM



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

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

rP Phabricator
silence-fetch-warnings (branched from master)
Lint Passed
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