-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Go Docker: Connection establishment fails #31
Comments
@gekigek99 do you have a source for the the server info packet or did you just try stuff out and can point me in the right direction for the server type? |
I am straight up unable to connect to the docker server after implementing the changes from master into the docker branch. @gekigek99 I guess that this is somehow correlated to the advertising of a vanilla server and it being a modded forge server, but do you have any other ideas what changes could have broken something for the docker environment? |
no i just did raw research as they say and wrote in the wiki what I found. to get the correct server version you need to:
the script will capture 2 parameters that you need to replace in the script to make it work again (next week i am planning on writing an update to make the process automatic (i will use an external config file that will be automatically updated when a new version is available)) |
it is not enough to just change the "serverVersion" you also need to change the "serverProtocol" parameter these 2 parameters can be obtained with the procedure described above (this should make the ping/server version work again) |
first try to see if the ping/server version works again with the procedure described above, then try to connect to the server (so we can see if these are related problems)
does it work with a non-modded server? Right now i can't dedicate much time to the issue as i have exams but next week i should hopefully be able to dig into this |
This is the next step I have to test. I just thought that I might ask if you had any idea, before going on a journey to test a multitude of configurations^^
No worries. Focus on your exams, the old version is still up and running. I created a development tag on Dockerhub for testing new versions :) |
When trying to join. Somewhere must be some miscommunication, as the old version correctly displays my username and starts up the server, while the new version goes into the routine for asking for the server info and not the join routine... Maybe there is a problem within the docker environment. I will have to try running the script on my PC directly and then when that works transition into a Docker container again. |
It's quite strange because the new version, apart from the ping/"outdated" warning (because at mojang they updated the serverProtocol to a value higher than 751), it works ok for me (with vanilla server and not in the docker env) Try to find the "serverProtocol" you need with that procedure and so we can confirm at least that the "require server info" part of the script is working correctly |
I am currently testing some different configurations and encountered a different bug in the main go script. |
@lubocode yes i'll open it |
After testing a multitude of configurations and comparing the different version of the code I think there is no problem with the script itself. Maybe with the new server protocol does something different and that gets blocked by my PC. The script version from six months ago continues to work in the Docker with 1.14.4 and forge. After that I will go deeper with capturing the server response, as you mentioned.
|
Also, testing with WSL (2) is not good, as there seem to be some other problems occuring. Maybe due to the special environment mix. |
After testing just with my machine I can say that the advertised server version and protocol do not have an impact on being able to connect to the server if the server version is different or the server is modded. |
I unfortunately can only test it in this way for now... |
something i can tell you for sure is that in the last 2 images serverVersion and serverProtocol are written in the wrong way: (remember always to check the config.json for errors like |
Config looks good. The numbers are written in the same way as in the original.
No problem. Me neither, so I just work with what I know^^ |
ok no problem! could issue 31 and 34 be related in some way (like the same problem from different point of view)? |
Can we just make the point of the situation again? ;) Just so that in the next days i'll have a base from where i can help a little more ;) |
I don't know. For now it seems like this issue indicates a problem before starting the server while issue 34 indicates a problem after starting the server and either detecting the version or a player leaving the server. |
Sure, I will create a summary tomorrow afternoon, when its not 5 minutes to midnight and I can concentrate a bit better^^ |
okok but then how can you reach the problem after starting the server if the problem before starting the server prevents you from connecting at all?
ok thanks take your time |
Well, that is because issue #34 seems Windows (10?) specific, while this issue #31 is happening with the Docker image I tried building from merge #29 . As for what you might be able to test... Maybe take the script from the docker branch and run it on a native Linux distro like Ubuntu. If that works, try installing the development docker with If there are no problems for you, don't sweat it. I will come back to it next week and do some more testing after implementing more logging. You can then just focus on what you would like to do with the master script, or if there is nothing and you feel bored, maybe add some code comments, so that it will be easier to understand for newcomers^^ When I come back next week, we can also have a skype/discord/whatever session and talk to further our understanding of these problems without making more of a mess through communicating with issue comments 😅 |
okok i understand better, for now i think i'll focus on solving issue #34 and adding comments to go version (and i think that will keep me busy enough ahah)
yep you are right i opened issue #36 for that (the wiki is more like for me to remember things though ahah)
yes i think it's a more appropriate way of doing things ahah
great! |
so... i've looked fastly at possible differences and i don't see where the problem might be... you try to join and it says you that you requested server info then it closes connection this is what happens on the script: (the green is what it's doing the red it's what it should do) we need to understand why buffer[dataLen-1] == 0/1 and not 2 in docker so i would try adding an |
Trying to join (server still down, connection fails):
Requesting server info:
|
Spamming the server with requests and cancelling them leads to a server startup eventually. |
this is the problem i explained to you yesterday where golang tends to put packets together (only sometimes... and this explains why eventually the server starts)...
(the highlighted 2 is the one that should trigger the start command) (the second packet is containing the player name after the |
It now works. See commit 314fcc7 for the fix for connection establishment. |
@lubocode as a side note:
i removed it after discovering how the header magic works (11 0 9) because i understood it worked only for playerName length of 9... this is why for you the old version was working and the newer ones did not: you were lucky enough that your playerName is the same length as mine and therefore 11 0 9 where the correct numbers to make everything work for your specific case, but would not have been functional for others. now the FindPattern idea has been re-implemented in commit 831332b |
Make Server version into a Docker ENV variable and parse it in main.
Currently script advertises vanilla server. Previously, when neither advertising version number nor vanilla status, modded MC servers worked without a problem. Make this either dynamic or remove it from info string.
Edit: The two things above are partly implemented with the config.json from the latest commits on master.
The actual problem seems to be earlier during the connection establishment of the join process.
The text was updated successfully, but these errors were encountered: