Page MenuHomePhabricator

scap sync-file --force warns "sudo: no tty present and no askpass program specified"
Closed, ResolvedPublic1 Estimated Story Points

Description

Got a ton of these when doing a revert with scap sync-file --force:

18:49:22 /usr/bin/sudo -u root -- /usr/local/sbin/restart-php7.2-fpm --force on mw2278.codfw.wmnet returned [1]: 
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified

The final summary was

18:49:22 13 hosts had failures restarting php-fpm
18:49:22 14 hosts had failures restarting php-fpm
18:49:22 5 hosts had failures restarting php-fpm
18:49:22 5 hosts had failures restarting php-fpm
18:49:22 1 hosts had failures restarting php-fpm

Not sure if the errors are important; the sync seems to have worked fine. But they are confusing, and somewhat stressful when in the middle of a revert.

Event Timeline

Reproducible using:

env SSH_AUTH_SOCK=/run/keyholder/proxy.sock ssh -i/etc/keyholder.d/mwdeploy.pub mwdeploy@mw2278.codfw.wmnet /usr/bin/sudo -u root -- /usr/local/sbin/restart-php7.2-fpm --force

Change 719307 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] ::profile::mediawiki::common.pp: Allow mwdeploy to run sudo /usr/local/sbin/restart-php7.2-fpm --force

https://gerrit.wikimedia.org/r/719307

dancy triaged this task as Medium priority.

Change 719307 merged by Giuseppe Lavagetto:

[operations/puppet@production] Allow mwdeploy to run sudo /usr/local/sbin/restart-php7.2-fpm --force

https://gerrit.wikimedia.org/r/719307

I merged this change but I just noticed that, this way, services are just restarted without depooling/repooling; is this what we wanted to have here?

Nevermind, I'm clearly rusty; I just re-read scap's code and this seems allright :)