r
image.png
b
Hmm that's a brand new one!
What version of box?
What did you change recently?
r
This was the first time I ran commandbox on this server, and it was the latest download from the commandbox website
b
#NewErrorUnlocked
What is your user home directory named?
The error is coming from getting a temp directory
And I'm guessing the path is wrong
The actual error came from java's File class
Wow, interesting
Copy code
try {
            final File tmp = File.createTempFile("a", "a");
            tempFile = tmp.getParentFile();
            tempFile = getCanonicalFileEL(tempFile);
            tmp.delete();
        }
        catch (final IOException ioe) {}
That is the code
But it's in a try catch
The error is not an IOException however 🤔
What version of Java are you using?
r
The home directory is C:\Users\Administrator.TECHEMET
I assume it should be using the bundle jre that comes with the download
Must be because java is not in the Path Environment variable
b
Did you download the JRE bundled version?
r
I did
b
Run
Copy code
box -clidebug
and it will tell you in the first couple lines
My guess is this code in Lucee is bad and broken and has never worked, but normally never gets hit due to the
return
statement above it
So you're hitting Lucee's fallback code which is broken, lol
r
image.png
b
This is a Lucee bug, BTW 🙂
I didn't realize when I used Lucee in CommandBox that I'd be funneling half of Lucee's bugs through my support, lol
😂 1
Are you sure you're on 5.8.0? I thought the Java version has been there for a while
Copy code
Brad@DESKTOP-IAN6MSO C:\Users\Brad
# box -clidebug version
CLI Java Version: 17.0.2+8
CLI Java Home: C:\Program Files\CommandBox\jre
CLI Java Vendor: Eclipse Adoptium
box binary version: 6.0.0-alpha
box binary loader version: 2.8.4+00051
initial arguments:[version]
That's what I get. I know I just added the box binary versions on the bleeding edge of commandbox, but the java stuff I thought was there for a while
Doesn't really matter though-- at first I thought maybe you were on some crazy new verison of Java that threw different exceptions, but you can see from the JDK's javadocs, the
IllegalArgumentException
was there in Java 8
r
Im positive. I also copied the box.exe and jre folder from a working server to this one and I am getting the same error
b
Which leads us back to the temp dir logic PRIOR to the bad logic
Which is this
Copy code
if (tempFile != null) return tempFile;

		final String tmpStr = System.getProperty("java.io.tmpdir");
		if (tmpStr != null) {
			tempFile = new File(tmpStr);
			if (tempFile.exists()) {
				tempFile = getCanonicalFileEL(tempFile);
				return tempFile;
			}
		}
So, basically, one that other attempt to find a temp dir in Lucee works on your other server, but fails on this server, causing Lucee to fall back to it's crappy broken attempt at finding a temp folder
So, let's find out what
java.io.tmpdir
is on this system
My overall thought is that this will boil down to permissions, but that's just a guess
Java will often times pick a temp dir that the process doesn't actually have permissions to write to, I've found.
r
We have a crowdstrike falcon agent deployed on this server. I wonder if thats causing an issue
b
Run this
Copy code
java  -XshowSettings
r
So, let's find out what java.io.tmpdir is on this system
How would I go about doing this?
b
And look for
java.io.tmpdir
in the outpuit
For example, on my PC it's
Copy code
java.io.tmpdir = C:\Users\Brad\AppData\Local\Temp\
r
FYI, I am running Crowdstrike Falcon and CommandBox without issue.
b
All I can imagine is some falcon flying around zapping a crowd of people with lightening, lol 🧑‍🤝‍🧑 đŸŒŠī¸ đŸĻ…
Also, can you copy/pates the text of that error so I can put in a ticket for Lucee?
r
@Rodney yeah that comment was a long shot. Other server/machine work fine with crowdstrike
@bdw429s java.io.tmpdir = C:\Users\ADMINI~1.TEC\AppData\Local\Temp\1\
seems we have a winner
or maybe not?
b
Ok, so the million dollar question. Does this Java process have permissions to that folder?
Also, have you tried running as admin to see if it changes anythigng?
Also, does that folder even exist?
Because Lucee won't use it if it doesn't
Copy code
if (tempFile.exists()) {
r
No thats not the correct folder. The .commandbox folder is written to C:\Users\Administrator.TECHEMET\.CommandBox
b
Not sure what you mean
That is Java's temp folder
Java doesn't care about CommandBox
So the CommandBox home is sort of irrelevant
r
Ok copy that, but that path does not exist 100%
b
Well, that's your problem, lol
No idea why Java would point to a temp path that doesn't exist until the expectation is that the app would create it itself
If you create that
1/
folder, does Lucee start?
I'm curious if that's dynamic and ever changes 🤔
r
Ok I logged into the server with a different admin account and commandbox startup succesfully. Let me check permission quick and get your that stack trace
b
Hold on, what's the java temp folder under that other user?
Does Lucee work because permissions are different or because Java pointing to a real, existing folder
r
ok standby
java.io.tmpdir = C:\Users\ryan\AppData\Local\Temp\2\
b
And does that exist?
I also found some references that on WIndows, Java may use the Windows env var
Copy code
echo %TEMP%
as its temp dir
So this could actually be based on how your windows profiles are configured if you have a sysadmin doing funky stuff with your env vars on login
r
On the 'Admnistrator' account echo %TEMP% returns
C:\Users\ADMINI~1.TEC\AppData\Local\Temp\4
which is incorrect. It shoudl be
C:\Users\Administrator.TECHEMET\AppData\Local\Temp\4
if I check the file structure using file explorer
b
I would talk to your sys admin
LIke I said, I have a feeling you have some custom process fiddling with env vars on your user profiles or when windows logs in or something
And it's setting your temp dirs to folders that don't exist
Which is passed to java to be used as the temp folder
Which Lucee then craps out on
In the mean time, just create that folder or manually override that env var to a real folder and see if Lucee works
r
Yup I just did that and it worked.
In windows the temp environment variable was set to %USERPROFILE%\AppData\Local\Temp and the `%USERPROFILE% was returning the correct file path
b
Apparently Java 20 will give you a warning https://bugs.openjdk.org/browse/JDK-8290313
r
so something strange is going. Like you said I will contact our MIT team to figure out whats going on there.
b
Also, did you see my request for you to copy and paste the raw text of the error that was in the image?
r
But I have a work around. Thank you for your assistance 👍
b
So I can create a Lucee ticke
Because this is all their fault 😉
r
Ok give me one second
I reverted the manual change on the TEMP environment variable and now I cannot replicate the issue
b
nevermind them, I'll just post your screenshot
I was just hoping to get the Lucee parts of the exception only
Otherwise, when I post a ticket about a Lucee bug and CommandBox is involved, they will say "OH NO, IT MUST BE COMMANDBOX! COMMANDBOX IS AT FAULT" eye roll
I just cropped the image
#technology
r
Awesome. Thanks again that was great.
👍 1