CommandBox can't start servers

I recently upgraded CommandBox, and I can’t seem to start servers any more.

When I run the command box server start, no server is actually started. I get the typical response that I’m used to seeing:

The server for D:\Sites\fw1-testing is starting on 127.0.0.1:55657... type 'server status' to see result

But no tray icon is shown and no new browser window is opened. When I browse to the URL, I get the browser’s “webpage not available” screen, implying that there’s no server running at all (rather than a configuration issue or a 404).

When I run box server status, I get:

name: fw1-testing status: starting info: webroot: D:\Sites\fw1-testing logdir: C:\Users\mrausch/.CommandBox/server/A74254A2B7DF999067794A061560814D-fw1-testing/log libDirs: webConfigDir: serverConfigDir: webXML: trayicon: port: 55657 host: 127.0.0.1 stopsocket: 55658 debug: false ID: A74254A2B7DF999067794A061560814D

But when I run box server log, I get:

No log file found for 'D:\Sites\fw1-testing'! C:\Users\mrausch/.CommandBox/server/A74254A2B7DF999067794A061560814D-fw1-testing/log/server.out.txt

If I browse to the server folder (A74254A2B7DF999067794A061560814D-fw1-testing), I see a single empty folder titled “log.”

My box version is CommandBox 1.0.0+00224. (Although, I think it’s actually +00225.) I’m running Windows 8.1 Pro.

Anyone have any thoughts or suggestions?

Did it work before?

Is there a defaultEngine config key in your box.json fine? If so, you may want to try removing it. I had the same exact issue earlier today when that key was in place with any of the engines listed in the example config.

Yes. When I was using 1.0.0+00166 it was working great.

There were some recent changes to the server config on the bleeding edge. Let my try a scratch install to confirm.

Also, how did you upgrade? We’ve updated the Java libs a few times, and unfortunately the “upgrade” command only updates the CFML bits. Try removing your entire .CommandBox folder under your user directory and re-running the latest binary. This will force the re-extraction of the libs.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Miles, I just tested a scratch CommandBox install on my Windows 8 laptop and the embedded server works great. Let me know the details of how you tried to upgrade as well as your operating system, etc.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Okay, I’ve tried going a little nuclear.

  • I’ve cleared out my D:\commandbox folder (where I store the box.exe executable).
  • I’ve deleted my C:\Users\mrausch.CommandBox folder
  • I’ve gone to the CommandBox website to download the Windows (without JRE) binary: http://www.ortussolutions.com/products/commandbox
  • I’ve extracted box.exe into the D:\commandbox folder
  • I’ve jumped into PowerShell and executed “box”
    This is what I see:

`

Library path: D:\commandbox\lib
Initializing libraries – this will only happen once, and takes a few seconds…

Libraries initialized


/ ____| | | _ \

___ _ __ ___ _ __ ___ __ _ _ __ | | |) | _____ __
/ _ | ’
_ \| '_ _ \ / | '_ \ / _ | _ < / _ \ / /
| () | | | | | | | | | | | (| | | | | (| | |
) | () > <
_
____
/|| || ||| || ||_,|| ||_,|___/ ___//_\ v1.0.0+00225

Welcome to CommandBox!
Type “help” for help, or “help [command]” to be more specific.

`

Now I think we’re getting to the root of things. Next I ran this:

`

CommandBox:fw1-testing> server start
The server for D:\Sites\fw1-testing is starting on 127.0.0.1:57752… type ‘server status’ to see result
CommandBox:fw1-testing> railo.commons.cli.CommandException: Error opening zip file or JAR manifest missing : C:\Users\mrausch/.CommandBox/lib/railo-inst.jar

at railo.commons.cli.Command.execute(Command.java:51)
at railo.runtime.tag._Execute._run(_Execute.java:63)
at railo.runtime.tag._Execute.run(_Execute.java:54)

`

Is there any assumption on the part of CommandBox as to where the executable lives? CommandBox puts all its supporting files in D:\CommandBox (where I want CommandBox to live), but the above error message looks like it’s trying to get those files from my personal profile folder, where server details are kept.

None of the error message (the “Error opening” part) shows when I run box server start from commandline. It only seems to show up in the CommandBox shell.

I copied the folders that were generated into the D:\commandbox folder into my profile .CommandBox folder, and now the server works.

Does this mean that CommandBox should be installed into my profile folder now? Or is there some bug that caused the folders (cfml, commands, lib, etc.) to get generated in the wrong place? I’d love to keep CommandBox where it is. I don’t really care where it generates its folders.

