citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.58k stars 2.12k forks source link

Issue Disabling OneSync past GameBuild 2802 #2509

Open KushCreations opened 6 months ago

KushCreations commented 6 months ago

What happened?

hey, had this issue for a while but recently setup fresh server just to double check it wasn't any resources I use messing something up.

the problem is Disabling OneSync on any server using Game Build 2802 or Higher, results in an Error if more than 1 person tries to join. this is the Error for people joining onJoin GTAV is up to date and clean server so not issue with files, and if I enable OneSync people can join again.

I've Seen some other servers have the same problem and I noticed in another Bug Report the exact same thing, but that one was closed with the answer/fix being enable OneSync, for me OneSync causes worse Sync between players in vehicles and puts invisible bubbles around them that throw collisions off, so i would rather not enable.

here is a log of crash too if helps CitizenFX_log_2024-05-08T205504.log

Expected result

Game Build above 2802 Works with OneSync Disabled

Reproduction steps

  1. Run a Server with any Game Build above 2802
  2. Disable OneSync
  3. Have more than 1 Person join the Server

Importancy

There's a workaround

Area(s)

FiveM, FXServer, OneSync

Specific version(s)

FiveM Build 2802 and Above

Additional information

No response

tens0rfl0w commented 5 months ago

This was fixed with commit https://github.com/citizenfx/fivem/commit/22d9149f3f7dbdff1446a58cf5275bbb724a1840.

Try FXServer build 8540 or higher.

gottfriedleibniz commented 5 months ago

This should still be an issue (I think). 2824 began/continued changing relays which was further changed in 2944. Don't think those netPeerAddress bits were ever updated for 2944 (nor the changed session initialization/request functions).

KushCreations commented 5 months ago

can confirm, checked and this is still a problem on 2944

tens0rfl0w commented 5 months ago

Don't think those netPeerAddress bits were ever updated for 2944.

Right, this seems to be only handled for 2824.

Though, when testing the fix for the recently introduced regression, I couldn't replicate any hosting (or join) failures when using the changes that are present on server build 8540 with the game builds 2944 and 3095.

Talking to someone who is currently having a similar issue makes it look like this is depending on the 'client' version, e.g. version difference? In their case, playing together only works between Steam<->Steam and not Steam<->Rockstar game versions.

KushCreations commented 5 months ago

