lame RTFM type question: if i box server start cfe...
# box-products
r
lame RTFM type question: if i box server start cfengine=adobe, the CLI's going to write that out as a server.json, and if I git pull that on another machine, i can just box server start, right? (i dont care if the CF version is slightly different)
p
Correct, whatever gets put in the server.json is going to be the exact that spins up on the git pull on other box.
I believe it writes the exact version that is used into the json file.
r
excellent
p
assuming you commit your server.json file heh; dont forget!
r
i started the server in WSL and am getting an error i believe i reported before -
any ideas?
that being said -i think it actually launched
how do i find the port of what box started?
box server list. easy enough
yeah - i seem to remember box not playing well on WSL 😞
its running but not accessible
its available in the ubuntu environment, i can curl it, but its not proxied to the rest of windows, like other utilities are
off to report the bug
s
try
Copy code
box server start cfengine=adobe console=true trace=true
that way it is running in the foreground and you can figure out why its not available
r
to be clear, if i ignore the error, it does seem to be running -
s
oh ok, cool
r
and if i curl it, i get the response i expect
but via desktop browsers, it's not available
other utilities (vue, httpster, etc), all work fine w/n wsl and dont have an issue being "exposed" to the rest of windows
s
oh, i see, im on mac so not familiar with WSL
p
Same, mac/linux world over here
r
b
@raymondcamden That error is a harmless warning in Java 11+ complaining about some Java reflection it doesn't like. That will eventually have to go away when the CF engines (both Lucee and Adobe support Java 16+ which is the version of java that eventually blocks that sort of java Reflection)
You don't need to worry about the error and there's nothing to make it go away since it comes from Java itself
Regarding accessing a server started in WSL, you need to just bind it to all ports and it should be accessible.
Copy code
start host=0.0.0.0
but I have no idea why WSL requires that.
I'm not aware of anything CommandBox can do to change the way the networking starts
r
well, just to be clear, nothing else requires this afaik. been using WSL for a few years now, and plenty of apps open up ports and just work
tbh though - this is probably the only Java server i use - that could be difference
nogo on the above. it started, it looks right, but cant hit it via my browser
b
Hmm, not sure. I don't use WSL, but other users with that problem reported that binding to 0.0.0.0 fixed their issue
r
to be clear, that was: box server start host=0.0.0.0 ?
b
Yes, or
Copy code
server set web.host=0.0.0.0
server restart
same thing basically
That's what most people said made the site accessible outside of WSL
But I have no idea what's different about WSL compared to just starting a server normally. We use JBoss Undertow to bind the actual server and as far as I know, they don't do anything special or different.
r
will try tomorrow - thanks
b
I’ve used plenty of CommandBox apps running in WSL2. Binding the host to 0.0.0.0 has always worked for me, even when accessing in the browser as “localhost:12345”. Perhaps I can provide some more answers tomorrow.
r
ah, so localhost worked. i made one request to a test cfm, and then the server died 😉
restarted and i think its ok
nope. i can make a few requests, and then it dies on me
if i box server log, i see errors, but they are related to it trying to open a browser, which typically fails in WSL2. is there a command to report more logs?
foir example, box server list shows Webroot, but not server root where id dig for logs
found em
b
server set trayEnable=false
should disable the tray if that’s the issue.
server set openBrowser=false
should prevent the browser from being opened
I’ve run into both
r
k. i can say trhe logs folder feels... wrong. there's one log. not the usual mix of CF logs
restarted and no logs - im just worried about it crashing again
b
after starting,
server log --follow
will tail the log for you
r
now it seems ot be staying up. maybe one of those 2 options were throwing an error i thought was 'ok', but was... well not 😉
yeah ive made another cfm, reloading a bunch of times, i may be good to go. muchas gracias!