This issue is pretty self explanatory, you encounter this code whilst downloading in-game cache and additional items (see figure below)

While this fix is widely encountered on PC and mobile, I've only really discovered the workaround for PC. Before carrying out these workaround fixes though, I strongly recommend checking out PC Common Errors and Fixes on General Networking Issues, as this workaround fix can get very complicated for those unfamiliar with troubleshooting PC errors
This issue is mainly due to an incorrect download length for the file being downloaded to what's being listed on miHoYo servers. Can be caused by various reasons, software, hardware related issues, which I'll not go in-depth here
Working around
This workaround is pretty complicated, brace yourself
First, head to your launcher settings to find your Game Installation Pathway

Now use a File Explorer (Win + E), and browse to said file path
You should see a folder like this

Open up GenshinImpact_Data, then open up Persistent. This is where your downloaded cache, scripts and additional assets are stored
In the folder, you should see a DownloadError.log file (the following files are provided by players encountering the same issue)
Open that up with Notepad (or any text editor you have), and you should see something that looks like this:

Wall of text, yes, but the only important thing to look at here is the last line that looks like this:
FileManageSystem=> download file failed, url = https://autopatchhk.yuanshen.com/client_game_res/2.6_live/output_6626848_04b2f48aaf/client/StandaloneWindows64/AssetBundles/blocks/00/04457931.blk, localPath = D:/sraka/Genshin Impact/Genshin Impact game/GenshinImpact_Data/Persistent\AssetBundles/blocks/00/04457931.blk, errMsg = -9004-Downloaded Length not Equal to expected! downloadedLen = 85968, expected = 11187105; , useTime = 0s
This follows the template:
url = [insert download link for file], localPath = [insert file path for file]
You should download a file from the download link given, and place it into the file path given
Take an example from the above
The URL you should download the file from would be:
https://autopatchhk.yuanshen.com/client_game_res/2.6_live/output_6626848_04b2f48aaf/client/StandaloneWindows64/AssetBundles/blocks/00/04457931.blk
And this is where you should store the file:
D:\sraka\Genshin Impact\Genshin Impact game\GenshinImpact_Data\Persistent\AssetBundles\blocks\00\04457931.blk
You can get to the file path easily by opening up the folders as stated per / or \ in the Persistent folder, as in the above, you should look only at this short path, where everything before Persistent is ignored, and the part after the last / or \ is ignored
\Persistent\AssetBundles\blocks\00\
Based on this path, from the Persistent folder, you should open the AssetBundles folder, followed by the blocks folder, and followed by the 00 folder
Once you opened up the correct folder, place the file you downloaded from the URL stated in the logs into it
This will vary between players, some may encounter this for other files, and some for the same file. So be sure to check out your own logs to download the correct file required
Once you're done with placing the required file, open the game again
Chances are, you'll be greeted with the same error message, again
Don't get frustrated at this point, the really complicated part comes here. Now close the game again, head back to the Persistent folder and open up DownloadError.log again (You need to have previously closed it to refresh the file)
You'll see new lines, and what's previously encountered would also be present, so now it looks like this:

And what do you do again you ask?
Well scroll back down, find the URL to download, and put the file into the correct location, again
And again, and again, and again, until you can get through to play the game
Points to note:
1. What to download and where to place them vary between players and versions, do not blindly follow what's given from above or from what you have done before, always refer back to the DownloadError.log file
2. The download will almost always get stuck around the same progress when encountering this issue. If you see it moving forward after placing the necessary files manually as per stated in the steps above, you have succeeded in the first half, more to go
3. Files having issues are normally larger than 10M files, hence you shouldn't see too many files to download from
4. You may encounter this issue every single time Genshin issues a new in-game cache update, good luck
5. DO NOT trust anyone that says they could fix it by giving you a download link to anything that's not found in your own DownloadError.log, you shouldn't trust me too, as well
Will this ever get fixed? You may ask. Well, I have no idea at all! I'm only here to provide a workaround that people can refer to and get their game working, whether or not it would get "fixed" is not any of my concerns
Will I make an automatic downloader for this? I'm afraid no, as it's technically against the ToS to provide "programs to update game" or "distribute files outside of miHoYo servers", I prefer the safer way that won't get me or you punished, just do it manually, once you get the hang of it, it'll be quite easy to follow
That would be all, hopefully, this will help you with the issue
With that, GamerYuan signing off


