0

We are running Jenkins in a docker container and using the Docker-outside-of-Docker approach. As is well documented, we added:

jenkins ALL=NOPASSWD: ALL

to /etc/sudoers.

The problem we face is that our pipeline job randomly fails when executing the first make command:

sudo -E make login

with the error:

sudo: no tty present and no askpass program specified

Why are we experiencing this error only sometimes?

Matthew S
  • 900
  • 3
  • 12
  • 26
  • 4
    can you try starting the container with the `-t` option? Another thing to try is starting it with `--user root` and avoid using `sudo` – yamenk Nov 09 '17 at 14:40
  • Adding 'user: root' to my docker-compose file and removing sudo -E from the make commands solved the issue. – Matthew S Nov 09 '17 at 18:37

1 Answers1

0

If you get the issue like as mentioned below error message image

Login to the instance in GitBash and open the following file.

sudo visudo

And in this file Add the following command in the end of the file

jenkins ALL=(ALL) NOPASSWD: ALL

Save the file and Run the Jenkins onnce again. Hope your issue will be solve. Thanks! Image

  • thank you. this is what we did actually. – Matthew S Feb 16 '23 at 10:05
  • Please do not use screenshots to share code snippets, use code blocks instead! That goes both for questions and answers. See https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors/285557#285557 – N1ngu Aug 03 '23 at 13:26