With the new version of CommandBox 5.5 and Lucee 5...
# box-products
p
With the new version of CommandBox 5.5 and Lucee 5.3.9.133, doing a quick install on Apple Silicon based MacOS machines via Brew finally works without having to install an Intel version of Java! Cleared out my old copies and installed from 'scratch' and it spun up just fine. šŸ˜„šŸŽ‰
b
@Patrick S Thanks for confirming. The newest version of Lucee ships a newer JNA library that works on the ARM java versions.
k
Any chance I could get some details on what needs to be cleared out and how? I'm still getting nowhere trying to run a brew installed CommandBox. No doubt something I've done wrong but any pointers to solutions or things to look for would be appreciated.
p
I uninstalled the various versions of Java that I'd had installed, as well as older copies of the box executable. Are you using the default Java stack that is installed when you install CommandBox?
What sorts of errors are you seeing?
k
Well, I've tried various installs of Java but removed each. Brew is installing openjdk@11 When trying to start a server it just seems to hang with a java Start menu showing
p
Can you screenshot or paste what you're seeing?
k
* CommandBox Version: 5.5.1+00562 * CommandBox Authors: Brad Wood, Luis Majano, Denny Valiant * * CommandBox Binary /opt/homebrew/Cellar/commandbox/5.5.1/libexec/bin/box * * CommandBox Home /Users/kwilson/.CommandBox * CFML Engine: Lucee * CFML Version: 5.3.9.133-SNAPSHOT SNAPSHOT (Gelert) * * Java Version: 11.0.15 (Homebrew) * Java Path: /opt/homebrew/Cellar/openjdk@11/11.0.15/libexec/openjdk.jdk/Contents/Home/bin/java* * OS Username kwilson * JLine Terminal org.jline.terminal.impl.PosixSysTerminal * Runwar Version 4.7.4 (/Users/kwilson/.CommandBox/lib/runwar-4.7.4.jar)
Not seeing any error in terminal at all. When starting the server it just displays: āˆš | Starting Server | āˆš | Setting Server Profile to [development] The java start menu appears but When I check for a list of servers it shows the one but says it is stopped.
p
Interestingly CommandBox is running fine, but, I now see this error:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by runwar.LaunchUtil (file:/Users/xxx/.CommandBox/lib/runwar-4.7.4.jar) to method java.lang.ProcessImpl.pid()
WARNING: Please consider reporting this to the maintainers of runwar.LaunchUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
k
I have seen that in the past at various times and installs trying to figure this out.
p
Maybe try removing any old config files if you haven't? That it is starting to load configuration suggests that it is getting past the earlier Java start issues. @bdw429s might have a better idea about both of these things...
k
Where would I find any stray config files? I'm thinking I've cleaned those out but may be clueless to some.
p
The low level Commandbox json files can be found in this folder on your system: /Users/kwilson/.CommandBox - CommandBox.json and servers.json are both there, I would check them out for anything weird and back them up before altering/deleting. In the server folder you should find the individual websites that you've started via CommandBox. (There might be other places, but I admit I'm not the expert here! So take it with a big grain of salt before I get corrected by more knowledgeable people.)
k
Yeah, of late when trying to resolve this issue I've always just completely uninstalled CommandBox deleted the .CommandBox folder in hopes of a clean start but no luck.
b
Not seeing any error in terminal at all. When starting the server it just displays:
@Ken Wilson Please see the docs on how to debug server starts šŸ™‚ https://commandbox.ortusbooks.com/embedded-server/debugging-server-starts
The first thing I'd recommend is to start the server like so
Copy code
start --debug --console
and you'll likely see what the error is right away.
Interestingly CommandBox is running fine, but, I now see this error
WARNING: An illegal reflective access operation has occurred
@Patrick S Firstly, that's a warning, not an error as designated by the word "warning" at the start of the line. šŸ™‚ It's just that-- a warning, and it's been happening every since Java 11. There's nothing you need to do about it and it won't prevent your server from working just fine. It's a note about some stuff the CF Engines need to fix before CF will run on Java 16+.
Where would I find any stray config files? I'm thinking I've cleaned those out but may be clueless to some.
Randomly deleting files isn't going to fix anything. In fat, it will probably just mess something up šŸ™‚ I don't actually see anyone sharing specific details of their issues here other than vague statements like the server "doesn't start", or showing some harmless console warnings. Before anyone starts deleting anything, let's figure out if there's actually a problem first!
šŸ‘ 1
p
Cool, I figured it was something known, but figured it would be good to double check! It is the first time I recall seeing it, so just in case it was M1 specific...
b
Yeah, of late when trying to resolve this issue I've always just completely uninstalled CommandBox deleted the .CommandBox folder in hopes of a clean start but no luck.
This is almost never a fix to anything. Somewhere people got the idea it would solve problems, so they keep recommending it to each other.
Figuring out how to do a debug server start in the console will give you much much more mileage
It's worth noting that the version of Lucee that powers the CommandBox CLI and is also the default sever when you just run
server start
is not compat with the M1, but that doesn't mean that your particular site you're using happens to be using a compatible version of Lucee!
If you have a
server.json
file that is starting Lucee 5.3.8, for example, you're still going to have errors due to Lucee's incompatibility with the newer versions of openjdk.
The output of the
info
screen above only tells us the version of Lucee inside the CLI, not the version of Lucee in whatever server is being started
k
Thanks for all this feedback. I will certainly dive into a --debug start. One note, though. There is no existing website. I'm just getting started with CommandBox and wanting to work on converting a site from CF2018. My issue is with just trying to get the server started at all.
What version of the server should I be trying to start on an M1 if the default is not compatible? Perhaps I'm missing some very basic piece of info here?
b
@Ken Wilson I've only had Lucee users asking me about M1 support. I don't own an Mac and I haven't heard of anyone who's been testing Adobe on the M1s. It may work, maybe not. I have no clue, lol. But just start with the debug/console start and that will give us an actual error to work off of. Otherwise, we're just going in circle and guessing
p
The default Lucee does work now, unlike before when it required an Intel version of Java to be installed due to one of the libraries changing/being missing. I haven't really pushed it that much yet, but a simple/empty site should spin up fine.
šŸ‘ 2
k
I use CF2018 on a daily basis on my M1 and have played with CF2021, both without any issues. My only problem seems to be with trying to do so via CommandBox, and I feel certain that is due to my lack of much experience with it. Never had problems before this M1 though.
Lots of info from --debug --verbose but the only error was`[ERROR] ERROR: Startup exceeded timeout of 240 seconds - aborting!` ERROR (5.5.1+00562)
Server process returned failing exit code [1]
b
You didn't use
--console
like I said šŸ˜‰
Details!
I assume there is an error happening after the server has started booting, but before it's all the way up
The --debug flag only captures the output at the beginning and not the entire time
k
Geez, sorry, that was me seeing what I didn't read. šŸ™‚
b
You can drop the verbose in this case as adding debug inherently enables verbose output so it's redundant
k
after running for several minutes and showing lots of debug and info lines it finally shows
[*ERROR*] Exception in thread "main"
[
*ERROR*] java.lang.OutOfMemoryError: Java heap space
[
*ERROR*] at java.base/java.io.UnixFileSystem.resolve(Unknown Source)
[
*ERROR*] at java.base/java.io.File.<init>(Unknown Source)
[
*ERROR*] at java.base/java.io.File.listFiles(Unknown Source)
[
*ERROR*] at org.xnio.nio.WatchServiceFileSystemWatcher.doScan(WatchServiceFileSystemWatcher.java:237)
[
*ERROR*] at org.xnio.nio.WatchServiceFileSystemWatcher.watchPath(WatchServiceFileSystemWatcher.java:182)
[
*ERROR*] at runwar.undertow.MappedResourceManager.createFileSystemWatcher(MappedResourceManager.java:327)
[
*ERROR*] at runwar.undertow.MappedResourceManager.registerResourceChangeListener(MappedResourceManager.java:298)
[
*ERROR*] at io.undertow.servlet.handlers.ServletPathMatches.<init>(ServletPathMatches.java:88)
[
*ERROR*] at io.undertow.servlet.core.DeploymentImpl.<init>(DeploymentImpl.java:95)
[
*ERROR*] at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:151)
[
*ERROR*] at runwar.Server.createServletDeployment(Server.java:1312)
[
*ERROR*] at runwar.Server.startServer(Server.java:485)
[
*ERROR*] at runwar.Start.main(Start.java:50)
b
@Ken Wilson Well, there you go! So I assume you know what to do from here?
I'm also curious if you have a particularly large set of files in your web root. The error happened in a part of the servlet code that starts up a watcher to detect when files change, but that could just be a coincidence if your server has a very small heap.
Either way, the file system watchers are an Undertow setting I enabled in the latest version of CommandBox and if it's going to cause issues for people with a lot of files in their web root, I may want to add in a flag to disable it.
p
This is one reason to try spinning it up with an empty site, or one with just a 'hello world' page
šŸ‘ 1
b
Yep, that's a great troubleshooting tip-- remove factors and simplify the problem domain!
k
This IS me spinning it up with en empty site, nothing at all, just trying to start the server and take a look around the Lucee admin.
b
Wait, the Lucee admin? I thought you were trying to start an Adobe site?
Either way, the error message is pretty clear-- you ran out of heap space. ā€¢ have you set a max heap size for this server? ā€¢ Is your PC out of free ram?
@Ken Wilson
k
No, I'm just trying to start Lucee up and start getting familiar with it. No, haven't set anything. No indication of any memory issues on the laptop apart from this.
b
Well, I suppose it's worth setting a max heap size for starters
This is a low level error coming from java, so you'll need to figure out why it doesn't have enough heap
Copy code
server set jvm.heapSize=1G
Assuming you have a Gig of free RAM for the server.
No indication of any memory issues on the laptop apart from this
There's also no indication that you actually looked at your memory usage šŸ˜‰
Just because your laptop hasn't crashed, doesn't mean it has a ton of free RAM to spin up servers. That said, a Lucee server normally only uses about 40 MB of RAM just to start up an empty site, so I can't imagine why you'd be having any issues.
k
Hehe, yeah I checked, 16gb total, about 10gb in use at that time. I just shut down everything and rebooted, set heap to 1G as you noted. Will start again. Really appreciate your assistance
Same error, just got it a lot faster this time.
[*ERROR*] Exception in thread "main"
[
*ERROR*] java.lang.OutOfMemoryError: Java heap space
[
*ERROR*] at java.base/java.io.UnixFileSystem.resolve(Unknown Source)
[
*ERROR*] at java.base/java.io.File.<init>(Unknown Source)
[
*ERROR*] at java.base/java.io.File.listFiles(Unknown Source)
[
*ERROR*] at org.xnio.nio.WatchServiceFileSystemWatcher.doScan(WatchServiceFileSystemWatcher.java:237)
[
*ERROR*] at org.xnio.nio.WatchServiceFileSystemWatcher.watchPath(WatchServiceFileSystemWatcher.java:182)
[
*ERROR*] at runwar.undertow.MappedResourceManager.createFileSystemWatcher(MappedResourceManager.java:327)
[
*ERROR*] at runwar.undertow.MappedResourceManager.registerResourceChangeListener(MappedResourceManager.java:298)
[
*ERROR*] at io.undertow.servlet.handlers.ServletPathMatches.<init>(ServletPathMatches.java:88)
[
*ERROR*] at io.undertow.servlet.core.DeploymentImpl.<init>(DeploymentImpl.java:95)
[
*ERROR*] at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:151)
[
*ERROR*] at runwar.Server.createServletDeployment(Server.java:1312)
[
*ERROR*] at runwar.Server.startServer(Server.java:485)
[
*ERROR*] at runwar.Start.main(Start.java:50)
b
That's just odd.
Can you add
Copy code
--trace
to the start?
I want to see what specific folder the file system watcher is being started on
Looking for the output of this code
Copy code
MAPPER_LOG.trace("Creating file system watcher in [ " + basePath + " ] with alias [ " + prefix + " ]");
@lmajano uses an M1 on his mac and I know he's testing servers all the time. I wonder if it could be related to the java version šŸ¤”
p
I just looked to see which Terminal Shell I'm using, and it looks like it is currently the default zsh one, for what it is worth
k
FYI, somewhere back in this thread I noted I had tried the brew commandbox install, but I eventually removed that to try to mac jvm download
p
I vaguely recall having shell issues a while ago with CommandBox, I think, but it must be fine now with the new default
Oh, definitely delete any old local copies of the box.app
I had problems because I'd downloaded both, and removing the second copy fixed it all up
k
yeah. did that long agi
b
CommandBox is using java 11, right?
By default, all servers you start will use the same JVM the CLI is using unless you tell it otherwise
The latest CommandBox/Lucee SHOULD be fine on whatever the latest version of Java 11 is. That said, most of the coworkers I have on an M1 are using using the Intel JVM I think just due to the previous issues Lucee had.
p
The intel version did work, so it is a totally valid fallback. But I'm happy to have it running native. What hardware are you running it on?
k
No reference to MAPPER_LOG.trace(
b
no, no
k
Same memory error
b
that was the code
I'm looking for the MESSAGE being logged!
Copy code
Creating file system watcher in [ " + basePath + " ] with alias [ " + prefix + " ]
It should literally happen right before the out of memory error
You're obviously not going to find the actual word "mapper_log" in the logs, lol
That's the name of the Log4j logger!
šŸ¤Æ 1
@Ken Wilson
k
[DEBUG] Runwar: welcome-file: index.cfm [DEBUG] Runwar: welcome-file: index.lucee [DEBUG] Runwar: welcome-file: index.html [DEBUG] Runwar: welcome-file: index.htm [TRACE] Runwar: Total No. of mime-mappings: 0 [TRACE] Runwar: Total No. of error-pages: 0 [TRACE] Runwar: Total No. of cookie config elements: 0 [DEBUG] Runwar: Added websocket context [INFO ] Runwar: Creating deployment [default] in /Users/kwilson [DEBUG] Runwar: Initialized MappedResourceManager - base: /Users/kwilson, web-inf: /Users/kwilson/.CommandBox/server/93FA74839EDAAE35ACCB8A7BAA3B23E4-kwilson/lucee-5.3.9.133-SNAPSHOT/WEB-INF, aliases: {} [ERROR] Exception in thread "main" [ERROR] java.lang.OutOfMemoryError: Java heap space
b
Hmm, I'm not sure why that trace log isn't there, but this also tells me what I need to know
You're starting the server in
/Users/kwilson
as your web root
k
yeah
b
And you're telling us that folder is ... empty?
Because I doubt it is šŸ˜‰
it's your user home!
It's probably huge
k
well, yeah, so therefore it's reading everythign there?
p
Just point it to a new folder inside it
b
in order to cache information like welcome files and power the servlet path caching feature, undertow uses an XNIO file system watcher to tell when a file changes in your web root
So yes, it lists all the files recursively to keep tabs on them
k
geez, sorry to waste so much of your time
p
I usually just create a sites/sitename/ folder for my projects
b
When you said this, it sounded like you were starting the server in an empty folder https://cfml.slack.com/archives/C06TSRXCJ/p1652819263907109?thread_ts=1651524454.123539&amp;cid=C06TSRXCJ
k
yeah, I just dropped into an empty folder and it started right up
b
This is good though, because it tells me I need to worry about someone having a huge web root
I've actually just added the code to runwar to be able to disable the file system watch in an extreme case
p
Yeah, I could see that being a problem with a large site with many files
k
well, and folks not thinking about what they are doing.
b
I'll push this as a feature in the next version just since I'm sure it will bite someone somewhere in the future
Just for funsies, can you get a count of the files in your user home
k
I had a folder sitting there waiting on my first conversion project but didn;t drop into it
b
I just want to know the count-- so I at least know that number won't work, lol
Looks like this should do it if you run from that dir
Copy code
find . -type f | wc -l
You can run it right from CommandBox if you add
!
in front
Copy code
cd ~
!find . -type f | wc -l
p
Glad you figured it out! šŸ˜„
k
that will be enormous since it includes years of project archives spread across One Drive and Google Drive
b
Good, can you get the count?
I'm just really curious
it would be nice to know what the practical limits are when this comes up again
Just run the command above
k
280,766
b
šŸ‘
k
So your sayin if I'd stopped at 250,000?
šŸ™‚
b
lol, yeah that would have worked no problem šŸ˜†
k
Really sorry I was so much of your time
b
no, this was really good info. And I'm glad I found out now so I could put in a way to turn that off in the future
it never occurred to me there would be a hard stop on that watcher stuff
k
One other question, the menu icon I would normally see on my previous mac for the server is not present now. Just that Java start menu
Is that expected?
b
That's covered in the release notes
k
OK, thanks
Basically the java lib I use for the tray icons has been REALLY dragging their feet on java 9+ support and Mac users are starting to get errors in the console from it
You can still turn it on, but it's off by default for Mac now
Hopefully, once the library finally gets updated I can turn it back on by default in a future version
k
OK, I recall seeing discussion of that ealier today, thanks
and there it is...thanks.
b
Oh, on a random note, the reason that logging line from above didn't show up was I totally forgot CommandBox's resource manager doesn't log anything unless you turn it on sincen it's so darn chatty.
Copy code
server set runwar.args=['--resource-manager-logging=true']
will tease it out-- not that we need it now though.
k
Yeah, Iā€™d definitely recommend a few fewer files. :) Thanks again for patiently bringing me to my senses.