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

Error on MacOS during Java build #171

Open
kstewart83 opened this issue Aug 15, 2018 · 3 comments
Open

Error on MacOS during Java build #171

kstewart83 opened this issue Aug 15, 2018 · 3 comments

Comments

@kstewart83
Copy link

Unik version: 988aed6 (master)
jq version: 1.5
maven version: 3.5.4
MacOS version: 10.13.6

When following the tutorial for creating a Java based app on Unik, everything works as expected up to step one of the Compile an image and run on Virtualbox section. When running the following command (after updating PATH_TO_JAVA_PROJECT to point to my java app):

unik build --name myJavaImage --path PATH_TO_JAVA_PROJECT --base osv --language java --provider virtualbox

I get the error:

INFO[0000] App packaged as tarball: /var/folders/ts/l_7871px4_j3qhfzky3b425m0000gn/T/sources.tar.gz.553744328

ERRO[0000] build failed: [cmd/build.go:105] building image failed: {[client/images.go:63] failed with status 500: [daemon/daemon.go:558] failed to compile raw image: {[osv/osv_java.go:31] failed to read manifest.yaml file: {open /Users/my user name/.unik/tmp/unpacked.sources.dir.399012388/manifest.yaml: no such file or directory}}}

When I look at where the sources.tar.gz.553744328 file is referenced, it is not there. There aren't any folders under ~/unik/tmp that are called unpacked.sources.....

@kstewart83
Copy link
Author

Disregard...missed the step of creating the manifest.yaml.

@kstewart83
Copy link
Author

kstewart83 commented Aug 15, 2018

Reopening...because after adding the manifest I got further...but not all the way to success.

After the manifest.yaml file was created, the build still failed because maven couldn't download artifacts from Maven Central. This was solved by changing the following in the manifest:

build_command: mvn package

to

build_command: mvn -Dhttps.protocols=TLSv1.2 package

Based on this StackOverflow article.

After that the build succeeds and a VirtualBox image is created. However after running:

unik run --instanceName myJavaInstance --imageName myJavaImage

The VM is created, is started, and running unik instances shows the instance, but the IP is blank. The VM is getting an IP on the host-only network from the DHCP server because if I open up the GUI from VirtualBox it shows that eth0 has an IP on the appropriate IP range. Furthermore, I can ping that IP from the host machine. However, the nothing comes up on port 4000 on that IP either through the browser or through curl...though when the app is built and executed on the local machine, the app works as expected.

@kstewart83 kstewart83 reopened this Aug 15, 2018
@kstewart83
Copy link
Author

kstewart83 commented Aug 17, 2018

I have now gotten things to work sporadically. If I stop and start the instance enough times (along with starting and stopping the daemon), eventually it will work. Basically, one of two scenarios happen.

  1. On launch, the instance will show two lines on the console correlating to the two ethernet adapters (host only, NAT) along with their IP addresses. The boot hangs at this point and nothing else happens.

  2. The instance boots and then begins loading all the files and showing meaningful progress in the console. In this case the app loads and everything works as expected.

Scenario 2 happens roughly 1 in 5 to times starting up the VM. But it can vary. Sometimes it takes me 20 restarts before it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant