and a .custom.env file used in server.json in dotenvFile key
server.name = test-dotenv
server.port = 6062
server.profile = development
if I start the server the CLI remains blocked starting the server…
I have to kill the terminal.
It doesn’t happen if I remove the “dotenvFile” key and use the default env file name (“.env”)
if I had previously started a server inside this folder (without specifying “dotenvFile” in server.json).
The CLI gets freeze, it doesn’t install any servers inside $user/.CommandBox/server
and I can’t find any log files to understand the error.
There is nothing significant in $user/.CommandBox/logs/commandbox.log.
I assume you have ripped a hole in the fabric of the space time continuum by creating an endless loop. It always gets very tricky when you try to use information stored in the server.json to affect the values of the server.json itself due to the chicken-egg problems.
Glancing at the dotenv code, I don’t see the issue right off, but you can get a stack trace of what the CLI is doing with the jstack -l <pid> command (jstack comes with a JDK). You can also tie FusionReactor to the CLI to monitor what’s happening.
Yes, the dot env file can be a comma-delimited list of file globbing patterns. It would seem you’ve hit some sort of endless loop inside of the Globber library actually. I’d have to see what the actual file path was that’s being processed.
Also note, any server default dotenvfile settings will be added into the mix. It doesn’t appear that there is any logging in the dotenv module that shows the paths pre-globbing.
So in theory, .custom.env in the server.json should turn into /absolute/path/to/webroot/.custom.env which should be pretty cut and dried and wouldn’t be any different than running the following command in CommandBox:
To debug, I’d dump out the serverEnvFile variable to the screen prior to this line
I replicated the same function from line 56, step by step:
//I tried to remove the double slashes but the problem persists.
//add pattern to Globber...
//get pattern just entered
//result:  (yes, empty)
//this get an error: "Cannot glob empty patter eith no base directory"
//restart with original code from here:
variables.wirebox.getInstance( "Globber" )
I’m not quite sure what you are trying to do with your test code, but every time you run getInstance(), you are getting a brand new fresh Globber instance as it is not a singleton. This is why it appear you cannot set the pattern as you are looking for it in a totally separate CFC instance than the one you set it into.