Skip to content

Instantly share code, notes, and snippets.

@jrbergen
Last active March 1, 2024 21:22
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jrbergen/0ce746676c4fbcc2becd6054d1bba2ed to your computer and use it in GitHub Desktop.
Save jrbergen/0ce746676c4fbcc2becd6054d1bba2ed to your computer and use it in GitHub Desktop.
Instructions to resolve Company Of Heroes 2 Sync-Error for Proton (Tested on 5.0-10)

Instructions to resolve Company Of Heroes 2 Sync-Error for Proton (Tested on 5.0-10 and 6.3-2)

In support of this comment on Proton's CoH2 issues thread: Company of Heroes 2 (231430) #3875

Based on original solution by @Cytomax55 in the same thread.

Edit Feb 2023: this may also work for CoH3 (the paths are different of course). I haven't tested this for CoH 3 yet and hope either Proton / Relic will make this fix unnecessary. See also @sfxworks's comment.

Instructions for automatic fix with a script by TechT10n

  1. You may want to disable cloud-sync for CoH2 on steam as it can cause issues. Thanks @Commando-Brando
  2. Open your terminal, and run*:
curl https://gist.githubusercontent.com/TechT10n/79b853003f2e9841a18e8b6decd0fd3e/raw/coh2_multiplayer_fix.sh | bash

If this doesn't work (because for example your Steam path is different from the default), you may have to copy the script from that link and alter the part where the path is specified, and then run it locally (see also this comment).

If that still doesn't work for some reason, you can follow the manual steps below:

*Note that this runs a remote shell script directly; it is always a good idea to check the script's contents before running it (just open the URL to the gist in a browser) to make sure it doesn't do anything weird. I don't have any malicious intent and I have no reason to think TechT10n has either, but it is good practice regardless.

Fallback instructions to perform the workaround manually

Note: some users have reported that reinstalling and clearing the Steam cache is unnecessary; you can try to skip step 1 to 4 and start at step 5, but your mileage may vary.

Additionally, this fix does not always seem to work; I have no clue as to why it does work for some and doesn't for others, or why it seems to stop working sometimes even with the same system/config. It should be deterministic 🤷‍♂️.

  1. You may want to disable cloud-sync for CoH2 on steam as it can cause issues. Thanks @Commando-Brando

  2. Uninstall/delete CoH2:

    • (1a) Uninstall CoH 2 on steam.
    • (1b) Delete remaining files here: rm -rf "~/.steam/steam/steamapps/common/Company of Heroes 2"
    • (1c) Delete compatibility data for CoH2: rm -rf ~/.steam/steam/steamapps/compatdata/231430/
  3. Clear download cache in Steam -> settings -> "downloads" tab (requires Steam login afterwards; ⚠️make sure you know your Steam credentials beforehand!⚠️.

  4. Reinstall CoH2 on Steam.

  5. Launch CoH 2 -> at this stage game would still give 'Sync Error' in multiplayer games either immediately after loading the map or when first enemy is encountered with proton 5.0-10, 5.13-6, 6.3-6, experimental, 6.14-GE-2.

  6. Download vc_redist.x64.exe at ✅https://www.microsoft.com/en-us/download/details.aspx?id=48145 from the microsoft website. Note that another link, namely ❌https://aka.ms/vs/16/release/vc_redist.x64.exe did NOT WORK, as it was missing the required DLL at the time this report was submitted.

  7. make separate directory to extract vc_redist.x64.exe to. E.g. mkdir /tmp/vcredist && cp /PATH/TO/DOWNLOAD/vc_redist.x64.exe /tmp/vcredist/vc_redist.x64.exe.

  8. cd to the download directory and extract vc_redist.x64.exe using cabextract to the directory you chose as such: cabextract vc_redist.x64.exe -d /tmp/vcredist. If this did not result in ucrtbase.dll being extracted, use cabextract again to extract a10 specifically.

  9. Copy or move ONLY ucrtbase.dll to ~/.steam/steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32/ (cp /tmp/vcredist/ucrtbase.dll ~/.steam/steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32/) . May require sudo privileges.

  10. Launch Company of Heroes 2 in Steam using Proton 5.0-10. I have only played 1 match, but given that the sync-error would occur immediately or on the first enemy sighting before, I suspect this resolved the sync-error issue. Not yet tested on 6.3-2.

Another note: tested on Steam native client, Manjaro w/ kernel 5.10.59

@b3nis
Copy link

b3nis commented Jun 6, 2022

Thanks!

I didn't have to reinstall - I just copied the file over (as recommended). One thing to know: if you change proton version after copying the file - it will get overwritten and you have to copy it again.

@jrbergen
Copy link
Author

@tapilinp @b3nis You're welcome!

@b3nis Good to know that switching Proton rewrites the file, thanks :).

