>From the error message, sudo is highlighting that it can't ask for a password from the user (since no tty is present) and it can't get the password from a program (since the askpass program has not been specified).
Please see if setting NOPASSWD to the go user helps. More info here: http://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error Depending upon your organization's security policies, you may want to either give blanket sudo permissions, or ensure that the gocd user can run only specific commands (e.g a shell script that you deliver into that machine using approved secure mechanisms). -- Ram On Mon, Mar 20, 2017 at 7:10 PM, Vinodkumar Gopireddy < [email protected]> wrote: > Hi, > > I am unable to run sudo commands on go-cd agent. > > Log file: > > 16:34:13.120 [go] Job Started: 2017-03-20 16:34:13 IST > > 16:34:13.121 [go] Start to prepare test_pipeline/28/test_stage/1/defaultJob > on 1lc.applift.com [/avatar] > 16:34:13.132 [go] Keeping folder pipelines/test_pipeline/avatar > 16:34:13.132 [go] Keeping folder pipelines/test_pipeline/cruise-output > 16:34:13.132 [go] Start to update materials. > > > 16:34:13.235 [GIT] Fetching changes > 16:34:16.061 [GIT] Performing git gc > 16:34:16.164 [GIT] Reset working directory pipelines/test_pipeline/avatar > 16:34:16.164 [GIT] Cleaning all unversioned files in working copy > 16:34:16.270 [GIT] Cleaning submodule configurations in .git/config > 16:34:16.271 [GIT] Updating working copy to revision > b0552e315446203836e9f116b4661f7dc5a7ed8c > 16:34:16.274 HEAD is now at b0552e3 Gocd deployment for bid setup in local > cluster > 16:34:16.374 [GIT] Removing modified files in submodules > 16:34:16.503 [GIT] Cleaning all unversioned files in working copy > 16:34:16.609 [go] Done. > > 16:34:16.609 [go] setting environment variable 'GO_SERVER_URL' to value ' > https://192.168.2.18:8154/go' > 16:34:16.609 [go] setting environment variable 'GO_TRIGGER_USER' to value > 'anonymous' > 16:34:16.609 [go] setting environment variable 'GO_PIPELINE_NAME' to value > 'test_pipeline' > 16:34:16.609 [go] setting environment variable 'GO_PIPELINE_COUNTER' to > value '28' > 16:34:16.609 [go] setting environment variable 'GO_PIPELINE_LABEL' to > value '28' > 16:34:16.609 [go] setting environment variable 'GO_STAGE_NAME' to value > 'test_stage' > 16:34:16.610 [go] setting environment variable 'GO_STAGE_COUNTER' to value > '1' > 16:34:16.610 [go] setting environment variable 'GO_JOB_NAME' to value > 'defaultJob' > 16:34:16.610 [go] setting environment variable > 'GO_REVISION_AVATAR_STAGING' to value 'b0552e315446203836e9f116b4661f > 7dc5a7ed8c' > 16:34:16.610 [go] setting environment variable 'GO_TO_REVISION_AVATAR_STAGING' > to value 'b0552e315446203836e9f116b4661f7dc5a7ed8c' > 16:34:16.610 [go] setting environment variable > 'GO_FROM_REVISION_AVATAR_STAGING' > to value 'b0552e315446203836e9f116b4661f7dc5a7ed8c' > > 16:34:16.623 [go] Start to build test_pipeline/28/test_stage/1/defaultJob > on 1lc.applift.com [/avatar] > 16:34:16.623 [go] Current job status: passed. > > 16:34:16.623 [go] Start to execute task: <exec command="sudo" > > <arg>/etc/init.d/supervisord</arg> > <arg>start</arg> > </exec>. > 16:34:16.637 sudo: no tty present and no askpass program specified > 16:34:16.648 [go] Current job status: failed. > > 16:34:16.654 [go] Start to create properties > test_pipeline/28/test_stage/1/defaultJob > on 1lc.applift.com [/avatar] > 16:34:16.654 [go] Start to upload test_pipeline/28/test_stage/1/defaultJob > on 1lc.applift.com [/avatar] > 16:34:16.677 [go] Job completed test_pipeline/28/test_stage/1/defaultJob > on 1lc.applift.com [/avatar] > > > Task details: > > Command:sudo > Arguments: /etc/init.d/supervisord > start > > -- > You received this message because you are subscribed to the Google Groups > "go-cd" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
