vlead / ovpl

ADS - Automated Deployment Service
MIT License
0 stars 22 forks source link

Unable to resolve DNS names within OpenVZ container #23

Closed bollu closed 9 years ago

bollu commented 10 years ago

Hey!

So, now, I'm able to clone the github repo, and the VM launches too. However, the name resolution within the VM doesn't seem to be working, and I'm stumped as to why this is happening. Since the VM's are all generated from the same pre-baked template, I see no reason as to why this should not work. However, weirdly enough, It's not working.

I cated the vmmanager.log. Here are the results:

root@cse02:~/VMManager/log# cat vmmanager.log 
2014-09-23 09:50:11 PM - INFO : [VMManagerServer.py:71] : VMManagerServer: __main()
2014-09-23 09:50:11 PM - INFO : [VMManagerServer.py:71] : VMManagerServer: __main()
2014-09-23 09:50:12 PM - INFO : [VMManagerServer.py:61] : VMManagerServer: TestLabHandler: post(): post_data = {'lab_src_url': 'git@bitbucket.org:virtual-labs/cse02-programming.git'}
2014-09-23 09:50:12 PM - INFO : [VMManagerServer.py:61] : VMManagerServer: TestLabHandler: post(): post_data = {'lab_src_url': 'git@bitbucket.org:virtual-labs/cse02-programming.git'}
2014-09-23 09:50:12 PM - INFO : [VMManager.py:146] : Starting test_lab
2014-09-23 09:50:12 PM - INFO : [VMManager.py:146] : Starting test_lab
2014-09-23 09:50:12 PM - DEBUG : [VMManager.py:107] : git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming
2014-09-23 09:50:12 PM - DEBUG : [VMManager.py:107] : git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming
Cloning into '/root/VMManager/lab-repo-cache/cse02-programming'...
ssh: Could not resolve hostname altssh.bitbucket.org: Temporary failure in name resolution
fatal: The remote end hung up unexpectedly
2014-09-23 09:50:52 PM - ERROR : [VMManager.py:111] : git clone failed for repo cse02-programming: Command 'git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming' returned non-zero exit status 128
2014-09-23 09:50:52 PM - ERROR : [VMManager.py:111] : git clone failed for repo cse02-programming: Command 'git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming' returned non-zero exit status 128

Name resolution is important for it to be able to pull the repos from bitbucket, so I'm not able to test the entire workflow without name resolution.

It clearly says

ssh: Could not resolve hostname altssh.bitbucket.org: Temporary failure in name resolution
fatal: The remote end hung up unexpectedly

I tried pinging within the VM - same story. Direct IP pings to work (to 8.8.8.8) for example, but pinging to www.google.com fails.

root@cse02:~/VMManager/log# ping www.google.com
ping: unknown host www.google.com

It maybe because I'm using Vagrant, but I seriously doubt it - the Vagrant box is perfectly fine, and I can ping, cURL, wget, whatever from the Vagrant box so I don't think that's the case. I'm suspecting that there's something wrong with my base VM image.

Help please? :)

Thanks!

EDIT - I tried cloning my dotfiles repo over HTTPS, and it turns out that the proxy is set by default to proxy.iiit.ac.in. That seems to be important - the proxy will not remain the same when we migrate this to other data centers. However, that is completely tangential to all of this. It still does not explain why I am unable to ping (since AFAIK ping does not depend on proxy settings at all).

Also, even after unsetting both the http_proxy and the https_proxy, git clone over both HTTPS and SSH do not work. Again, this makes no sense >_<

anhsirksai commented 10 years ago

Just out of curiosity! You are creating container with ovpl. and you are not able to get internet on that , If I understand it correctly. Is it the case?

I think this might resolve, if I understood it correctly. Please let me know if I am wrong. In /etc/modprobe/openvz.conf (this file in vagrant box with centos) options nf_conntrack ip_conntrack_disable_ve0=0

travula commented 10 years ago

Hello Sidharrh,

That is because proxies are set in the template.

I have written setenv.py which you can use in the vmmanager code to set the proxies right.

I will make changes and check them in.