@ritschmaster
Copy link

ritschmaster commented Jul 27, 2022

Works fine on Fedora 36. Runs off great on a first time installation.

@ArvalCode
Copy link

When I do #7, it says no such file or directory. Any tips?

@Commando-Brando
Copy link

@ArvalCode I ran into this issue not having the ~/.steam directory which was because I had Steam installed as a flatpack. I am running PopOS so I uninstalled the flatpack and installed the .deb version. Install steam from your package manager or installer of choice so you can get the best non-flatpack version

@Commando-Brando
Copy link

After completing these steps I still experience the desync error. My System:
PopOS
Steam .deb version installed via Popshop running with Proton Proton 5.0-10
Kernel 6.0.12

@b3nis
Copy link

b3nis commented Feb 5, 2023

After completing these steps I still experience the desync error. My System: PopOS Steam .deb version installed via Popshop running with Proton Proton 5.0-10 Kernel 6.0.12

Weird, I installed it today on a new Fedora installation and it works flawless.
One thing that it's easy to get wrong is to first choose the right proton version - then copy the file.

@sfxworks
Copy link

Same instructions apply for Company of Heroes 3 if you see something like this
image

Path is ~/.steam/steam/steamapps/compatdata/1677280/pfx/drive_c/windows/system32

@TechT10n
Copy link

TechT10n commented Apr 3, 2023

While it might seem obvious, the path in the directions listed here are only valid if you have your steam library in the default location.

In my case I don't have enough physical storage on my primary ssd, so some of my games are stored in the default location, while some others (including COH2) are mounted to an alternate path on a secondary drive.

So if you get a No such file or directory error, you probably have to modify the first part of that path.

