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

Memory allocation failed - OS: Ubuntu 18.04.2 LTS on Windows 10 #256

Closed
incube8r opened this issue May 28, 2019 · 7 comments
Closed

Memory allocation failed - OS: Ubuntu 18.04.2 LTS on Windows 10 #256

incube8r opened this issue May 28, 2019 · 7 comments

Comments

@incube8r
Copy link

When trying to configure an app on Ubuntu 18.04 on Windows error occurs:

# curl -X PUT [email protected] '127.0.0.1:8443/config/'   
{ 
        "error": "Memory allocation failed."
}

OS: Ubuntu 18.04.2 LTS on Windows 10
Kernel: 4.4.0-17763-Microsoft

@VBart
Copy link
Contributor

VBart commented May 28, 2019

Thank you for the report. Could you please check, what's in the unit.log?

@incube8r
Copy link
Author

@VBart after the curl put the log appends this:

2019/05/29 13:42:01 [alert] 33#33 *4 memfd_create(/unit.33.fb8f291) failed (38: Function not implemented)

@VBart
Copy link
Contributor

VBart commented May 29, 2019

@incube8r So the problem is that Microsoft WSL implementation of Linux API incomplete.
You can try to avoid this issue by recompiling Unit with disabled memfd_create() syscall:
./configure --cc-opt='-DNXT_HAVE_MEMFD_CREATE=0'

@incube8r
Copy link
Author

I did:

$ ./configure java --module=java8
configuring Java module
checking for java executable found /usr/bin/java
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
checking java.home /usr/lib/jvm/java-8-openjdk-amd64/jre
adjust java.home /usr/lib/jvm/java-8-openjdk-amd64
checking library path /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
checking for JNI ... found
 + Java module: java8.unit.so

Then

make

Then when I do

$ curl -X PUT [email protected] '127.0.0.1:8443/config/'
{ 
        "error": "Invalid configuration.",
        "detail": "The module to run \"java 8\" is not found among the available application modules."
}

I won't run java

What could be missing here?

@mar0x
Copy link
Contributor

mar0x commented May 29, 2019

Please provide all commands you are using to configure/make/run unit.
If you running unit from packages, it is better to use pre-built java module.

@VBart
Copy link
Contributor

VBart commented May 29, 2019

@incube8r You have to make install your module into the modules directory. You can check the modules directory path by running unitd --help command.

@incube8r
Copy link
Author

@VBart thanks, I can confirm here that using the ./configure --cc-opt='-DNXT_HAVE_MEMFD_CREATE=0'

I was able to run a Java web app with NGINX on Ubuntu 18.04 on Windows 10

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

3 participants