DataStax Help Center

Graph loader throws "failed to map segment from shared object" warning

Summary

When using the DataStax Graph Loader it will default to executing some code from /tmp. In some systems with noexec used as a mount option on the /tmp partition this can cause a warning message to be observed

Symptoms

The following message may be seen when running the graph loader:

java.lang.UnsatisfiedLinkError: /tmp/libnetty-transport-native-epoll8134709199765506551.so: /tmp/libnetty-transport-native-epoll8134709199765506551.so: failed to map segment from shared object: Operation not permitted 
at java.lang.ClassLoader$NativeLibrary.load(Native Method) 
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938) 
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821) 
at java.lang.Runtime.load0(Runtime.java:809) 
at java.lang.System.load(System.java:1086) 
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:193) 
at io.netty.channel.epoll.Native.<clinit>(Native.java:46) 
at io.netty.channel.epoll.Epoll.<clinit>(Epoll.java:30) 
at java.lang.Class.forName0(Native Method) 
at java.lang.Class.forName(Class.java:264) 
at com.datastax.driver.core.NettyUtil.<clinit>(NettyUtil.java:68) 
at com.datastax.driver.core.NettyOptions.eventLoopGroup(NettyOptions.java:96) 
at com.datastax.driver.core.Connection$Factory.<init>(Connection.java:713) 
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1375) 
at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:403) 
at com.datastax.driver.core.DelegatingCluster.getMetadata(DelegatingCluster.java:91) 
at com.datastax.dsegraphloader.api.ClusterBuilder.build(ClusterBuilder.java:212) 
at com.datastax.dsegraphloader.api.DataLoader.connect(DataLoader.java:116) 
at com.datastax.dsegraphloader.cli.Executable.execute(Executable.java:66) 
at com.datastax.dsegraphloader.cli.Executable.main(Executable.java:171) 

Cause

Often for security reasons the /tmp directory will be mounted with the noexec flag. It may also have other flags too like nosuid and nodev. In such cases this will affect the graph loader as it typically executes some code from/tmp

Workaround

The graphloader script can be edited to add the following -Djava.io.tmpdir parameter, for example:

# Uncomment to enable debugging
#JVM_OPTS="$JVM_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1414"
export JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/path/to/alt/tmpdir <-- inserted here
echo "$JAVA" $JVM_OPTS com.datastax.dsegraphloader.cli.Executable $VARS
exec "$JAVA" $JVM_OPTS com.datastax.dsegraphloader.cli.Executable $VARS 

Solution

At the time of writing this article the workaround above is the only way to change the temporary directory location for the graph loader. The following internal jira tracks the need to add a parameter to the loader

DGL-167 - Make explicit parameter for setting tmp dir

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk