HTML5 - Packaging issue in FrontEnd - Version: 4.3.1

Hi, I need to urgently turn a project of mine into HTML5, I have emscripten installed, the dependencies for UE 4.3.1 from Github built from scratch, the paths are ok, and yet, the frontend won’t package the game, I’m getting this strange error and can’t find that log file cmd.txt, I just don’t know what else to do. I’m attaching the FrontEnd log, for anyone who can possibly give me a hand over here.

Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:1): C:\Windows\system32\cmd.exe /c python "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py" "H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data" --preload . --js-output="H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data.js". See logfile for details: 'cmd.txt' 

I have no idea what could it be. I’m truly desperate right now. Here’s the part of the log despicting the error:

HTML5Platform.Package: Package H:\LABUROS\Amandita\LaRescatista\LaRescatista.uproject

InternalUtils.SafeFileExists: SafeFileExists C:\Windows\system32\cmd.exe=True

CommandUtils.Run: Run: C:\Windows\system32\cmd.exe /c python "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py" "H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data" --preload . --js-output="H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data.js"

cmd: Traceback (most recent call last):

cmd:   File "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py", line 218, in <module>

cmd:     os.path.walk(file_['srcpath'], add, [file_['mode'], file_['srcpath'], file_['dstpath']])

cmd:   File "C:\Python27\lib\ntpath.py", line 272, in walk

cmd:     walk(name, func, arg)

cmd:   File "C:\Python27\lib\ntpath.py", line 272, in walk

cmd:     walk(name, func, arg)

cmd:   File "C:\Python27\lib\ntpath.py", line 272, in walk

cmd:     walk(name, func, arg)

cmd:   File "C:\Python27\lib\ntpath.py", line 268, in walk

cmd:     func(arg, top, names)

cmd:   File "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py", line 203, in add

cmd:     if should_ignore(fullname):

cmd:   File "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py", line 187, in should_ignore

cmd:     if has_hidden_attribute(fullname):

cmd:   File "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py", line 177, in has_hidden_attribute

cmd:     attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(filepath))

cmd: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 33: ordinal not in range(128)

CommandUtils.Run: Run: Took 0,3770215s to run cmd.exe

BuildCommand.Execute: ERROR: BUILD FAILED

Program.Main: ERROR: AutomationTool terminated with exception:

Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:1): C:\Windows\system32\cmd.exe /c python "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py" "H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data" --preload . --js-output="H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data.js". See logfile for details: 'cmd.txt' 

Stacktrace:    en AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\ProcessUtils.cs:l?nea 775

   en HTML5Platform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\HTML5\HTML5Platform.Automation.cs:l?nea 43

   en Project.Package(ProjectParams Params, Int32 WorkingCL) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Scripts\PackageCommand.Automation.cs:l?nea 52

   en BuildCookRun.DoBuildCookRun(ProjectParams Params) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:l?nea 238

   en BuildCommand.Execute() en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\BuildCommand.cs:l?nea 37

   en AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Automation.cs:l?nea 367

   en AutomationTool.Automation.Process(String[] CommandLine) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Automation.cs:l?nea 335

   en AutomationTool.Program.MainProc(Object Param) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Program.cs:l?nea 99

   en AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param) en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Utils.cs:l?nea 610

   en AutomationTool.Program.Main() en h:\UECode\UnrealEngine-4.3\Engine\Source\Programs\AutomationTool\Program.cs:l?nea 50

Program.Main: ERROR: Command failed (Result:1): C:\Windows\system32\cmd.exe /c python "C:\Program Files\Emscripten\emscripten\1.16.0\tools\file_packager.py" "H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data" --preload . --js-output="H:\LABUROS\Amandita\LaRescatista\Binaries\HTML5\LaRescatista.data.js". See logfile for details: 'cmd.txt' 

ProcessManager.KillAll: Trying to kill 0 spawned processes.

Program.Main: AutomationTool exiting with ExitCode=1

Domain_ProcessExit

ProcessManager.KillAll: Trying to kill 0 spawned processes.

AutomationToolLauncher exiting with ExitCode=1

copying UAT log files...

RunUAT.bat ERROR: AutomationTool was unable to run successfully.

BUILD FAILED

Full Log here: https://drive.google.com/file/d/0BykoA0CHxH7-akxNbEdQa3lmNkE/edit?usp=sharing

This error seems to be the root cause of your issue:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 33: ordinal not in range(128)

Not sure what would be causing that or the resolution. But take a look (If you havent already) at the following google results and see if there is a resolution in there:

https://www.google.com.au/search?q=UnicodeDecodeError%3A+'ascii'+codec+can't+decode+byte+0xe1+in+position+33%3A+ordinal+not+in+range(128)&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:unofficial&client=firefox-nightly&channel=nts&gfe_rd=cr&ei=JyLsU_iCMcGN8QfI1YFY

Are you using a different language for your OS by any chance?

Well… this seems to indicate I’m royally fckd. I have no idea how to correct that, and most folks seems they can’t either

My OS is Windows 7 Ultimate in spanish, yet I’m not using special characters. And the engine automatically switches the es_ES to en when building, my actual build is done on en_EN. What do you suggest?

Same issue in Windows 8.1 when I run the command directly in the command prompt I get UnicodeDecodeError: ‘ascii’ codec can’t device byte 0xb7 in postion 40: ordinal not in range (128). I’m en-en in english. Looks like it’s not related to spanish. I think HTML5 might just be down currently. (4.4 build form GitHub).

Likely it looks like you might have a mismatch between your version of emscripten 1.21 and your version of clang 1.22. Emscripten wants everything using the same version. I think you should try setting up your plugins again but make sure everything come from the same branch. Specifically this one:

I managed to get a build by going to

  1. c:/program files/emsdk
  2. emsdk install clang-e1.21.0-64bit
  3. emsdk uninstall clang-e1.22.0-64bit
  4. activate emsdk install clang-e1.21.0-64bit

Built. Worked had to use firefox nightly.

Well, I have emscripten 1.16, and clang is the same version. Last time I used: 1.22 and most of the code was useless, gonna try to install now the 1.21 to see if that solves it. This is my emscripten root config

import os
SPIDERMONKEY_ENGINE = ''
LLVM_ROOT='C:/Program Files/Emscripten/clang/e1.16.0_64bit'
NODE_JS='C:/Program Files/Emscripten/node/0.10.17_64bit/node.exe'
PYTHON='C:/Program Files/Emscripten/python/2.7.5.3_64bit/python.exe'
JAVA='C:/Program Files/Emscripten/java/7.45_64bit/bin/java.exe'
SPIDERMONKEY_ENGINE='C:/Program Files/Emscripten/spidermonkey/27.0.1_64bit/js.exe'
EMSCRIPTEN_ROOT='C:/Program Files/Emscripten/emscripten/1.16.0'
CRUNCH='C:/Program Files/Emscripten/crunch/1.03/crunch.exe'
V8_ENGINE = ''
TEMP_DIR = 'c:/users/jehuty/appdata/local/temp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

Update: That didn’t work, same error.

You need to have both emscripten 1.21.0 and clang 1.21.0.

I also discussed and found a solution here. EMSCRIPTEN sdk found but of unexpected version, Please install version 1.21.0 - Platform & Builds - Unreal Engine Forums

They are and didn’t work either.

import os
SPIDERMONKEY_ENGINE = ''
NODE_JS = 'node'
LLVM_ROOT='C:/Program Files/Emscripten/clang/e1.21.0_64bit'
NODE_JS='C:/Program Files/Emscripten/node/0.10.17_64bit/node.exe'
PYTHON='C:/Program Files/Emscripten/python/2.7.5.3_64bit/python.exe'
JAVA='C:/Program Files/Emscripten/java/7.45_64bit/bin/java.exe'
SPIDERMONKEY_ENGINE='C:/Program Files/Emscripten/spidermonkey/30.0.0_64bit/js.exe'
EMSDK_GIT='C:/Program Files/Emscripten/git/1.8.3'
EMSCRIPTEN_ROOT='C:/Program Files/Emscripten/emscripten/1.21.0'
CRUNCH='C:/Program Files/Emscripten/crunch/1.03/crunch.exe'
V8_ENGINE = ''
TEMP_DIR = 'c:/users/jehuty/appdata/local/temp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

Well, found out a solution, asked someone else how to solve this and the solution was on the file_packager.py on the tools folder of Emscripten, change the line:

from: attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(filepath))

to: attrs = ctypes.windll.kernel32.GetFileAttributesW( filepath )