TunkDesign / NeMa

NeManager | The true real-time multi-server Minecraft control panel.
http://nemanager.com/
12 stars 0 forks source link

Wrapper having issue connecting to Dashboard #49

Open AtomicFall opened 7 years ago

AtomicFall commented 7 years ago

It seems the dashboard is having issues picking me up. Did a port check and WWW can see port 20000 and 20021.

It looks like your server is the one closing the connection before it comes up in the dashboard.

Windows server. Version 2.1.3

NeMa.zip packet_capture.zip

TunkDesign commented 7 years ago

You clearly have everything setup correctly as the panel could talk to the wrapper. There's nothing wrong with our connection either.

This happens so randomly it is very hard to find the cause of it. I am guessing you're getting the "Connection lost!" popup when this happens?

I can't reproduce it myself, but it is clearly an issue, as not only you get it. To tell you the truth, I don't even know where to start looking.

AtomicFall commented 7 years ago

I dont know the packet flow for the software transmissions ((im a network engineer by trade)) but looking at the packet cap and the log it looks like that somewhere mid setup it looks like the server either A) doesnt receive a specific packet from the wrapper ((see last two packets in packet cap needing retransmit)) and this the server shuts down the connection or B)something happens server side I cant see and closes the connection prematurely.

If you need help looking for the issue since I can produce it, just let me know and we can do a skype or teamviewer session.

CorruptedPhazite commented 7 years ago

I am having a similar issue. However I found that my router was blocking the pings and communications to the computer. My router is a Belkin AC1200 Dual-Band Gigabit Router (model# F9K1113 v5). The router does have an antivirus program, which is disabled, and a firewall. The pings were classed as POGs (Ping of Death) causing all other communications from the IP to be blocked. You could move the "add a wrapper" setting on the cloud interface to a local program installed on the computer which would probably prevent the POG issue.

CorruptedPhazite commented 7 years ago

Update: After disabling the firewall, WAN Ping Blocking, IMPC Ping Blocking, and setting up a port forward to my computer on port 20000 (The Protocol was bothe TCP and UDP) I was able to connect the wrapper to the online interface.

AtomicFall commented 7 years ago

Well dang. Disabling the my firewall just isnt an option for me. I host VMs for some customers out of my apt.

On Thu, Dec 29, 2016 at 2:54 PM, Robospot notifications@github.com wrote:

Update: After disabling the firewall, WAN Ping Blocking, IMPC Ping Blocking, and setting up a port forward to my computer on port 20000 (The Protocol was bothe TCP and UDP) I was able to connect the wrapper to the online interface.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TunkDesign/NeMa/issues/49#issuecomment-269692000, or mute the thread https://github.com/notifications/unsubscribe-auth/AMg0D5RLTrYvTDJPVMtVm8UsnpCpbNT9ks5rNB4IgaJpZM4LVhw1 .

CorruptedPhazite commented 7 years ago

Perhaps just port forwarding would work for you. As long as the pings from the main server are not marked and blocked by your router/network switch you should be good. You could also white-list all the IPs and/or MAC addresses related to their service.

TunkDesign commented 7 years ago

Sorry for the somewhat late reply, but is whitelisting an option? I'd feel bad to force you to disable your firewall completely.

NeManager might trigger your security because WebSockets are still "quite new" (Not really, but it isn't very known). It keeps the connection open when you access the panel, and is set to send data back and forth every 0.1 second. That could be the trigger!

If you haven't had a problem with other panels, this might be the issue here. We're the only panel that offer a true live feed. The other panels use a regular socket connection. (No open connection and a polling rate of ~3 seconds)

I am still looking for a way to not get triggered by firewalls and such.


Edit: Happy new year! :D Hope you guys had an awesome time!

CorruptedPhazite commented 7 years ago

I found that I could just port forward the ports 20000 and 20021 and it would be able to connect. However I have not been able to do anything with the server through the panel, something about not being able to connect. Finally, you might need have the local program initiate the ping to your servers as well as control the start, stop, and restart functions of the server. This could (fingers crossed) keep the firewall from tripping.

CorruptedPhazite commented 7 years ago

It is also possible that the location of the file plays a bigger roll in this as well. For example I put the folder for this in my documents. Thinking about it though, my documents is usually protected from outside interaction, modification, or even viewing. You may need to actually install the program it is always located in the same location and so windows views it as a program and thus gives more permissions to the application. By the way, I did try running the wrapper as an administrator to see if it would allow me to use the online GUI.

TunkDesign commented 7 years ago

@Robospot, I have done quite a lot of changes to the WebSocket class of the panel, which should make the connecting part better. I have yet to publish that update. Still need to go through the live-feed part of the panel, which is causing a lot of issues (apparently). I have the PHP part (backend/initial ping) of WebSockets all figured out. It's the JavaScript part (frontend/live feed) that is a bit tricky, which is weird (Should be the other way around).

Not sure how I would go about making the wrapper do the initial ping when the panel is hosted elsewhere. The wrapper needs a handshake in order to do anything, and the panel does that with the initial ping!

The wrapper is already doing everything server related. The panel is only sending a trigger to the wrapper.

You may be correct in Windows being overprotective about stuff. I'll do some tests in a virtual environment to see if I can confirm that theory. In which case, I'll need to bundle the wrapper with an installer for Windows.

CorruptedPhazite commented 7 years ago

Maybe have the wrapper convert the JavaScript live feed to another format that can be more easily dealt with or an RSS feed.

TunkDesign commented 7 years ago

@Robospot Sorry, I'll try to explain it better.

The wrapper is essentially just a WebSocket server, and the panel needs two connection stages for it to work the way I intended.    The first stage being the panel backend (done behind the scenes with PHP). Which is the stage that makes the handshake to confirm that you are allowed access to that wrapper and to make sure everything is correct.    The second stage is the "live-feed" stage, the front-end if you will (done with JavaScript). Which is the WebSocket client. It is essentially just a GUI for the wrapper. Our "format" is "WebSocket" and I can't change that :)

The wrapper and panel sends JSON data back and forth for processing.

Hope this clears everything up! :)

dustinduse commented 7 years ago

Similar problem. When setting up Servers the control panel sees the wrapper. Connection shows fine allows setup. Wrapper confirms the creation.. Went back to edit server I get this "Empty read; connection dead? Stream state: {"stream_type":"tcp_socket\/ssl","mode":"r+","unread_bytes":0,"seekable":false,"timed_out":false,"blocked":true,"eof":true}" Trying to view the server dashboard i see the same thing. And Wrapper not found.. Windows os. Firewall disabled doesn't seem to affect it.