Cannot Find template error on casparcg 2.0.7
Closed this issue · 3 comments
This exact setup works well on version 1.0.8 but in the latest version (SPX-GC v1.0.14) Caspar CG can't find templates anymore this is the log output from Caspar CG:
Accepted connection from 127.0.0.1 2
[2021-10-28 01:18:41.647] [18172] [info] Received message from 127.0.0.1: CG 1-8 STOP 1\r\n
[2021-10-28 01:18:41.667] [16588] [debug] Executed command: CGCommand
[2021-10-28 01:18:41.676] [16588] [info] Sent message to 127.0.0.1: 404 CG ERROR\r\n
[2021-10-28 01:18:42.912] [18172] [info] Received message from 127.0.0.1: CG 1-8 ADD 1 "http://192.168.123.188:5000/templates/smartpx/Template_Pack_1/SPX1_INFO_RIGHT.html" 1 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"?? #hashtag\"/></componentData><componentData id=\"epochID\"><data id=\"text\" value=\"1634440746763\"/></componentData></templateData>"\r\n
[2021-10-28 01:18:42.979] [16588] [warning] Could not find template HTTP://192.168.123.188:5000/TEMPLATES/SMARTPX/TEMPLATE_PACK_1/SPX1_INFO_RIGHT.HTML
[2021-10-28 01:18:43.004] [16588] [debug] Executed command: CGCommand
[2021-10-28 01:18:43.035] [16588] [info] Sent message to 127.0.0.1: 404 CG ERROR\r\n
and this is from SPX_GC
2021-10-28T00:18:41.663Z [SPX GC] error: Error in CasparCG server overlay: [404 CG ERROR
]
2021-10-28T00:18:42.917Z [SPX GC] error: Error in CasparCG server overlay: [404 CG ERROR
]
i have copied the template folder from SPX-GC to Caspar CG templates folder.
this is my config,json:
{
"general": {
"username": "",
"password": "",
"hostname": "",
"greeting": "",
"showusercommapass": "",
"langfile": "english.json",
"loglevel": "info",
"logfolder": "C:/SPX-GC_1_0_14_win64/LOG/",
"port": "5000",
"dataroot": "C:/SPX-GC_1_0_14_win64/DATAROOT/",
"templatefolder": "C:/SPX-GC_1_0_14_win64/ASSETS/templates/smartpx/Template_Pack_1",
"templatesource": "spxgc-ip-address"
},
"casparcg": {
"servers": [
{
"name": "overlay",
"host": "localhost",
"port": "5250"
}
]
},
"globalExtras": {
"customscript": "/ExtraFunctions/demoFunctions.js",
"CustomControls": [
{
"ftype": "button",
"bgclass": "bg_grey",
"text": "Open KnowledgeBase",
"fcall": "openWebpage('https://spxgc.tawk.help')",
"description": "Custom control example"
},
{
"ftype": "button",
"bgclass": "bg_grey",
"text": "Stop all",
"fcall": "stopAll()",
"description": "Animate all graphics out"
},
{
"ftype": "button",
"bgclass": "bg_black",
"text": "PANIC",
"fcall": "clearAllChannels()",
"description": "Clear playout channels"
}
]
},
"warning": "Modifications done in the GC will overwrite this file.",
"smartpx": "(c) 2020-2021 Tuomo Kulomaa <tuomo@smartpx.fi>",
"updated": "2021-10-17T03:37:27.846Z"
}
Version 1.0.9 changed CasparCG configuration, please see: https://github.com/TuomoKu/SPX-GC#config and section general.templatesource
So you may need to change "templatesource": "spxgc-ip-address"
to "templatesource": "casparcg-template-path"
Hope this helps.
Thanks , Changing it to "templatesource": "casparcg-template-path"
fixed the not found error but I now have an unexpected identifier error:
[2021-10-28 17:38:28.952] [19028] [info] Received message from 127.0.0.1: CG 1-3 ADD 1 "smartpx/Template_Pack_1/SPX1_TICKER_EXCEL" 1 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"/excel/ticker/ticker_data_example.xlsx\"/></componentData><componentData id=\"epochID\"><data id=\"text\" value=\"1635380894100\"/></componentData></templateData>"\r\n
[2021-10-28 17:38:29.084] [2144] [info] html[C:\CasparCG-Server\Server\templates\\SMARTPX/TEMPLATE_PACK_1/SPX1_TICKER_EXCEL.html] Initialized.
[2021-10-28 17:38:29.123] [2144] [debug] Executed command: CGCommand
[2021-10-28 17:38:29.153] [2144] [info] Sent message to 127.0.0.1: 202 CG OK\r\n
[1028/173829:ERROR:renderer_main.cc(226)] Running without renderer sandbox
[1028/173829:INFO:CONSOLE(285)] "[webcg-framework] version 2.6.0", source: file:///C:/CasparCG-Server/Server/templates//SMARTPX/TEMPLATE_PACK_1/js/webcg-framework.umd.js (285)
[1028/173829:INFO:CONSOLE(18)] "Uncaught SyntaxError: Unexpected identifier", source: file:///C:/CasparCG-Server/Server/templates//SMARTPX/TEMPLATE_PACK_1/js/spx_cmdhandler.1.2.js (18)
[1028/173829:INFO:CONSOLE(27)] "Uncaught SyntaxError: Unexpected identifier", source: file:///C:/CasparCG-Server/Server/templates//SMARTPX/TEMPLATE_PACK_1/SPX1_TICKER_EXCEL.html (27)
[1028/173829:INFO:CONSOLE(188)] "Uncaught SyntaxError: Unexpected identifier", source: file:///C:/CasparCG-Server/Server/templates//SMARTPX/TEMPLATE_PACK_1/SPX1_TICKER_EXCEL.html (188)
How do i fix this?
I'm guessing here, but I can come up with two theories:
- Old CasparCG version? I recommend checking you are using version 2.3.x LTS
- File-protocol -issue When using "casparcg-template-path" parameter, it forces the templates to be read over file-protocol and it may cause issues in some more advanced templates, which are getting live-data from SPX server using ajax calls (Axios, Fetch, xhr) which requires a connection via a http -protocol. I can see you are using the Excel-template which is one those more advanced ones.
Does the other templates work?
One more thing: you mention using CasparCG 2.0.7. I would strongly recommend upgrading to 2.3.x LTS, this would fix a lot of issues regarding HTML -templates.