Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

"Invalid compiled template for "

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
juju
Smarty n00b


Joined: 04 Oct 2021
Posts: 1

PostPosted: Mon Oct 04, 2021 3:23 pm    Post subject: "Invalid compiled template for " Reply with quote

Hello,

We have been using Smarty for many years, and are very happy with it.
We support a handful of websites, about one million pages displayed per day.

Sometime we get the "Invalid compiled template for..." error, due to no unifunc being present.
This seems to happen when many concomitant calls happen to one template with many variation of its cached version.

The stack trace is always the same, albeit the template name / cache identifier.
Code:

Uncaught exception (0):  Invalid compiled template for 'player_jd/player_jd_embed.tmpl' in /includes/smarty/libs/sysplugins/smarty_template_resource_base.php on line 110 

#0 /includes/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php(108): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#1 /includes/smarty/libs/sysplugins/smarty_template_cached.php(132): Smarty_Internal_Runtime_UpdateCache->updateCache(Object(Smarty_Template_Cached), Object(Smarty_Internal_Template), false)
#2 /includes/smarty/libs/sysplugins/smarty_internal_template.php(152): Smarty_Template_Cached->render(Object(Smarty_Internal_Template), false)
#3 /includes/smarty/libs/sysplugins/smarty_internal_templatebase.php(191): Smarty_Internal_Template->render(false, 1)
#4 /includes/smarty/libs/sysplugins/smarty_internal_templatebase.php(109): Smarty_Internal_TemplateBase->_execute('player_jd/playe...', 'JD||EUR-227en|1...', NULL, NULL, 1)
#5 /includes/template2.php(140): Smarty_Internal_TemplateBase->display('player_jd/playe...', 'JD||EUR-227en|1...', NULL, NULL)



Because this never happen on our dev env, and only happens live under duress, I am thinking race condition.

But I was wondering if our caching setup would increase the chance of this occurring:
The sites are load-balanced between 3 servers, all identical.
Each server stores locally its own compiled template.
But the cached version are stored in a common memcache pool.

I had a look at the same compiled templates on different server, and realise that their unifunc methods were named differently. I also saw that a cached version also use the unifunc function name.
Doesn’t this mean there could be a conflict between a cached version depending on which corresponding compiled template it was using?
Or are those totally unrelated, and I should carry on looking another way, another day?

Thank you for any help!
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Oct 22, 2021 4:10 pm    Post subject: Reply with quote

Quote:
Each server stores locally its own compiled template.
But the cached version are stored in a common memcache pool.

Cached page checking the compilation ID of the template and raising an error, if it doesn't match, as far as I recall.
Simple answer is that you'd get a better setup if you force compile all templates and deploy them identical to the production servers.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP