telepresenceio / telepresence

Local development against a remote Kubernetes or OpenShift cluster
https://www.telepresence.io
Other
6.54k stars 515 forks source link

Issue with telepresence with deployment containing many forwarded ports. #1375

Closed rhatlapa closed 9 months ago

rhatlapa commented 4 years ago

What were you trying to do?

swap deployment in k8s of one specific deployment via telepresence for local debugging

What did you expect to happen?

telepresence to succeed

What happened instead?

Telepresence failed, the ssh command from logs is shortened (the -R is there 1000 times as thousand ports is forwarded)

34.1  44 |    2.1 >>> | Background process (SSH port forward (exposed ports)) exited with return code 255. Command was:

ssh -N -oServerAliveInterval=1 -oServerAliveCountMax=10 -F /dev/null -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -q -p 38023 telepresence@127.0.0.1 -R '*:47051:127.0.0.1:47051'  .... -R '*:47999:127.0.0.1:47999

Automatically included information

Command line: ['/usr/local/bin/telepresence', '--swap-deployment', 'test-console-backend', '--docker-run', '--rm', '-it', '--name', 'test-console-backend_local_telepresence', '-e', 'JAVA_TOOL_OPTIONS=-agentlib:jdwp="transport=dt_socket,server=y,suspend=n,address=*:5005" -Dlog4j.configurationFile=/config/log4j2.xml', '-v', '/Users/rhatlapa/projects/test/test-console-backend/config/config.json:/config/config.json', '-v', '/Users/rhatlapa/projects/test/test-console-backend/config/log4j2.xml:/config/log4j2.xml', '-v', '/Users/rhatlapa/projects/test/test-console-backend/config/featureConfigurations.json:/opt/flags/featureConfigurations.json', '-p', '5005:5005', 'docker-registry.fi2.wandera.cz/test-console-backend:local', '-conf', '/config/config.json'] Version: 0.105 Python version: 3.7.3 (default, Apr 7 2020, 14:06:47) [Clang 11.0.3 (clang-1103.0.32.59)] kubectl version: Client Version: v1.18.2 // Server Version: v1.14.10 oc version: (error: [Errno 2] No such file or directory: 'oc': 'oc') OS: Darwin Radim-Hatlapatka.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

Traceback (most recent call last):
File "/usr/local/bin/telepresence/telepresence/cli.py", line 135, in crash_reporting
yield
File "/usr/local/bin/telepresence/telepresence/main.py", line 82, in main
runner, remote_info, env, socks_port, ssh, mount_dir, pod_info
File "/usr/local/bin/telepresence/telepresence/outbound/setup.py", line 169, in launch
pod_info,
File "/usr/local/bin/telepresence/telepresence/outbound/container.py", line 258, in run_docker_command
process = subprocess.Popen(docker_command, env=docker_env)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 7] Argument list too long: 'docker'

Logs:

-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
50.5  59 | >> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 0.0.0.0/0 -p tcp --to-ports 12300 -m ttl ! --ttl 42
50.5  59 | >> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest z.x.y.w/32 -p udp --dport 53 --to-ports 12300 -m ttl ! --ttl 42 // IPs annonymized
50.5  59 | >> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest x.y.z.z/32 -p udp --dport 5355 --to-ports 12300 -m ttl ! --ttl 42 // IPs annonymized
50.5  59 | conntrack v1.4.4 (conntrack-tools): 0 flow entries have been deleted.
51.4  59 | c : DNS request from ('a.b.c.d', 40376) to None: 62 bytes
51.4  59 | c : DNS request from ('a.b.c.d', 35077) to None: 54 bytes
52.5  72 | [INFO  tini (1)] Main child exited normally (with status '100')
52.7 TEL | [72] exit 100 in 4.59 secs.
52.7 TEL | [73] Capturing: docker run --help
54.7 TEL | [73] captured in 2.00 secs.
54.7 TEL | END SPAN container.py:160(run_docker_command)    9.5s
54.7 >>> | Setup complete. Launching your container.
cindymullins-dw commented 9 months ago

Closing as Telepresence v1 is no longer supported. You can upgrade to the new Telepresence here.