Tried again earlier with 8695 and 3095, still the same problem for me. :(

I can replicate easy so that's weird, no issues for you? all I have to do is disable onesync, like I say tried on fresh server with nothing added, so not sure what could be different =/

I don't think its related to game versions for me either, but haven't been asking to know for sure, doesn't seem to be picky though. the first two people that joined after me got the same error as above :(

Nobelium-cfx commented 4 months ago

I'm currently looking into this issue. But I can't reproduce it. I connect to a 3095 build server, with "set onesync off" in the config. I can connect to the server with 2 and 3 clients without any issues (didn't test with more). All clients are on Rockstar game version tho.

@KushCreations can you still reproduce the issue? If so - I would be interested to figure out whats the difference in our setups, so I can reproduce and try to fix the issue.

KushCreations commented 3 months ago

hey ✌️
Its still easy to reproduce for me but its difficult for me to test theory properly as server is pretty quiet lately

I did a quick test with 3 people, but we are all using steam versions so not the best test, Server is currently using 9424 and game 3258. same issue 1 person can join anyone after that gets the error.

I have the epic version I could maybe install and see anything's different (not much storage left though so that will be fun), I don't have the R* version to test unfortunately

but i guess its looking likely the client versions are causing the issue if the only difference is we're steam and you'r R* 😕

Nobelium-cfx commented 3 months ago

Hm. Thanks for confirming!

Yea, at this point it looks like the game version is the only difference. I'll try to get the Steam one and test with it then.

KushCreations commented 3 months ago

all good appreciate you looking into it 💚 I know disabling onesync isn't really concern for most servers

Nobelium-cfx commented 3 months ago

I've finally got the Steam version of the game and was able to test. Everything still works just fine for me. I have both versions of the game on my machine, so that could interfere somehow. But CitizenFx.ini points to the Steam version, so it should be ok. Tested with vanilla server version 9424 (https://docs.fivem.net/docs/server-manual/setting-up-a-server-vanilla/) and game build 3258. Everything is fresh installed.

So I guess there is something else in play?

@KushCreations how does your server.cfg file look like (but remove any private data before sharing it of course, like the license key)? Do you have any additional resources / mods, and if you do - can you try turning them off?

Nobelium-cfx commented 3 months ago

Also, do you use Windows or Linux server?

KushCreations commented 3 months ago

is it possible that this has been slyly fixed? doesn't seem to be an issue for me anymore either,

just tried on my fresh server using 9601 and 3258 and multiple joined no problem. so have disabled on my main server and no issue there yet either. 👍

I will leave disabled for now and let you know but its looking good. this has been a problem for over a year so if no ones attempted to fix I'm confused but not complaining 😜

if you still want to look into it both servers on Windows, my server.cfg is just fresh so I can't see that being different but below if want to check server.txt

KushCreations commented 3 months ago

yeah I spoke to soon, it worked shortly for me joining from two separate machines and one guy on steam.

but now someone on epic is in the server and I cant join again. 😆

I really have no idea, now it just seems random again it definitely didn't work between the same people the other day, but today it did, but now it doesn't 💀

Nobelium-cfx commented 3 months ago

Oh... Sounds like a tricky issue. But all new information is good! I'll look at the server configs and ask around. Also test a bit more - the issue is flaky, so maybe I will be able to catch it myself after some time.

Could it be connected to the fact that you created the fresh 9601 server? I.e. it is something that accumulates with time. Did you just update the server binaries, or did you also clear the server data (resources/cache/db) (i.e. cfx-server-data in terms of https://docs.fivem.net/docs/server-manual/setting-up-a-server-vanilla/#installation)?

KushCreations commented 3 months ago

yeah the fact it worked for 20mins and then didn't broke my head a little bit 😆 I will keep playing and see if I can narrow it down, try start fresh again with latest files and see how it goes. are the base resources updated often? I couldn't find in fivem to check but I assume last update wasn't a year ago?

I made the fresh server just for testing this and have replaced the resource files once during, cleared the cache every time updated artifact, but I haven't done fresh resources every time,

Nobelium-cfx commented 3 months ago

I will keep playing and see if I can narrow it down, try start fresh again with latest files and see how it goes.

Thank you. Im curious to see if the fresh start fixes the issue again!

are the base resources updated often? I couldn't find in fivem to check but I assume last update wasn't a year ago?

Yes, I think it was last updated more than a year ago. I wouldn't expect the issue to be related to the changes in base resources. But it could be something caused by some additional custom ones.

KushCreations commented 3 months ago

the problem with fresh server seems to be fine now. set up new again and couple of steam and a epic user joined few times no problem, so that's awesome 👍 this may have been the case the other day too and I just didn't realise because I was switching between servers only changing the artifact.

but then I added all my resources from main server to that one and the problem started again 😞

I've spent the day adding and removing resources testing with couple of people between each 💀 but managed to track down which ones are my problem so it looks like some resources are causing the error now, but I cant see any connection between them.

there's 2 script based "kq_driftsmoke" and "kq_rgbcontroller", these are escrowed so unfortunately cant dig deeper into them but I know some scripts can require onesync so not unbelievable they might be a problem, will have to see if the creator knows a little more about those though

then there's 3 maps which I have no idea why they could be an issue, do you know any reason why a map would require onesync to be enabled? these are maps I've made myself so I will be looking at them to see if I can figure out what's going on but they are just like the 30 or 40 others I've made that work with no issue so I really have no idea at moment.

KushCreations commented 3 months ago

never mind my brain is broken again 🥴 the above was all on a local host so I did a fresh start on my vds and set everything up exactly the same but there's still an issue.

still works fine between the steam player now, but not the epic player, still gets or creates the error joining.

if I add one of the resources I mentioned back in then the steam player cant join again.

baffled as to what could be going on now, is this still difficult to replicate for you? 😆

KushCreations commented 3 months ago

so the epic player managed to get into the server eventually, so can work between steam and epic when it wants to, but a few people tried to join while we were playing and they got the error. not sure if they were steam epic or R*.

also I was curious so I added that kq_rgbcontroller and kq_driftsmoke to another fresh server and it didn't produce any join errors on a quick test. so it doesn't seem to be directly caused by those resources themselves but maybe conflicts between them and others or maybe completely random 😆

It just seems to be caused by so many different things for me its looking impossible to pinpoint the main problem 😩

Nobelium-cfx commented 3 months ago

Yea, from what I hear, I don't think the game version has much weight here. Just a red herring.

My current assumption that its a single resource or a combination of the resources that cause problem that accumulates and gets more noticeable with time.

baffled as to what could be going on now, is this still difficult to replicate for you? 😆

No luck for me yet. But I didn't have time yet to run any actually long tests. Sorry, Im a bit swamped with different things at the moment.

I also need to see if I can get the resources that you've mentioned for a test myself.

also I was curious so I added that kq_rgbcontroller and kq_driftsmoke to another fresh server and it didn't produce any join errors on a quick test.

IIRC quick test on fresh server always worked regardless of resources. Seems like the problem appears after some time passes.

Nobelium-cfx commented 3 months ago

The "kq_rgbcontroller" seems to have been deleted and is not available anymore.

But I got the "kq_driftsmoke". Will test/check it and see if I can find something related to the issue.

KushCreations commented 3 months ago

yeah that sounds plausible. well I managed to pick out the problem ones while continuing to add afterwards so it seems some definitely make more of an impact than others for whatever reason.

this is the rgbcontroller resource, there's a free version but I use the paid one that adds some animation sequences to lights, not sure if will make a difference for test. https://forum.cfx.re/t/rgb-controller-basic-free-standalone/4765872

also these are a couple of the maps that caused me problem too if helps CasinoDrift.zip Pal_AirBridge.zip

Casino one is just a mess about test on that track behind it, it requires another resource that removes part of the map to fit it but that a separate resource that didn't cause any issue. the pal_airbridge was a connection I made for someone to join the main map to an airport up in paleto I had a quick look over them but nothing stands out as a problem, that casino one especially is very basic.

Nobelium-cfx commented 2 months ago

Sorry for the late reply.

I've checked the resources and maps that you've mentioned - they look harmless when it comes to being a culprit for this issue.

Also I've conducted a few hours test with 3 clients (Steam and Rockstar Launcher versions) and resources that you've mentioned. I disconnected and reconnected multiple times by each client, rode around the city etc.

At some point I managed to get the "Could not connect to session provider. This may happen when you recently updated, but other players in the server have not. Alternately, the server accepted you, despite being full. Please try again later, or try a different server." error. But disconnecting and reconnecting a client fixed the issue and I couldn't reproduce it again. On the server side I got errors like "Server list query returned an error: System.Net.Sockets.SocketException: Operation timed out <- System.Net.Http.HttpRequestException: Operation timed out".

When the error happen, is it consistent for you? Does it persist after you restart some/all clients? Does it persist after restarting the server? Do you see any messages in the logs (both client and server side)?

I wonder if it could be just a general flaky problem with non-onesync synchronization, that is being mistaken for issue with never game builds. I.e. when it happens on the old build people just restart the game without reporting the issue.

KushCreations commented 2 months ago

all good ✌️ when I disabled onesync it let me straight in with one other person which was pretty amazing, but then I left and got a few join errors before it let me back in, it will just do that at random it seems.

at moment I have removed the casinodrift and pal_airbridge maps from my main server and people can join half of the time, restarting after error does seem to work but its less kind for me, will usually take people more than 1 restart just depends on luck.

but If I add those maps back in the error seems to happen consistently, I went to 10 join errors before I gave up and removed the maps again, then it took a couple of tries and I got in again

I'm guessing if you keep adding in resources eventually you will get to the same point as me though im not sure which ones exactly 😕
I probably have other resources that are contributing but didn't notice them while testing because the server randomly decided to work and not work while adding and removing different stuff 😆

nothing in my server console too, other than resources starting and after that just the joins, nothing when it drops people, just the host state stuff that shows up client side like near the bottom of the log in original post.

the join error is not something I've ever noticed on older builds too, 2802 or before are all fine as far as I'm aware, I left my server on that build for long time without any issues and I know a couple servers that still run that build with no similar issues

Nobelium-cfx commented 2 months ago

nothing in my server console too What about the client side? I.e. if you press F8 when you get the error. What logs do you see there?

the join error is not something I've ever noticed on older builds too, 2802 or before are all fine as far as I'm aware, I left my server on that build for long time without any issues and I know a couple servers that still run that build with no similar issues Hm. Ok that does sound convincing.

Well, now I know that it is reproducible. We just need to figure out what makes it more or less common. I'll keep playing with it in the background :)

KushCreations commented 2 months ago

I included a client crash log in original message, I didn't really point out what was in there though so that's my bad, there's some stuff near the bottom of log to do with the host state when it gives error.

image

Nobelium-cfx commented 2 months ago

Oh, sorry, I did not notice that its already there. Thank you!

MisterCookie1234 commented 3 weeks ago

Hello there! Do we have any update on this? We've noticed this "causes worse Sync between players in vehicles and puts invisible bubbles around them that throw collisions off, so i would rather not enable." aswell and even tho we are just a small friend-server, its a bummer for any type of racing.

Nobelium-cfx commented 3 weeks ago

Hello there! Do we have any update on this? We've noticed this "causes worse Sync between players in vehicles and puts invisible bubbles around them that throw collisions off, so i would rather not enable." aswell and even tho we are just a small friend-server, its a bummer for any type of racing.

No, sorry. It has been lesser priority than some other more critical issues. It's still in my backlog, but not sure when I'll have time to continue it.