peace Thirumal On Sep 23, 2014 4:31 PM, "Siddharth" notifications@github.com wrote:

Hey!

So, now, I'm able to clone the github repo, and the VM launches too. However, the name resolution within the VM doesn't seem to be working, and I'm stumped as to why this is happening. Since the VM's are all generated from the same pre-baked template, I see no reason as to why this should not work. However, weirdly enough, It's not working.

I cated the vmmanager.log. Here are the results:

root@cse02:~/VMManager/log# cat vmmanager.log 2014-09-23 09:50:11 PM - INFO : [VMManagerServer.py:71] : VMManagerServer: main() 2014-09-23 09:50:11 PM - INFO : [VMManagerServer.py:71] : VMManagerServer: main() 2014-09-23 09:50:12 PM - INFO : [VMManagerServer.py:61] : VMManagerServer: TestLabHandler: post(): post_data = {'lab_src_url': 'git@bitbucket.org:virtual-labs/cse02-programming.git'} 2014-09-23 09:50:12 PM - INFO : [VMManagerServer.py:61] : VMManagerServer: TestLabHandler: post(): post_data = {'lab_src_url': 'git@bitbucket.org:virtual-labs/cse02-programming.git'} 2014-09-23 09:50:12 PM - INFO : [VMManager.py:146] : Starting test_lab 2014-09-23 09:50:12 PM - INFO : [VMManager.py:146] : Starting test_lab 2014-09-23 09:50:12 PM - DEBUG : [VMManager.py:107] : git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming 2014-09-23 09:50:12 PM - DEBUG : [VMManager.py:107] : git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming Cloning into '/root/VMManager/lab-repo-cache/cse02-programming'... ssh: Could not resolve hostname altssh.bitbucket.org: Temporary failure in name resolution fatal: The remote end hung up unexpectedly 2014-09-23 09:50:52 PM - ERROR : [VMManager.py:111] : git clone failed for repo cse02-programming: Command 'git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming' returned non-zero exit status 128 2014-09-23 09:50:52 PM - ERROR : [VMManager.py:111] : git clone failed for repo cse02-programming: Command 'git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming' returned non-zero exit status 128

It clearly says

ssh: Could not resolve hostname altssh.bitbucket.org: Temporary failure in name resolution fatal: The remote end hung up unexpectedly

I tried pinging within the VM - same story. Direct IP pings to work (to 8.8.8.8) for example, but pinging to www.google.com fails.

root@cse02:~/VMManager/log# ping www.google.com ping: unknown host www.google.com

It maybe because I'm using Vagrant, but I seriously doubt it - the Vagrant box is perfectly fine, and I can ping, cURL, wget, whatever from the Vagrant box so I don't think that's the case. I'm suspecting that there's something wrong with my base VM image.

Help please? :)

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/vlead/ovpl/issues/23.

bollu commented 10 years ago

Cool, thanks for the proxy thing :)

Also, @anhsirksai - that didn't work - I changed the variable and rebooted the VM, it didn't really work weirdly enough.

Same error again.

root@cse02:~/VMManager/log# git clone git@bitbucket.org:virtual-labs/cse02-programming.git /root/VMManager/lab-repo-cache/cse02-programming
Cloning into '/root/VMManager/lab-repo-cache/cse02-programming'...
ssh: Could not resolve hostname altssh.bitbucket.org: Temporary failure in name resolution
fatal: The remote end hung up unexpectedly
avinassh commented 10 years ago

Is ping to Bitbucket successful from VM? If yes, can try it over HTTP or HTTPS:

git clone https://username:password@bitbucket.org/repo/slug.git
bollu commented 10 years ago

In the Vagrant Box

:

⚡ root@localhost  ~/ovpl/src   go-integretion ●  cat /etc/modprobe.d/openvz.conf 
options nf_conntrack ip_conntrack_disable_ve0=0

So, that is setup as @anhsirksai told.

In the openVZ container

root@cse02:/# ping www.bitbucket.org
ping: unknown host www.bitbucket.org

@avinassh: the name resolution is completely messed up - it's not able to resolve anything at all.

ecthiender commented 9 years ago

24 Captures this and is fixed.