solo-io / unik

The Unikernel & MicroVM Compilation and Deployment Platform
Apache License 2.0
2.71k stars 191 forks source link

Build fails #129

Closed antonOO closed 7 years ago

antonOO commented 7 years ago

I receive the following error when i try to actually build (from the getting started guide)

$ sudo unik build --name myImage --path ./ --base rump --language go --provider virtualbox
[sudo] password for toni: 

INFO[0000] running unik build                            args= base=rump force=false host=localhost:9967 language=go mountPoints=[] name=myImage path=./ provider=virtualbox

INFO[0002] App packaged as tarball: /tmp/sources.tar.gz.748289494

ERRO[0003] build failed: [cmd/build.go:105] building image failed: {[client/images.go:60] request failed: {[lxhttpclient/httpclient.go:339] error performing post request: {Post http://localhost:9967/images/myImage/create?mounts=&force=false&no_cleanup=false&base=rump&lang=go&provider=virtualbox&args=: dial tcp 127.0.0.1:9967: getsockopt: connection refused}}} 

The daemon is currently running in a separate terminal and everything else specified in the guide above this command is done correctly :

VboxUnikInstanceListener" to power on...
VM "VboxUnikInstanceListener" has been successfully started.

INFO[0034] listening for udp heartbeat...               
DEBU[0034] ARE WE LISTENING ON THE SOCKET YET?&{{0xc820228f50}} 
INFO[0034] UDP Server listening on 0.0.0.0:9967  

Any thoughts on how to complete the build ?

ilackarms commented 7 years ago

how did you get port 9967 as the target port for unik? it should be 3000

antonOO commented 7 years ago

When I enter the command:

anton@anton-ThinkPad-Edge-E530c:~/unik/_build$ sudo unik daemon --debug

I get the following output when I wait long enough:

INFO[0049] listening for udp heartbeat...               
DEBU[0049] ARE WE LISTENING ON THE SOCKET YET?&{{0xc820236f50}} 
INFO[0049] UDP Server listening on 0.0.0.0:9967         

WARN[0349] error encountered, ensuring vm and disks are destroyed  error=[virtualbox/deploy_instance_listener.go:153] failed to retrieve instance listener ip. is unik instance listener running?: {[common/get_instance_listener_ip.go:20] getting instance listener ip timed out after 5m0s}
DEBU[0349] running VBoxManage command                    command=[VBoxManage controlvm VboxUnikInstanceListener poweroff]
DEBU[0349] VBoxManage result                             result=0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

DEBU[0349] running VBoxManage command                    command=[VBoxManage unregistervm VboxUnikInstanceListener --delete]
DEBU[0349] VBoxManage result                             result=0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

ERRO[0349] running daemon failed: [cmd/daemon.go:86] daemon failed to initialize: {[daemon/daemon.go:107] initializing virtualbox provider: {[virtualbox/virtualbox_provider.go:49] deploying virtualbox instance listener: {[virtualbox/deploy_instance_listener.go:60] launching instance of instance listener: {[virtualbox/deploy_instance_listener.go:153] failed to retrieve instance listener ip. is unik instance listener running?: {[common/get_instance_listener_ip.go:20] getting instance listener ip timed out after 5m0s}}}}} 

I have no idea why this is due...

antonOO commented 7 years ago

The VboxUnikInstanceListener VM log -

VboxUnikInstanceListener-2017-05-27-19-38-52.txt

Notice it ends with :

 emR3Debug: rc=VERR_REM_VIRTUAL_CPU_ERROR
antonOO commented 7 years ago

Hi, I was developing on Ubuntu 17 hosted on a Workstation virtual environment inside of which there was a Virtualbox instance. The Virtualbox instance could not support a 64bit environment, which apparently the daemon required to run ( a 32bit support ?), because of the nested virtualization. So, the deamon itself could not connect to the DHCP host created by virtualbox and it kept being stuck on :

INFO[0215] listening for udp heartbeat...               
DEBU[0215] ARE WE LISTENING ON THE SOCKET YET?&{{0xc820250ee0}} 
INFO[0215] UDP Server listening on 0.0.0.0:9967      

Thanks anyway, I am closing the issue