Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.43k stars 382 forks source link

Player connecting issues #947

Closed Puremin0rez closed 7 years ago

Puremin0rez commented 9 years ago

After a random amount of time, players are no longer able to join and get stuck on connecting or "Found Server.". Everyone playing can still play until they disconnect.

Running PR2 on Mono 4.0.2

Efreak commented 9 years ago

I'm having this same issue.

I'm also having another issue: I can't actually type into the server console once it starts listening. ctrl+c doesn't do anything; the only thing I've tried that has any effect is ctrl+z, and that just suspends the process until I fg or bg it.

I've tried the following setups as described here:

  1. Mono 3.2.8+dfsg-4ubuntu4 with PR2:

    sudo apt-get install mono-complete
    mkdir -p ~/ts/tshock && cd ~/ts/tshock
    wget ...tshock.4.3.0-pre2.zip
    unzip tshock.4.3.0-pre2.zip
    rm ServerPlugins/Mysql.Web.dll
    mono-boehm TerrariaServer.exe

    I need to use mono-boehm (I think this means a different garbage collector, not sure) for it to work. I also need to remove ServerPlugins/Mysql.Web.dll. The server will now start. When I connect, however, the server log shows the connection, then Terraria gets stuck on Found Server.

  2. Compile mono myself, then use the previous install

    sudo apt-get remove --purge mono-runtime mono-complete .....
    cd ~/ts
    git clone git@github.com:mono/mono.git && cd mono ./autogen.sh && make get-monolite-latest && ./configure && colormake -j4 && sudo make install && cd .. #compile/install mono, then go back
    cd ~/ts/tshock
    mono TerrariaServer.exe

    This has the same issue with having to remove the MySQL dll, and with connecting to the server; the only noticeable difference is that I can use mono and not mono-boehm.

  3. Compile TShock myself, and try using it with the mono I compiled earlier.

    cd ~/ts
    git clone git@github.com:NyxStudios/Tshock.git tshock-git
    cd tshock-git
    xbuild /p:Configuration=Release TShock.sln
    #cp files so they're in the same folder structure as the release
    mono TerrariaServer.exe

    This works exactly the same as attempt 2. There are no noticeable differences at all.

  4. Compile a debug build of TShock myself, and try using it with the mono I compiled earlier.

    cd ~/ts/tshock-git
    xbuild /p:Configuration=Debug TShock.sln
    #cp files so they're in the same folder structure as the release
    mono TerrariaServer.exe

    This works exactly the same as attempts 2 and 3. There are no noticeable differences at all. I had hoped that the debug build would include some kind of debugging output that I can give you, but it doesn't tell me anything. The output is the same as before.

recon88 commented 9 years ago

Same here. Players are not able to connect at all and stuck at "Found Server". Ports are opened and the Firewall isn't blocking it.

Running Debian Jessie with Mono 4.3.0.

Edit: Removed the TShockAPI.dll from plugins and it seems to be working fine. Looks like a bug in tShock :/

benv666 commented 9 years ago

Same here with TShock v1.3.0.4 running on a self compiled mono 4.0.1 on Slackware64. After removing ServerPlugins/TShockAPI.dll it works, although now half the server commands are missing (no big surprise).

recon88 commented 9 years ago

So is this actually fixed or not?

QuiCM commented 9 years ago

Haven't received any reports in 9 days, assuming so. If you're experiencing issues still, please try to reproduce them on build 497

Efreak commented 9 years ago

I was still having the issue. Oddly, it's now working fine after I wiped everything so I could record it with ttyrec. I'm not sure what's going on there. Also, I'm not sure what 'build 497' is, since the releases don't seem to have build numbers on them?

lwb4 commented 7 years ago

I am now having the same issue in 2017. I suspect it may be because my vps has relatively little memory (2GB) but unsure. Mine either freezes on "Server Started" (after world load) or on the screen just after that, and when you try to connect, occasionally it will say " is connecting...", but freeze on "Found Server" in the client. Did you ever resolve the issue?

hakusaro commented 7 years ago

What's the output of free -m @lincoln-b?

hakusaro commented 7 years ago

img_1281

lwb4 commented 7 years ago

The output of free -m is:

image

I saw that page but hoped it not be a problem because of https://www.vultr.com/docs/running-a-tshock-terraria-server

image

hakusaro commented 7 years ago

Can you clarify: is that free with or without Terraria running?

lwb4 commented 7 years ago

That's without. Running top with TerrariaServer running shows 99% CPU usage and ~5% memory usage.

On Jul 1, 2017, at 5:42 PM, Lucas Nicodemus notifications@github.com wrote:

Can you clarify: is that free with or without Terraria running?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hakusaro commented 7 years ago

Can you run free -m with it running?

On Sun, Jul 2, 2017 at 1:05 PM lincoln-b notifications@github.com wrote:

That's without. Running top with TerrariaServer running shows 99% CPU usage and ~5% memory usage.

On Jul 1, 2017, at 5:42 PM, Lucas Nicodemus notifications@github.com wrote:

Can you clarify: is that free with or without Terraria running?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Pryaxis/TShock/issues/947#issuecomment-312510612, or mute the thread https://github.com/notifications/unsubscribe-auth/AAggp2jdemDT_iM-e-xedQ0-FIzQVnqTks5sJ-oCgaJpZM4FScq2 .

lwb4 commented 7 years ago

Yes. Here's free -m after it loads the world data and freezes:

image

And here's top running as I start the server. CPU usage shoots up to 96-98%, and then falls after TerrariaServer freezes. Memory usage stays at a steady 30%.

image

hakusaro commented 7 years ago

Neither of those are free -m...

lwb4 commented 7 years ago

Sorry, wrong screenshot. One sec. Edit: got it now.

hakusaro commented 7 years ago

I would suggest adding a swap partition or file of standard size and see if those issues persist. Also, what version of mono are you using?

hakusaro commented 7 years ago

Also, if you edit comments they aren't reflected in discord, so there's a high probability people assumed you never changed anything (like I did).

screen shot 2017-07-02 at 10 07 48 pm

tylerjwatson commented 7 years ago

@lincoln-b Can you please post the output of mono --version.

Looks like it's still happening. Reopening.

lwb4 commented 7 years ago

@hakusaro Thanks! I will look into making a swap partition. What do you mean by file of standard size?

@tylerjwatson Here it is:

image

rautamiekka commented 7 years ago

^ Whether you're making a swap partition or a file you'll still have to worry about how much space you're giving it, and I read Ubuntu, for instance, stopped offering swap partitions in favor of files for performance and maintenance reasons.

tylerjwatson commented 7 years ago

You have an ancient version of mono. Install mono >=5.0 or run tshock with the MONO_THREADS_PER_CPU environment variable.

MONO_THREADS_PER_CPU=50 mono TerrariaServer.exe

And see if that fixes the issue.

lwb4 commented 7 years ago

Exporting MONO_THREADS_PER_CPU to 50 resolved the issue. Thank you!

I don't know why my version of mono is so out of date. I typed sudo apt-get mono-complete and that's what I got.

hakusaro commented 7 years ago

We really need to bold and italicize this somewhere. I'm kicking myself for not asking if you did this first.

screen shot 2017-07-03 at 4 48 58 pm

lwb4 commented 7 years ago

And I'm kicking myself for it being such an easy fix. Thanks for bearing with me.

tylerjwatson commented 7 years ago

Ubuntu LTS has really old versions of packages. Consider adding the xamarin ppa for more recent mono releases.

Glad it fixes the issue, I am re-closing this again.