Ngrok-LAN icon indicating copy to clipboard operation
Ngrok-LAN copied to clipboard

[BUG] not working on linux

Open MSandro opened this issue 2 years ago • 18 comments

Describe the bug I can not use the mod :(

To Reproduce Steps to reproduce the behavior:

  1. set up the token
  2. Go to 'Open to Lan'
  3. Click on 'Open Public Server'
  4. see the error

Expected behavior it should open the tunnel to Ngrok

Screenshots image

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Minecraft Version 1.18.2
  • Ngrok-LAN Version 1.4.4

Additional context because of the no permissions error I've already used the chmod +x command to enable execution for the file. but it did not work.

[07:34:32] [Thread-69/INFO]: Launched Lan!
[07:34:32] [Thread-69/INFO]: [CHAT] Starting Ngrok Service...
[07:34:32] [Thread-69/INFO]: [STDERR]: com.github.alexdlaird.exception.NgrokException: An error occurred while starting ngrok.
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.process.NgrokProcess.start(NgrokProcess.java:167)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.process.NgrokProcess.start(NgrokProcess.java:93)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.NgrokClient.connect(NgrokClient.java:169)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at net.minecraft.class_436.mdd0bad4$lambda$ngrokInit$6$0(class_436.java:601)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.Thread.run(Unknown Source)
[07:34:32] [Thread-69/INFO]: [STDERR]: Caused by: java.io.IOException: Cannot run program "/home/sandro/.ngrok2/ngrok": error=13, no permissions
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.ProcessBuilder.start(Unknown Source)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.process.NgrokProcess.start(NgrokProcess.java:132)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	... 4 more
[07:34:32] [Thread-69/INFO]: [STDERR]: Caused by: java.io.IOException: error=13, Keine Berechtigung
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.ProcessImpl.<init>(Unknown Source)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	at java.base/java.lang.ProcessImpl.start(Unknown Source)
[07:34:32] [Thread-69/INFO]: [STDERR]: 	... 7 more
[07:34:32] [Thread-69/INFO]: [CHAT] An error occurred while starting ngrok.
[07:34:32] [Thread-69/INFO]: [CHAT] Ngrok Service Initiation Failed!
[07:34:32] [Thread-69/ERROR]: Uncaught exception in thread "Thread-69"
java.lang.RuntimeException: Ngrok Service Failed to StartAn error occurred while starting ngrok.
	at net.minecraft.class_436.mdd0bad4$lambda$ngrokInit$6$0(class_436.java:654) ~[client-intermediary.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:?]

MSandro avatar Jun 30 '22 05:06 MSandro

I have experienced this on Fedora 36 and Minecraft 1.19

dajix350 avatar Jul 11 '22 04:07 dajix350

This bug might take a bit for us to figure out since we need to set up a Linux vm or something like that to test it.

I don't really know what could be going wrong here, and it might have something to do with the ngrok wrapper we are using.

In the mean time, apologies for the delay in fixing this.

If anybody can run this mod on Linux, please let me know and drop the specific OS in this thread.

Flooflez avatar Jul 12 '22 08:07 Flooflez

Any updates? On Linux I have been able to use ngrok to manually port forward my singleplayer world.

dajix350 avatar Aug 17 '22 21:08 dajix350

It runs on for me, Arch Linux 5.19.1-lqx1-1-lqx x86_64 GNU/Linux, OpenJDK version "18.0.2" (build 18.0.2+9).

try running chmod +x ~/.ngrok2/ngrok and see if that fixes it.

solonovamax avatar Aug 18 '22 02:08 solonovamax

I believe the error is that (for some reason), it's not marking the file as executable.

solonovamax avatar Aug 18 '22 03:08 solonovamax

Ah, should be possible to do with Java NIO.

TheKodeToad avatar Apr 02 '23 21:04 TheKodeToad

I'm having the same issue on Linux (Fedora 38, Ngrok LAN version 1.4.4, Minecraft version 1.19.2). Exact same error log posted in the OP.

SimplyTadpole avatar Aug 13 '23 01:08 SimplyTadpole

@SimplyTadpole try doing chmod +x ~/.ngrok2/ngrok, and see if that fixes it

solonovamax avatar Aug 13 '23 02:08 solonovamax

@solonovamax That directory doesn't seem to exist for me?

SimplyTadpole avatar Aug 13 '23 14:08 SimplyTadpole

@SimplyTadpole This is interesting, looks like maybe the wrapper isn't installing ngrok correctly. I probably should update the wrapper to a later/the latest version, maybe this bug is fixed in one of the newer releases.

We are currently using version 1.5.6, but it looks like 1.7.1 has a specific changelog for fixing default installation issues.

I'm a little bit hesitant right now to fully move to the latest 2.1.0 release as it uses a different ngrok version. I will have some more time in the coming week or so, so I might look into at least porting to 1.7.1.

Will keep you all updated, and also sorry again everyone for the inactivity.

Flooflez avatar Aug 16 '23 03:08 Flooflez

Hi all, I'm releasing a beta version of this mod for 1.20.1 that uses an updated wrapper version. You can find it under Releases on this github project.

Could someone who is experiencing this bug try this version of the mod to see if there is any difference?

Thanks :)

