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
Unknown Object (File)
Tue, Dec 17, 9:56 AM
Unknown Object (File)
Thu, Dec 12, 8:49 AM
Unknown Object (File)
Sun, Dec 8, 2:34 PM
Unknown Object (File)
Tue, Dec 3, 7:27 PM
Unknown Object (File)
Sat, Nov 30, 6:00 AM
Unknown Object (File)
Thu, Nov 28, 11:40 PM
Unknown Object (File)
Tue, Nov 26, 5:01 AM
Unknown Object (File)
Thu, Nov 21, 10:48 PM
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