Can you expand on what folders it created in your D:/commandbox directory? Earlier when I tested on my Windows 8 laptop, the box.exe was on my desktop and it did not create any other files or folders on the desktop-- only in my user directory.

Generally speaking, CommandBox shouldn’t care where the binary is, but it will put everything in ~/.CommandBox.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

The folders that were created in the D:\commandbox folder were:

  • cfml
  • commands
  • engine
  • lib
    When I was using 1.0.0+00166, those same folders were generated in my profile folder instead, leaving D:\commandbox with just the box.exe file. I just assumed you guys had changed something in the way later versions worked.

Interesting, that shouldn’t happen unless you’re trying to override the default home directory (which has to be done every time you run the binary)

I can’t replicated it though on my end with the latest binary. Is this happening to you every time, or did it just happen once?
What version of WIndows are you using?
Can you show us the exact commands that caused those folders to be created?
There’s always a possibility that it’s a bug that only happens when you’re using a different drive or something.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

...

Is there any assumption on the part of CommandBox as to where the
executable lives? CommandBox puts all its supporting files in D:\CommandBox
(where I want CommandBox to live), but the above error message looks like
it's trying to get those files from my personal profile folder, where
server details are kept.

There were a couple of assumptions, which would prevent this from
working even if you passed the "-commandbox_home=D:\CommandBox" argument
to the executable.

I've addressed them in a pull request, but we haven't merged it in and
dropped an official release of it yet.

If you're feeling saucy, you can try the fruits of this pending pull
request yourself, and let me know if they solve your problem:

http://cfmlprojects.org/artifacts/com/ortussolutions/commandbox/1.0.0/

Download the version you want (commandbox-1.0.0-win32.zip probably, as I
think there's a bug with the JRE bundled version as far as where it's
looking for the JRE) and give it a go.

You don't have to specify the commandbox_home variable every time
anymore either, theoretically. I tested this with the jar, but not the
EXE, so it would be great to get confirmation-- if you create a file
called "commandbox.properties" (case sensitive) in the same directory as
the EXE, and fill it with this line:

commandbox_home=D:\commandbox

That should have it use that directory as the home every time, without
having to add it to the arguments.

HIH!

:Denny

Jon, sorry for the delay in responding to this. Your message got hung up
in Google's all-knowing spam filter (that cannot be disabled). The default
engine (or any of the engine config) in box.json isn't actually used at
all. We put it there for future use once we support other CFML engines.
For now, it just sits there and looks pretty.

Thanks!

~Brad

*ColdBox Platform Evangelist*
*Ortus Solutions, Corp *

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Weird. I was playing with that setting today on a fresh install and I couldn’t get the server to start with it in the file. I could have sworn it was that setting but maybe it was a port conflict, as I was playing around with both of those settings at the time.

Either way I’m got to play more with Commandbox. My next side project may have to be a Capistrano-esque deploy recipe for it. With that embedded server, and an NGINX proxy in front, you could deploy and scale just about any where, any time. :slight_smile:

You can double check the code if you’re curious about what’s used. Look in the start.cfc command as well as the ServerService. For sure, the defaultPort is used. If you do figure out for sure what was causing the server not to start please put in a ticket so we can try to trap those scenarios and throw an appropriate error. Obviously, no error at all is not idea :slight_smile:

Thanks again for all the extra sets of eyes trying stuff out. This is great!

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Same problem here. I’m on windows 7. If I upgrade to the latest commandbox server does not start…

Please explain the steps you took to “upgrade”.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I simply run “upgrade --latest”

That’s what I was afraid of. The upgrade command only updates the CFML bits, but we have had many recent changes to the underlying libraries.

What you need to do is completely blow away the .CommandBox folder under your user directory, download a new binary and it will reinstall itself the first time you run it.

We’re working right now on a way to improve this process in a couple different ways:

  • Upgrade command will tell you when a new binary is needed
  • New binaries will automatically self-extract the first time you run them.
    We hope to have this done by the time we release next week #fingerscrossed :slight_smile:

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I have followed your suggestion brad and now server start normally. Thanks.

@denstar I have tried to create the commandbox.properties file and use it with the exe, without success. The first time I run box.exe it will extract all files and foled in the path “E:\CommandBox”, but when i try to start again box.exe it try to create a CommandBox folder inside my path.

The commandbox.properties is:

`
CommandBox_home=E:\CommandBox

`