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

Unable to connect because of xtables lock #223

Closed
SteveCurran opened this issue Mar 29, 2023 · 5 comments · Fixed by #289
Closed

Unable to connect because of xtables lock #223

SteveCurran opened this issue Mar 29, 2023 · 5 comments · Fixed by #289
Labels
enhancement New feature or request

Comments

@SteveCurran
Copy link

Describe Bug
Unable to connect to pod because another process has an xtables lock

"Bridge to Kubernetes initialization (VS Code v1.76.2 - Extension v2.0.120230310)
Logs: /home/steve/.config/Code/logs/20230329T125341/window1/exthost/mindaro.mindaro/mindaro-vscode-2023-03-29T17-53-45.566Z.txt
Waiting for 'cspbatch-746df866f9-rpt74' in namespace 'k8sdev' to reach running state...
Deployment 'k8sdev/cspbatch' patched to run agent.
Remote agent deployed in container 'cspbatch' in pod 'cspbatch-746df866f9-rpt74'.
Preparing to run Bridge To Kubernetes configured as pod k8sdev/cspbatch-746df866f9-rpt74 ...
Connection established.
Running 'iptables' failed with exit code '4': 'Waiting for process 942159
Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
Process has exited with exit code 4
'
Stopping workload and cleaning up...
Restore: Deployment 'cspbatch' restored to original state with image 'localhost:5000/batch:latest'.
Failed to establish a connection. Error: Running 'iptables' failed with exit code '4': 'Waiting for process 942159
Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
Process has exited with exit code 4"

I am able to successfully connect after restarting the ubuntu vm.

Mention the platform you are using
I am running b2k on ubuntu 20.04, vscode, and local k3s

mindaro-vscode-2023-03-29T17-53-45.566Z.txt

@hsubramanianaks
Copy link
Collaborator

hsubramanianaks commented Mar 30, 2023

@SteveCurran Thanks for raising this issue. are you facing this problem every time you use Bridge, or it is intermittent? Can you check and send the output screenshot here if you see any process running for PID 942159 in your machine and what is that process ? As far as I know when bridge tries to run the iptables command, it fails due to another app ex: firewalld has the xtables locked.

I can improvise on this by adding wait time with command -w but wanted to know if this is happening always. :)

@hsubramanianaks hsubramanianaks added the waiting for response Waiting for a response by the original author of the ticket label Mar 30, 2023
@SteveCurran
Copy link
Author

@hsubramanianaks I spent a lot of time trying to identify the offending process. The process starts and stops very quickly, so its impossible to see in the monitor app in ubuntu. I ran atop with an interval of 0 and entered "t" to take a snap shot of processes and finally got one. Unfortunately, atop shows "?" for the cid "command identifier", but it is another iptables command. I see a lot of iptable commands when first launching the debugger and establishing a connection. The issue is intermittent, sometimes if occurs repeatedly. Of course if I use the option of keeping the connection open, I don't run into this problem. I suspect this is related to running k3s locally. I do notice that the dsc and kubectl processes seem to appear and disappear with this problem.

@hsubramanianaks
Copy link
Collaborator

@SteveCurran I tried with kind, minikube and aks clusters, I didn't face this issue. Maybe it is related to k3s or version of linux OS you are running. Since there is workaround, is it okay to leave this comment and close this issue, please let me know, thank you.

@SteveCurran
Copy link
Author

@hsubramanianaks It would be great if you could add the -w option when trying to obtain the xtables lock, it seems as if a process has a lock and waiting should solve the problem.

@hsubramanianaks
Copy link
Collaborator

@SteveCurran waiting for 60 seconds should be suffice right ? I will be doing a PR soon for it. Thanks.

@hsubramanianaks hsubramanianaks added enhancement New feature or request and removed waiting for response Waiting for a response by the original author of the ticket labels Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants