-
Notifications
You must be signed in to change notification settings - Fork 0
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 : com.sun.jna.LastErrorException: [2] No such file or directory #9
Comments
Please tell us your MacOS version as well as the processor type (Intel or ARM) and your Mac model |
env: |
Under M1, the TUN device currently only runs with Rosetta. |
Is there any intention to be compatible with M1/M2 chips? |
We currently assume a bug in the JDK in connection with native calls and Apple Silicon. The native calls work without JDK under Apple Silicon. Which JDK are you using, and in which version? |
➜ netty-tun-examples git:(master) ✗ java -version This was upgraded 1 hour ago, before it was 11.0.15 |
I just released a new netty-tun version with the latest JNA release. This JNA version might fix your problem. |
Can you try this PR: netty/netty#12960 ? There we're using JNI and it should work under m1/m2. Only down side it's currently not merged into master |
Is there no hope for this library? netty is not very easy to compile |
Running with debug or java -jar gives the following error:
➜ target git:(master) sudo java -jar netty-tun-examples.jar echo
Password:
com.sun.jna.LastErrorException: [2] No such file or directory
at org.drasyl.channel.tun.jna.shared.LibC.ioctl(Native Method)
at org.drasyl.channel.tun.jna.darwin.DarwinTunDevice.open(DarwinTunDevice.java:111)
at org.drasyl.channel.tun.TunChannel.doBind(TunChannel.java:114)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
4月 24, 2023 6:09:13 下午 io.netty.util.internal.PromiseNotificationUtil tryFailure
warning: Failed to mark a promise as failure because it has succeeded already: DefaultChannelPromise@38b64f07(success)
java.lang.IllegalStateException: close() must be invoked after the channel is closed.
at io.netty.channel.ChannelOutboundBuffer.close(ChannelOutboundBuffer.java:683)
at io.netty.channel.ChannelOutboundBuffer.close(ChannelOutboundBuffer.java:711)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:736)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620)
at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1352)
at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:622)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:606)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:472)
at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:957)
at io.netty.channel.AbstractChannel.close(AbstractChannel.java:244)
at io.netty.channel.ChannelFutureListener$2.operationComplete(ChannelFutureListener.java:56)
at io.netty.channel.ChannelFutureListener$2.operationComplete(ChannelFutureListener.java:52)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:184)
at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:95)
at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:30)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
The text was updated successfully, but these errors were encountered: