Hey folks, I downloaded the latest commandbox v5.7...
# box-products
t
Hey folks, I downloaded the latest commandbox v5.7.0 with JRE for windows. I extracted the folder and opened it, then double-clicked the box.exe there. It ran but then I got this error:
d
Did you Run cmd as an administrator ?
b
@teaman Seems pretty self explanatory
Do you have a question about it it?
t
Why is it throwing an error? File exists but claims it doesn't
b
Ignore that- Java is bad at error class names
The file is clearly just locked
t
Every time I start box it quits with that error
b
I assume you have a box instance or server running somewhere
YOu gotta's stop them all first
or Windows locks the files
Pretty standard on windows
t
Ahh ok
b
In fact, I was fairly certain the error message included that note in it
Is there no more text below the error?
t
No that was all I get, no additional text
b
I have no clue why Java uses the
FileNotFoundException
class to throw general errors when it can't delete a file. I think they just like to confuse people
t
Every time I invoke box in the terminal for my project. But I did have another server running so I'll try it after I stop it
b
CommandBox does a more-in depth file locking check when it does the "initializing libraries" step. Generally if there is another box instance open, it will catch it there
That's probably the check that has the additional details
t
I stopped the other server that was running and then tried invoking box but I still get that error
b
Ask windows ¯\_(ツ)_/¯
I'm not the one with files locked, lol
Tools like SysInternals ProcessExplorerer will tell you what processes have any files locked on your PC
But a good restart will usually fix it too
Sometimes, just having a Windows Explorer window open can lock stuff
Windows does what it wants
t
Trying to delete that file manually in Windoze still fails
file in use.
b
But until you fix whatever the heck has windows no wanting to allow those files to be deleted, your issues will go away
t
Ok
May I suggest the Installation instructions mention these additional steps here: https://commandbox.ortusbooks.com/setup/installation
b
And if you keep trying to run box without fixing the issue, you will continue to get an error
every. single. time. 🙂
You can, but if there was a note there that said to close box before upgrading, would you really have read it, and if you did, would it really have helped you? 😉
As a Windows user, having random programs trip up because Windows decided to hold a lock on some file is just part and parcel with working with windows, and I don't generally need every windows tool ever to have a note in their docs telling me Windows can be dumb sometimes.
t
I would if I ran into an issue. I went back and reread the confusing directions and no mention of this needing to be run as Admin (if indeed that is a requirement) or about stopping all running commandbox servers.
b
No, running as admin is not a requirement
t
If I updated every day or week I'd be well versed in how to do it and what to check. Doing it once every 6-12 months is not often enough to recall what to do when things go sideways
b
Right, but this is Windows going sideways, not CommandBox
t
But it's running on Windows. I'm just suggesting that in the Windows sub-section on that page, how about a note, a bullet item, you choose.
b
I know what you're suggesting, I'm not just of the mind it's that useful. Every time someone hits a snag, they always want to say, "Of only there were a page in the docs that addressed this super specific issue I ran into today that's a 1 in a 1000 thing, then everything would have been ok".
To me, this just appears to be Windows doing things and when Windows locks stuff, I restart it and move on which I consider to be pretty general Windows advice
t
Installation Instructions is a good place to put any obstacles users report like this. It will help the next guy who encounters it.
I had to close my VSE editor window before Windows let me delete that file. I really dislike Windows but my job requires I wrestle with it.
b
Yeah, there's probably 100 different ways a file or folder can have locks on it
For you it was vscode, for someone else it could be another program
t
The worst is that it never tells you who is locking it!
b
That's why I use SysInternals ProcessExplorer to find that information
t
What is that
b
But that's the sort of thing that belongs in the Windows docs, not the CommandBox docs
If a file is locked, then it's up to you to reference how to solve that for your given OS and file system
I don't use it for much else, but the ability to see whose locking a file is clutch when you don't want to have to restart
t
Thanks for that link! That looks like a really helpful tool.
Thanks for your time on this lock issue.
b
You go to the "Find" menu and choose "Find Handle or DLL..." then type in a partial file path and it will pull up all the file locks on it