WebGL Build Fails for no apparent reason

No matter what I do, Unity 6 web builds keep failing, even on empty projects.
Sometimes the error changes but mostly it looks like the below, giving no indication of what has gone wrong.

X:\GuruNow\LiveKitTest>set MYDIR=M:\Program Files\6000.0.23f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\ 

X:\GuruNow\LiveKitTest>goto FOUND_MYDIR 
emcc: error: '"M:/Program Files/6000.0.23f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen\bin\wasm-opt" --strip-dwarf --signext-lowering --post-emscripten -O2 --low-memory-unused --zero-filled-memory --pass-arg=directize-initial-contents-immutable --strip-debug --strip-producers Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm -o Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm --mvp-features --enable-mutable-globals --enable-sign-ext' failed (returned 3221225477)
2 Likes

a short google says 3221225477 is access denied.

Well that might be useful if it said what it didn’t have access to…

did you check the editor logs?

Yes but there was no additional information

Try with antivirus temporarily disabled. Particularly if you have a 3rd party antivirus. Make sure to exclude Unity project paths from antivirus on-demand scans.

The other thing is X:

Try creating a project under Documents or Desktop and build that. If this always succeeds you have a permission issue.

If you have formatted this X partition in a previous Windows installation, even a different machine altogether, the owner may be absent and resets to a default owner or the permissions are just not correct. Open the permissions for Documents or Desktop and then apply the same settings to X. Make sure the “inherit permissions” flag is checked.

I only have Windows Defender which doesn’t typically cause issues like this.

I tried putting the project in Documents, also tried giving my account Full control over both the project folder and Unity folders.

No change to the result.

Could you post the editor.log after making a failed build? Perhaps we can spot something in there.

You could also try reinstalling the editor though I don’t think that will fix an “access denied” when there’s only Defender at work (which has never giving me any troubles either). If you do, use the latest 6000 and try with a fresh project to make sure that neither version nor fresh install (of a new editor version) fixes the issue.

I have tried a different version of Unity 6 with the same result.

Log attached

Editor.txt (468.7 KB)

So what exactly is your G drive?

G:\Windows10\Documents\GuruNowUnity

seems to be your project folder, yet, your user folder is C:/Users/Mark

And Unity is installed to M:

M:\Program Files\6000.0.42f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\

While the Hub is on C:

How many drive letters / partitions do you have on that system anyway? :flushed:
Did you perhaps use utilities to “move” Windows built-in folders (like Documents) to other locations? I’ve only had issues with this in the past with all kinds of applications. I also went through that “separation of concerns” phase but that ended rather quickly. :laughing:

Did you also move TEMP/TMP to some drive letter? In my experience that was the worst idea ever. There was always a shortage of free disk space here and there depending on the application. Thus I would have to reserve a huge amount of disk space for TEMP (100+ GB) even though most of the time it’ll be practically empty. Moreover many applications simply ignored that environment variable and failed to use any TEMP storage particularly when I had TEMP=T: without a subfolder.

You would have to verify permissions on all of these drives are as intended. This includes the project folder, the TEMP and TMP locations, the location of the user home where AppData resides in.

You also need to be sure that you have enough free disk space on all drives where Windows is installed, your project, and any temporary files locations. There should be at least 20 GB free disk space on any of these, more so the more the project increases in size.

Temp files are all on C, this is potentially the cause of the issue as C only has ~8gb of free space. However, I was able to successfully create a development build (on a second run, the first attempt failed)
All my other drives have plenty of space though, and release builds continue to fail.

Edit:
After freeing up space on C, (now has ~21gb) still seeing the same failure of release builds.

your drives are connected to the mother board or some are portable devices. in windows depending of your power settings some external drives will go into sleep mode but they will not get live again if an app tries to access it. But they will wakeup if you browse to the drive and look at a file. Before build check if the drive is live and running

All drives are internal and power settings are set for performance.

Hi there,

Are you still experiencing this issue?

Sounds like your setup is the following:
G Drive - contains your Unity project folder
C Drive - contains your user folder, TEMP folder, and Unity Hub
M Drive - contains your installation of the Unity 6 editor

Is that correct? You called out Unity 6 specifically - can I assume that means that this setup was working for older versions of Unity?

My gut reaction is that you might need to verify that you have correct permissions on all of these drives as @CodeSmile mentions above.

Yes, I am still experiencing this issue and yes, I have been using Unity on this computer since around 2011.
Further, I have developed several WebGL applications using previous Unity versions without issue.
It is clear however that the issue is linked to this computer in some way as I was able to create a production building using my laptop.
I have also experienced intermittent issues building for Android with Unity 6, but this usually works on the 2nd or 3rd attempt.
Starting to wonder if its a hardware issue, maybe a failing hard drive.

Wow, that’s legacy! :slight_smile:

Can’t imagine what the working experience is on such an outdated system. In case you also haven’t reinstalled Windows ever since, or for many many years, there’s an increasing likelihood of things getting messed up without a hard drive failure no thanks to all the software that has come and gone over the years, not to mention configuration changes.

In any case, you can use a SMART program to read the drive state. But even if you upgraded to the cheapest capable system of today’s you’d be in for a surprise in terms of snappiness. :wink:

Snappiness isn’t an issue, its been upgraded several times over the years, current specs are i9 processor, 64GB RAM and RTX 4070.
I keep Windows and documents on separate drives, for exactly that reason, so I can wipe it and start fresh when needed.

I ran a SMART program and all drives look to be in good shape, so that doesn’t appear to be the issue.

Based on the information you provided above, it seems like this is a hardware issue unrelated to Unity. If you do come across anything that suggests otherwise though, please feel free to log a bug :slightly_smiling_face:

Actually, I ran into the same issue, and by despear, I tried disabling Windows Defender and… It worked!