Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo docker fails with "no tty present and no askpass program specified" #995

Closed
sebglon opened this issue Apr 16, 2019 · 2 comments

Comments

2 participants
@sebglon
Copy link

commented Apr 16, 2019

What were you trying to do?

run debug.sh script available on this https://github.com/number101010/go-kubernetes-vscode-dev

What did you expect to happen?

container is up with dlv

What happened instead?

(please tell us - the traceback is automatically included, see below.
use https://gist.github.com to pass along full telepresence.log)

Automatically included information

Command line: ['/usr/bin/telepresence', '--namespace', 'backup', '--docker-run', '-v', '<my-path>', '-p', '2345:2345', '-it', '--cap-add=SYS_PTRACE', 'vscode-go-debug', 'bash', '-c', '.debug/runDelveLoop.sh']
Version: 0.98
Python version: 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]
kubectl version: Client Version: v1.14.1 // Server Version: v1.11.8-gke.6
oc version: (error: [Errno 2] No such file or directory: 'oc': 'oc')
OS: Linux xxxxxx 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Background process (Network container) exited with return code 1. Command was:
  sudo docker run -p=2345:2345 --publish=127.0.0.1:36987:38022/tcp --hostname=telepresence-1555449629-2582006-31647-58cdb9954c-28jw8 --dns=10.63.240.10 --dns-search=backup.svc.cluster.local --dns-search=svc.cluster.local --dns-search=cluster.local --dns-search=c.<cluster>.internal --dns-search=google.internal --dns-opt=ndots:5 --rm --privileged --name=telepresence-1555449649-1545959-31647 datawire/telepresence-local:0.98 proxy '{"cidrs": ["0/0"], "expose_ports": []}'

Recent output was:
  sudo: no tty present and no askpass program specified

Logs:

Listening...
  20.1  28 | 2019-04-16T21:20:46+0000 [-] Loading ./forwarder.py...
  20.1  28 | 2019-04-16T21:20:49+0000 [-] /etc/resolv.conf changed, reparsing
  20.1  28 | 2019-04-16T21:20:49+0000 [-] Resolver added ('10.63.240.10', 53) to server list
  20.1  28 | 2019-04-16T21:20:49+0000 [-] SOCKSv5Factory starting on 9050
  20.1  28 | 2019-04-16T21:20:49+0000 [socks.SOCKSv5Factory#info] Starting factory <socks.SOCKSv5Factory object at 0x7f67451676a0>
  20.1  28 | 2019-04-16T21:20:49+0000 [-] DNSDatagramProtocol starting on 9053
  20.1  28 | 2019-04-16T21:20:49+0000 [-] Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f6741c919b0>
  20.1  28 | 2019-04-16T21:20:49+0000 [-] Loaded.
  20.1  28 | 2019-04-16T21:20:49+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.9.0 (/usr/bin/python3.6 3.6.5) starting up.
  20.1  28 | 2019-04-16T21:20:49+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.

@ark3

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

Sorry about the crash. This is happening because Telepresence is calling sudo docker ... without a TTY. I'll have this fixed for the next release.

In the meantime, you can work around this by setting up Docker to run without sudo, though you should be aware that there are some security tradeoffs in setting up Docker that way.

Thanks for the issue. We don't test for this correctly, so it would have taken us a long time to notice this bug.

@ark3 ark3 added the bug label Apr 16, 2019

@ark3 ark3 added this to To do in Tel Tracker via automation Apr 16, 2019

@ark3 ark3 changed the title Fail to start container from vscode with dlv sudo docker fails with "no tty present and no askpass program specified" Apr 16, 2019

@sebglon

This comment has been minimized.

Copy link
Author

commented Apr 16, 2019

Thanks yes i have added docker group for my user and all is good now.

@ark3 ark3 moved this from To do to In progress in Tel Tracker Apr 17, 2019

@ark3 ark3 closed this in 783f92e Apr 17, 2019

Tel Tracker automation moved this from In progress to Done Apr 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.