What is the problem :
Hey, So you also one of those who came across this issue Sudo: no tty present no tty present and no askpass program. There could be multiple reasons getting this error where one of is trying to run Jenkins in Google Cloud Console.
Why is the problem : Sudo: no tty present and no askpass program specified
This error message sudo: no tty present and no askpass program specified bother you when the
sudo command is trying to execute and that requires a password but
sudo does not have access to a
tty to prompt the user for a passphrase. As its not finding a
tty, sudo fall back to an
method but can’t find an
askpass command configured.
Solution to the problem : Sudo: no tty present and no askpass program specified
If you came across this issue anywhere else apart from the Jenkins instance follow this from the 2nd step. The first step is for the user who is having issue with the Jenkins instance.
- Go to Jenkins instance of Google Cloud Console.
- Enter the commands
- sudo su
- visudo -f /etc/sudoers
- Add following line at the end
- jenkins ALL= NOPASSWD: ALL
I hope by now you would have fixed the issues. You can checkout our other blogs on the popular load testing tool K6
About the Author
Pawan Sinha is a blogger whose interests in writing blogs on a day to day issues for any engineer working for a software company. To discuss his work, He has a background in Testing/DevOps/Engineering/Cloud/AWS/GCP. His portfolio.