Skip to content

Instantly share code, notes, and snippets.

@jrbergen
Last active July 3, 2024 15:14
Show Gist options
  • 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

@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.

@mangostallion
Copy link

mangostallion commented Jun 28, 2024

I've run into problems at all three routes in attempting to solve this with the instructions. I'm surprised how many people are saying it worked for them.

My attempt at the first solution provided gave me these lines in the terminal:
"
bash: line 31: cabextract: command not found
bash: line 32: cabextract: command not found
cp: cannot stat 'tmp/ucrtbase.dll': No such file or directory
cp: cannot stat 'tmp/ucrtbase.dll': No such file or directory
Success: ucrtbase.dll was copied to /home/deck/.steam/steam/steamapps/compatdata/231430/pfx/drive_c/windows/system32\n
"

This sounded to me like my Steam path was different so I tried the next solution which says, "copy the script from that link and alter the part where the path is specified, and then run it locally."

However I got stuck on this step:
"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"

What happens is when I change the line in a text editor and then I copy, paste, and run it in terminal, it just seems to crash the terminal program, called Konsole. It quits Konsole immediately after it starts loading. This lead me to the other part of that instruction which mentions the bash script failing. This sounded to me like what was happening so I tried the instruction:

"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
"

However, this just gave me an error message in the terminal:
"
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
sudo: dnf: command not found
sudo: dnf: command not found
sudo: apt-get: command not found
sudo: apt: command not found
(1)(deck@steamdeck ~)$
"

So I thought maybe I need to download this thing called cabextract because I'm not seeing it installed anywhere on my Steam Deck. I downloaded it and its installation instructions involved putting more codes into the terminal, which just gave me more error messages. Since I got stuck there, I decided to attempt the last "Fallback instructions to perform the workaround manually" section but I'm stuck on Step 6. I'm not really sure what is meant by "make a separate directory to E.g." What's E.g. mean? I'm so lost now that I'm not even sure I know what is meant by making a separate directory let alone what it means to "E.g." it. I can see these steps also require cabextract, which I cannot seem to find any instructions online how to install that. When I attempt to follow the Install document that comes with its download, it's more codes to put into terminal which I don't understand and seem to be doing wrong. Am I just not seeing the simple Install button for this cabextract program?

Anyway, I don't think any of these solutions on this page are in layman's terms. Normally I could just look up what I don't know but this mess of problems I've been running into while trying to follow the instructions are getting more unclear to me as I attempt them.

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