Reports fail to generate.
-
We get a number of reports throwing this exception. Any ideas ?
Template must contains _id, shortid or content attribute.
Error: Template must contains _id, shortid or content attribute. at Templating.handleBeforeRender (C:\JSReport\node_modules\jsreport-templates\lib\templates.js:32:17) at C:\JSReport\node_modules\listener-collection\lib\listenerCollection.js:171:33 at C:\JSReport\node_modules\listener-collection\lib\listenerCollection.js:151:16 at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5) From previous event: at C:\JSReport\node_modules\listener-collection\lib\listenerCollection.js:149:47 at Array.map (native) at mapSeries (C:\JSReport\node_modules\listener-collection\lib\listenerCollection.js:148:24) at module.exports.ListenerCollection.fire (C:\JSReport\node_modules\listener-collection\lib\listenerCollection.js:166:12) at beforeRender (C:\JSReport\node_modules\jsreport-core\lib\render\render.js:57:41) at module.exports (C:\JSReport\node_modules\jsreport-core\lib\render\render.js:144:10) at Reporter.render (C:\JSReport\node_modules\jsreport-core\lib\reporter.js:170:10) at C:\JSReport\node_modules\jsreport-express\lib\routes.js:90:14 at Layer.handle [as handle_request] (C:\JSReport\node_modules\express\lib\router\layer.js:95:5) at next (C:\JSReport\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\JSReport\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\JSReport\node_modules\express\lib\router\layer.js:95:5) at C:\JSReport\node_modules\express\lib\router\index.js:281:22 at param (C:\JSReport\node_modules\express\lib\router\index.js:354:14) at param (C:\JSReport\node_modules\express\lib\router\index.js:365:14) at Function.process_params (C:\JSReport\node_modules\express\lib\router\index.js:410:3) at next (C:\JSReport\node_modules\express\lib\router\index.js:275:10) at C:\JSReport\node_modules\jsreport-express\lib\routes.js:49:5 at Layer.handle [as handle_request] (C:\JSReport\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\JSReport\node_modules\express\lib\router\index.js:317:13) at C:\JSReport\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\JSReport\node_modules\express\lib\router\index.js:335:12) at next (C:\JSReport\node_modules\express\lib\router\index.js:275:10) at C:\JSReport\node_modules\jsreport-studio\lib\studio.js:69:7 at Layer.handle [as handle_request] (C:\JSReport\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\JSReport\node_modules\express\lib\router\index.js:317:13) at C:\JSReport\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\JSReport\node_modules\express\lib\router\index.js:335:12) at next (C:\JSReport\node_modules\express\lib\router\index.js:275:10) at cors (C:\JSReport\node_modules\cors\lib\index.js:185:7) at C:\JSReport\node_modules\cors\lib\index.js:221:17+0 Starting rendering request 270
-
Turns out. My local development machine was running 1.7.0 and the reports have been generated perfectly.
The server was running 1.8.2 and it had the problem of failing to generate some reports.I've upgraded my development version of JSReport to 1.8.2 and now it fails to generate the reports. I know I am running behind the current version but is this a known problem in 1.8.2?
-
I've upgraded my development version of JSReport to 1.8.2 and now it fails to generate the reports. I know I am running behind the current version but is this a known problem in 1.8.2?
i don't remember seeing such error in that version of jsreport. the error
Template must contains _id, shortid or content attribute.
should only be thrown when your input request does not contain a template object with any of those attributes_id, shortid, content
.if you can upload some repository with some simple version of the template that it is failing i will analyze it and run a debug session with it, it can be a problem with the data that you are sending, maybe a problem with some script you have, or maybe a jsreport bug, but to be able to know it i need a case to replicate it.
if you are rendering with http API it will help to know what is the actual request shape that you are sending for a template that fails.