Flooflez avatar Aug 17 '23 06:08 Flooflez

I no longer have issues with the bug, as chmod'ing the file fixed it for me, however I will try doing chmod -x to it, to see if I can reproduce it, and then attempt running with the latest version

solonovamax avatar Aug 18 '23 16:08 solonovamax

Could someone who is experiencing this bug try this version of the mod to see if there is any difference?

newcomer to the mod and was experiencing the issue beta build doesn't seem to make a difference, still getting initiation failed

chmod +x ~/.ngrok2/ngrok hasn't fixed it for me either

͏͏͏ logs spit this out whenever attempting to open a server

[20:57:26] [Thread-28/INFO]: [CHAT] Starting Ngrok Service...
[20:57:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[creeper testing]'/minecraft:the_nether
[20:57:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[creeper testing]'/minecraft:the_end
[20:57:27] [Thread-28/INFO]: [STDERR]: com.github.alexdlaird.exception.NgrokException: The ngrok process was unable to start.
[20:57:27] [Thread-28/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.process.NgrokProcess.start(NgrokProcess.java:160)
[20:57:27] [Thread-28/INFO]: [STDERR]: 	at com.github.alexdlaird.ngrok.NgrokClient.connect(NgrokClient.java:182)
[20:57:27] [Thread-28/INFO]: [STDERR]: 	at net.minecraft.class_436.md72bd1c$ngroklan$lambda$ngrokInit$5$0(class_436.java:600)
[20:57:27] [Thread-28/INFO]: [STDERR]: 	at java.base/java.lang.Thread.run(Thread.java:833)
[20:57:27] [Thread-28/INFO]: [CHAT] The ngrok process was unable to start.
[20:57:27] [Thread-28/INFO]: [CHAT] Ngrok Service Initiation Failed!
[20:57:27] [Thread-28/ERROR]: Uncaught exception in thread "Thread-28"
java.lang.RuntimeException: Ngrok Service Failed to StartThe ngrok process was unable to start.
  at net.minecraft.class_436.md72bd1c$ngroklan$lambda$ngrokInit$5$0(class_436.java:652) ~[client-intermediary.jar:?]
  at java.lang.Thread.run(Thread.java:833) ~[?:?]

notandvm avatar Aug 19 '23 04:08 notandvm

Hi @notandvm, does the ngrok directory exist on your machine? It should be created when trying to open a server.

Also, could you let me know what Linux distro and version you are using?

Flooflez avatar Aug 20 '23 03:08 Flooflez

Does anyone know an easy way to set up a Linux environment for me to test this myself…?

Flooflez avatar Aug 20 '23 03:08 Flooflez

Hi @notandvm, does the ngrok directory exist on your machine? It should be created when trying to open a server.

Also, could you let me know what Linux distro and version you are using?

it's being created properly yeah, path is ~/.ngrok2/ as intended inside is the executable, ngrok.yml, and ngrok.zip

distro & version is steamos 3.4.8

notandvm avatar Aug 20 '23 03:08 notandvm

running into this issue too, i'm on endeavourOS, minecraft 1.20.1 using Prism launcher flatpak version, ~/.ngrok2/ was not created here, maybe it's related to the fact it's running on flatpak, installing the appimage version to see what happens

Quiel245 avatar Sep 13 '23 02:09 Quiel245

running into this issue too, i'm on endeavourOS, minecraft 1.20.1 using Prism launcher flatpak version, ~/.ngrok2/ was not created here, maybe it's related to the fact it's running on flatpak, installing the appimage version to see what happens

Seems to have worked just fine now, so i guess this is not compatible with flatpak installs of minecraft, probably because of the lack of permissions to write into home of something like that

Quiel245 avatar Sep 13 '23 02:09 Quiel245