Adam Cameron
Lucee 5.3.8.206 Error (expression)
Message key [EN] doesn't exist
Stacktrace The Error Occurred in
/admin/resources/text.cfm: line 32
called from /admin/web.cfm: line 174
When hitting /lucee/admin/server.cfm
.
I've googled for other ppl getting similar, but drawn a blank.
The code in question seems to be https://github.com/lucee/Lucee/blob/5.3.8.206/core/src/main/cfml/context/admin/resources/text.cfm#L32
The only match for that file name I can find in the file system of the container is this:
root@6411ac0084f7:/var/www# find / -name text.cfm
[...]
/opt/lucee/web/temp/compress/da44506fe5fac4a8da74e7830bd71a99/c87947aefcfb3c98371e09351fcfe603/resources/text.cfm
And whilst it's the same file (code etc), it is not the one being executed & erroring.
This is in a freshly-built container, based on FROM lucee/lucee:5.3
Adam Cameron
/var/www
via a volume. Not the volume itself, just some of the files. Can track it down now I think...Adam Cameron
Adam Cameron
Adam Cameron
<cfdirectory name="local.qDir" directory="language" action="list" mode="listnames" filter="*.xml">
Two things here. cfdirectory
is supposed to be given an absolute path, not a relative one. So I have no idea how one might ever have expected this to work. I can only presume Lucee's implementation will try to look for a relative path... err... sometimes.
But I have a directory language
in /var/www
. And Lucee is looking in there to resolve the path language
. the notional root mapping /
is probably mapped to /var/www
and Lucee is mistakenly interpreting language
as /language
and... finding my language dir.
From there, there is no guard code in getAvailableLanguages
to check if anything was actually found, and if not... it should throw a LanguageFilesNotFoundException
or something.
And then... (OK three things)... it just returns a struct rather than an object (probably a LanguageCollection object would be best here), so the code that calls getAvailableLanguages
(https://github.com/lucee/Lucee/blob/5.3.8.206/core/src/main/cfml/context/admin/resources/text.cfm#L32) really can't be making assumptions about the data it's working with. All it knows is "it's a struct", it can't be assuming that it'll be a struct containing en.xml
, and that that is an XML document.
---
As far as dealing with this goes... the code in text.cfm
is perhaps a bit woolly, but [shrug], if the file operations did what they were supposed to, then none of this conversation would be taking place.
A coupla things need addressing I guess:
• pass a valid path to cfdirectory
. probably just expandPath("./language")
would do here.
• fix how Lucee is interpretting "relative" paths here. Whether or not cfdirectory
should take a relative path or not (no, it shouldn't), there's no way Lucee should be interpretting language
as /language
. Those are two different things.
Have I nailed the situation? Does it need more discussion? Or do you want me to raise a ticket for this?zackster
04/13/2022, 5:02 PMAdam Cameron
Adam Cameron