Has anyone ever run into this issue? I'm running ...
# lucee
m
Has anyone ever run into this issue? I'm running lucee 5.4 latest docker image. I have a mapped directory
/myMappedDir=/var/www/myMappedDir.
But
expandPath('/myMappedDir')
returns
/var/www/myMappedDir/app/var/www/myMappedDir
It doesn't always happen, but once it starts happening I can't get it to stop until it seems to randomly fix itself? This is the mapping in the lucee-server.xml
Copy code
<mapping inspect-template="" physical="/var/www/myMappedDir" primary="physical" readonly="false" toplevel="true" virtual="/myMappedDir"/>
Seem related to the mapping being a parent directory to the app root and it's a part of a docker compose mount,
e
haven't run into it, but once it starts happening have you tried going to CF Admin and 1. Checking the mapping defined. 2. Delete and recreate the mapping.
m
Tried that and it didn't seem to help.
e
sorry, don't have much more to offer, I don't use docker and running lucee on windows. i threw your question at ChatGPT and just in case any of its "thoughts" are useful, here is a link https://chatgpt.com/share/678718db-2f9c-800c-b81a-87f1c38585cc
t
When you do
expandPath('/myMappedDir')
, it actually expands
/var/www/myMappedDir
, that is, treating
/var/www/myMappedDir
a relative path from your web app root, hence giving you
/var/www/myMappedDir/app/var/www/myMappedDir
If you need the location (absolute file path) of
/var/www/myMappedDir
, you just use
/myMappedDir
e.g.
result = fileUpload( "/myMappedDir", "fileField" );
It will upload file to
/var/www/myMappedDir
I assume you're on Linux/Mac system, so
/var/www/myMappedDir
is actually an absolute path already even though it may looks like a relative path
m
Just to confirm, I have a mapped directory named
/mappedDir
and it's pointed at
/var/www/mappedDir
I know it's weird, but it's not my code.
And when I
expandPath('/mappedDir')
I expect to get
/var/www/mappedDir
It was working correctly, then it stopped
So I've spun docker down, deleted the built image and create created it to the same result.
It's a tough one. I think it's a bug, and I'm interested in know if anyone has run into the same bug and worked around it.
t
Assuming
/var/www/
is your web app root
expandPath('/mappedDir')
will give you
/var/www/mappedDir
if you do NOT have a mapping of
/mappedDir => /var/www/mappedDir
But if you do have a mapping
/mappedDir => /var/www/mappedDir
,
expandPath('/mappedDir')
is actually running
expandPath('/var/www/mappedDir')
so it gives you
/var/www/var/www/mappedDir
e
@Tomy Saman (Wu) but he is saying ExpandPath does work correctly, but then changes at some random point
👍 1
m
/var/www/
is not the webroot, but you are correct, it it was I wouldn;t need the mapping
I appreciate the extra eyes.
e
were you able to open that ChatGPT link? it had some points about docker, lucee and base system conflicting about path mappings
t
ok, maybe there is something else in the codes that doing something weird. But my main point is the different effect/result when you run
expandPath
on a normal path vs on a mapping path
m
I got to run, but thanks for pointing that out, I actually missed that.
I had previously clear the cfclasses, but maybe blowing some more stuff out will work.
I'm just going have to reorganized it to avoid that scenario I guess. Just trying to move as few parts as necessary.