Commandbox server loads, but CFMs throw a 500

Just installed a fresh version of CommandBox on Windows 11. Went into a directory, and ran box server start cfengine=adobe@2023. From what I can see in the terminal output, everything ran fine, CF started, and so forth.

My browser opens and I see the list of files in my current directory. But if I run any CFM file, I get a 500 error. Not a CF error, but the browser just reports a 500.

If I run box server log, i see:

[INFO ] Jul 22, 2024 15:39:41 PM Error [XNIO-1 task-1] - Unable to read web.xml
[INFO ] Jul 22, 2024 15:39:41 PM Error [XNIO-1 task-1] - C:\projects\coldfusionstuff\pdf_bb\WEB-INF\cftags The specific sequence of files included or processed is: C:\projects\coldfusionstuff\pdf_bb\test0.cfm''
[ERROR] Exception thrown by error-handling template:
[ERROR] java.io.FileNotFoundException: C:\projects\coldfusionstuff\pdf_bb\WEB-INF\cftags

I can verify that I have a WEB-INFO folder in my current directory, not sure why, and it doesn’t have cftags.

Is that a typo? Or you literally have a WEB-INFO directory instead of WEB-INF?

What directory did you go into?

What are the file permissions on your current directory and the C:\projects\coldfusionstuff\pdf_bb\WEB-INF directory? I could see permissions errors manifesting as a FileNotFoundException.

Yep, WEB-INF, not INFO, tpo on my part.

When I say I went into the directory - I mean I’m currently in that directory when I run box server start. It has a few CFMs. I don’t see anything odd in Windows permissions for the folder. I’ve got no problems making files there and such.

That’s an odd error because it looks like CF is trying to use a WEB-INF folder in the web root, which generally shouldn’t exist for any reason. Unless there is some reason to have that folder, it prolly got created on accident. I’d stop, forget the server, remove that WEB-INF folder from the web root and try starting again. I think the servlet is getting confused about where the WEB-INF folder lives.

I’ve tried that a few times. Will delete it, forget the server, recreate again.

I can see the server home in c:\CommandBox\home\server (with the unique name), and a WEB-INF there.

Right, but is there a web-inf folder in the web root? If so, why? and if you don’t know, then my recommendation is to delete it. (the one in the web root)

I do not know why. I did delete it. Running box server start again recreates it.

Copying this reply from Slack for anyone else following the thread

It would seem something is re-creating the WEB-INF dir, but that’s not a behavior I can say I’ve seen before
I can confirm running

server start cfengine=adobe@2023

in an empty dir does not create a web-inf directory. It would appear it may be related to your configuration or code.
I’m not entirely sure how to track that down to be honest. Maybe just review anything special in a box.json or server.json that could be firing on server start

Would removing permissions or changing ownership on the web-in directory allow the system to throw an error that might isolate where the directory create is happening?

That’s an interesting idea. If you could somehow lock down the web root so the process CF was starting as literally couldn’t write there, it may flush out an error that would pinpoint the code in CF that is trying to write it in the first place. That is, if the code doesn’t try/catch it. Not sure if the juice is worth the squeeze, but it’s a possible way to isolate the behavior.

Not sure how I would do that. If I delete the folder, it gets recreated, and I assume the CLI needs permission to write to create server.json in the folder.

You could start with the --noSaveSettings flag which wouldn’t try to write the JSON.

Tried that, and it did not write server.json, it did write WEB-INF again.

Right, the suggestion was to run a experiment whereby you temporarily set the Windows permissions such that CommandBox literally can’t write to that folder to see if you can force an error.

Eh, not quite sure how to do that. I’m running the CLI, so it’s operating as me I assume - and I’d have permissions to write to the folder. Or - wait - I’ll try removing my own ability to write.

Yeah, the effort may not be worth it. We don’t know for certain if it will create an error, and if it does, whether the error will actually tell us anything. At best, it probably reveals a portion of the ACF code that we would need need to go ask the Adobe engineers to look at for us, lol.

Removed my ability to write to the folder. Reran box and it gave no errors, nor did it write to WEB-INF. Same error. It still believes it should load WEB-INF from the webfolder, not the server folder.

Did a complete uninstall/reinstall, same behavior.

Dang-- whatever code is writing those folders must be using try/catch so it just ignores the errors.

You may have to reach out to Adobe’s support and ask them what sort of configuration mishap would lead to Adobe behaving like this.