in my case I had to modify ~/.steam/steam/* to /mnt/games/SteamLibrary/*

Also, in response to this point...

Additionally, this fix does not always seem to work; I have no clue as to why it does work for some and doesn't for others, or why it seems to stop working sometimes even with the same system/config. It should be deterministic man_shrugging.

I would hazard a guess that the reason may be due to file permissions for anybody who copied the file as sudo.
-rw-r--r-- 1 root root 960312 Apr 2 19:47 ucrtbase.dll

if you don't change owner/group, it likely cant read the dll when you're in the game.

I wrote a simple bash script that worked for me.

coh2_multiplayer_fix.sh

@StevesChair
Copy link

StevesChair commented Apr 5, 2023

While it might seem obvious, the path in the directions listed here are only valid if you have your steam library in the default location.

In my case I don't have enough physical storage on my primary ssd, so some of my games are stored in the default location, while some others (including COH2) are mounted to an alternate path on a secondary drive.

So if you get a No such file or directory error, you probably have to modify the first part of that path.

in my case I had to modify ~/.steam/steam/* to /mnt/games/SteamLibrary/*

Also, in response to this point...

Additionally, this fix does not always seem to work; I have no clue as to why it does work for some and doesn't for others, or why it seems to stop working sometimes even with the same system/config. It should be deterministic man_shrugging.

I would hazard a guess that the reason may be due to file permissions for anybody who copied the file as sudo. -rw-r--r-- 1 root root 960312 Apr 2 19:47 ucrtbase.dll

if you don't change owner/group, it likely cant read the dll when you're in the game.

I wrote a simple bash script that worked for me.

coh2_multiplayer_fix.sh

I am a complete noob here so any help is appreciated. When the guide states to create a new directory, what is that exactly? I am on a steam deck and must use proton and would love to get this working to play with a friend. I assume I am making a folder but where am I placing a "directory"?

I too have the game installed on a seperate drive, in this case on a micro SD card, the path for that on my deck is (I assume) "/run/media/mmcblk0p1/steamapps/common/Company of Heroes 2"

@TechT10n
Copy link

TechT10n commented Apr 5, 2023

@StevesChair - Yes a directory is another name for folder.

the bash script that I linked to here should go through all of the steps that are outlined on this page.

if you download that script and run it from a terminal window it should save you the trouble of going through all of these steps manually, and it will even make sure file permissions are set properly.
Just open the script in any text editor and change this line:
STEAM_ROOT=~/.steam/steam
to
STEAM_ROOT=/run/media/mmcblk0p1

From there, you'll need to open up a terminal window and run the script.
Just CD (change directory) to wherever the script downloads to (most likely it would be cd ~/Downloads/)

From there you just run these 2 lines

chmod +x coh2_multiplayer_fix.sh
./coh2_multiplayer_fix.sh

I don't own a steam-deck, but if you're not sure how to launch a terminal, I found this video that shows how.
https://www.youtube.com/watch?v=o3qGghmwh9A

If the bash script fails, it may be that you are missing one of the following programs. Run this to install them, and then re-run the script.

# for arch (SteamDeck / SteamOS)
sudo pacman -Syu && sudo pacman -S cabextract wget 

# for RedHat based distros
sudo dnf update
sudo dnf install wget cabextract

# for debian based distros
sudo apt-get update && sudo apt-get upgrade
sudo apt install wget cabextract

@mebaysan
Copy link

In Steam installed with Flatpak on Fedora 37, the path is similar to the following.

/home/$USER/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32

@blah238
Copy link

blah238 commented Apr 23, 2023

FYI the command to run @TechT10n's script is failing because it is linking to the HTML version of the gist, not the raw file, so it should be changed to:

curl https://gist.githubusercontent.com/TechT10n/79b853003f2e9841a18e8b6decd0fd3e/raw/coh2_multiplayer_fix.sh | bash

@jrbergen
Copy link
Author

jrbergen commented Apr 25, 2023

Run this to install them, and then re-run the script

@TechT10n I think SteamOS is based on arch, so the default package manager is pacman instead of apt I suppose.

It'd be sudo pacman -Syu && sudo pacman -S cabextract wget

@blah238 thanks for the heads up. I'll update it when I'm at my desktop tomorrow.

@TechT10n
Copy link

TechT10n commented Apr 25, 2023

Thanks for the tip for Arch/SteamOS. That will be helpful for a lot of folks for sure.
I've never used any Arch based distros myself (although I have been considering buying a SteamDeck). Thanks for the commands. I've updated the script instructions.

I don't know why I thought SteamDeck was a debian distro

@mezack6
Copy link

mezack6 commented Apr 25, 2023

Friend! I'm a layman with all that you're talking about here, I bought a deck to play chO2 , because I'm not in my country of origin where my desktop computer is, I believe I have this problem, as soon as enemies appear on the screen, the the game ends with the phrase synchronization error, I downloaded Proton 5.0-10, and I know how to get to that terminal that is called Konsole here on the deck, I'm afraid of doing something stupid because I don't understand almost anything of the things you're talking about, I'd be very grateful if you type a simple step-by-step for me to do here, because even with everything written up there I'm afraid, sorry for the misunderstanding.

@StevesChair
Copy link

StevesChair commented Apr 25, 2023

Friend! I'm a layman with all that you're talking about here, I bought a deck to play chO2 , because I'm not in my country of origin where my desktop computer is, I believe I have this problem, as soon as enemies appear on the screen, the the game ends with the phrase synchronization error, I downloaded Proton 5.0-10, and I know how to get to that terminal that is called Konsole here on the deck, I'm afraid of doing something stupid because I don't understand almost anything of the things you're talking about, I'd be very grateful if you type a simple step-by-step for me to do here, because even with everything written up there I'm afraid, sorry for the misunderstanding.

Hey I successfully fixed the issue on my steam deck. If you want I can send you the file you need. My biggest issue was trying to extract the file from the exe file given on the steam deck I couldn’t find an ideal app to do the extracting. I had a friend do that part and send me the ucrtbase.dll file. Other than that your issue is more knowing the right location to put it in. Even if the game is installed on your SD card you still put it on the steam deck storage

just a heads up coh2 runs very poorly online on the deck. I mean as a whole it runs pretty poorly given the constant stutter but online there is a significant delay to commands alongside that stuttering. I was able to finish a team game against AI with no crash

@mezack6
Copy link

mezack6 commented Apr 29, 2023

I will be very grateful if you can send me the file, it took me a while to answer because I was in a place without any internet network, any help and instructions will be welcome, the game is in the main memory of the deck, not on the ssd.
E-mail: mezack47@gmail.com

@Commando-Brando
Copy link

After many failed tries of completing the steps, I did it again after disabling cloud sync for CoH2 and it worked

@mezack6
Copy link

mezack6 commented Apr 30, 2023

Depois de muitas tentativas fracassadas de concluir as etapas, fiz novamente depois de desativar a sincronização na nuvem para CoH2 e funcionou

Thanks for the tip, I'll wait for StevesChair to send me a file here for me to try, I haven't been successful so far, the game works very well here for me, without bugs or crashes, but when enemies appear on the screen, I start to lose hope because it's a matter of time it crashes, and the synchronization error message appears.

@StevesChair
Copy link

StevesChair commented May 1, 2023

Hey I just emailed you a link to the file. I uploaded it to google drive given it wouldn't let me attach it in the email given the type of file it is. Hopefully there is no issue with the google drive link. Lmk otherwise.

The location to put put it in was /home/doorstop/.steam/steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32 for me

@mezack6
Copy link

mezack6 commented May 3, 2023

Hey I just emailed you a link to the file. I uploaded it to google drive given it wouldn't let me attach it in the email given the type of file it is. Hopefully there is no issue with the google drive link. Lmk otherwise.

The location to put put it in was /home/doorstop/.steam/steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32 for me

Thanks a lot bro, it solved my problem, it was like you said, unfortunately it's not like the desktop computer, but I managed to finish an entire game... I let it go until I reached zero to test it, your file worked... Hugs

@mezack6
Copy link

mezack6 commented May 3, 2023

I played a second game, before that I changed the resolution, nothing crashed... the whole game ran smooth... thank you very much

@ShirinaHolmatove
Copy link

Hey stevesChair, could you please send me the file on ahmadbaba_@outlook.com. I have the same issue, whenever I play the game it crashes with an error "Sync Error Detected". I contacted the sega support and they pretended the issue occurs from the antivirus/firewall which is false because im using the steam deck and never installed any of those things. please your guide would be appreciated if you could help. Thank you

@Aurelius-Nero
Copy link

Does this fix still work ?? I have just recently installed CoH2 and it doesn't seem to do anything. Just a black screen at startup and just sound. I am on fedora.

@NiSchie
Copy link

NiSchie commented Sep 26, 2023

I just had the problem that it didnt work. I saw that the ucrt dll in the directory was a symlink to the Proton Experimental file lying somewhere else. Just if somebody has it not working, check if the file is a symlink to another directory!

@jrbergen
Copy link
Author

Does this fix still work ?? I have just recently installed CoH2 and it doesn't seem to do anything. Just a black screen at startup and just sound. I am on fedora.

@Aurelius-Nero

That shouldn't be related to this fix. This should only fix sync errors, and I'm not even sure it still works. You are launching with Proton?

@TechT10n
Copy link

TechT10n commented Nov 11, 2023

I Just tested and confirmed, the multiplayer fix still works.

I got my ass kicked... for science!

The game fails to launch using standard Proton, but works fine with GE-proton (specifically tested on GE-Proton8-21)
I am running on Nobara38 (fedora base) with an AMD GPU. Launched from Steam using stock settings. No launch options at all.

@lubeskih
Copy link

lubeskih commented Dec 23, 2023

Just to give my check-in -- had the same issue od Ubuntu 20.04, the mentioned fix from the gist works!

I set Proton to Proton 5.0-10 through Steam settings.
I extracted and copied the file to system32, and gave the correct permissions to it.

Did not had to delete anything.

Started the game, and everything worked just fine!

p.s. The script breaks if you don't have that extracting tool installed

@jsunsch
Copy link

jsunsch commented Mar 1, 2024

I played Company of Heroes 2 with Proton 8.0-5 and after having played for 10-15 minutes in multiplayer i got the sync issue.
I used the above gist and that solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment