TuomoKu / SPX-GC

SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software.

Home Page:https://spx.graphics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPX Crash on template reload/add

Seriousness opened this issue · comments

I am currently rewriting my templates for publishing and it occured during "reload" or "add template" SPX exits with Errorcode 5. I am trying to get an idea where this error comes from.

Using loglevel debug I get:

2022-01-18T16:32:57.735Z [SPX] verbose: CheckLogin: No username in config, authorize "default" user...
2022-01-18T16:32:57.736Z [SPX] verbose: Adding new stuff to profile rtr/countdown
2022-01-18T16:32:57.736Z [SPX] debug: GetJsonData: returns data from [D:\Software\Stream\environment\spx-cg\DATAROOT\RTR\profile.json]
2022-01-18T16:32:57.737Z [SPX] verbose: Added template: D:\Software\Stream\environment\spx-cg\ASSETS\templates\rtr\countdown\RTR_COUNTDOWN.html
2022-01-18T16:32:57.781Z [SPX] debug: FYI: spx.talk function is DISABLED. [Writing file]
Killing process because of error TypeError: Cannot read property '_ownerDocument' of undefined
2022-01-18T16:32:57.783Z [SPX] verbose: spx.writeFile - File written OK: D:\Software\Stream\environment\spx-cg\DATAROOT\RTR\profile.json
2022-01-18T16:32:57.794Z [SPX] verbose: CheckLogin: No username in config, authorize "default" user...
2022-01-18T16:32:57.795Z [SPX] debug: GetJsonData: returns data from [D:\Software\Stream\environment\spx-cg\DATAROOT\RTR\profile.json]
2022-01-18T16:32:57.878Z [SPX] debug: Generating webplayout options. This selection: 6.
2022-01-18T16:32:57.878Z [SPX] debug: Generating out options. This selection: manual.
2022-01-18T16:32:58.022Z [SPX] verbose: *** Socket connection (ZRG5VceNAlnZphx7AAAH) Connections: 3
2022-01-18T16:32:58.025Z [SPX] verbose: System utilities / {"command":"CHECKCONNECTIONS","server":""}
2022-01-18T16:32:58.025Z [SPX] debug: CCGServersConfigured: Yes at least one CasparCG server in config.
2022-01-18T16:32:58.025Z [SPX] verbose: checkServerConnections -function excecuting...

Using loglevel info I get:

Killing process because of error TypeError: Cannot read property '_ownerDocument' of undefined
SPX exit! (Errorcode 5: Unspecified exit code)

After restarting SPX the template works as it should, using the WebCG Devtools I don't get any error... how can I find out what I am doing wrong?

Sometimes this can happen if you have a script in the template which gets executed onLoad. SPX parses template files for TemplateDefinition during import. Try disabling all Javascript functions in the template which executes onLoad. These can be function calls in <BODY onLoad="myFunction()"> or window.onload event handlers.

Version 1.1.1 has a more robust error handling in template (re)import and will now prevent SPX crashes at template import. The binary version of 1.1.1 is not yet available at the time of writing, but these fixes are in the repo already.