Apologies if CommandBox + lucee is off topic for ...
# lucee
d
Apologies if CommandBox + lucee is off topic for this forum. I'd be happy to move the post to a more appropriate forum when I run an export / import without changing the json file CommandBox gives me:
ERROR (6.0.0+00787)
Parameter [pauseTasks] has a value of ["="] which is not of type [boolean].
commands below:
box cfconfig export \
from=/var/lib/tomcat9/lucee-server/ \
to=/tmp/lucee_server_context.json
box cfconfig import \
from = /tmp/lucee_server_context.json  \
to   = /var/lib/tomcat9/lucee-server/
My next move is to look at downgrading Commandbox as I don't recall this issue with 5.n of CommandBox The json does not have a string "`pauseTasks"`
b
Can't say I've seen this
Can you provide a stack trace or error console output?
The pausetasks logic hasn't changed in a while
d
I'm looking at docs for a --debug flag or how to access any logs now..
Attached is log from running the import command with --verbose --debug , not much there.
b
I'm confused-- can't you just capture the actual console output?
d
There isn't any more console output than I've provided.
even with --debug and --verbose
b
Can you take a screenshot
because there HAS to be more console output, lol
I need more to go on than that. A line number. Something
Also, is it the import or the export that errors?
d
it is the import failing on the file I export seconds ago
b
Ahh, ok, so it's on the export. That's interesting.
What version of lucee are you exporting from?
d
• 5.4.4.38
on the export
?
box cfconfig import
b
oh yes, sorry. I misread it.
Ok, I just tried this
Copy code
❯ start cfengine=lucee@5.4.4.38
 √ | Starting Server
   | √ | Installing package [java:openjdk11:lockVersion]
   | √ | Setting site [lucee5.4test] Profile to [development]
   | √ | Loading CFConfig into server
   | √ | Loading FusionReactor
   |   | √ | Installing package [forgebox:fusionreactor@^11.0.0]

❯ echo {} > lucee_server_context.json

❯ cfconfig import from=lucee_server_context.json to=lucee5.4test
Config transferred from C:\sandbox\lucee5.4test\lucee_server_context.json!

❯ server info property=serverHomeDirectory
C:/Users/brad/.CommandBox/server/2CAB2C33D1C62C3F95C8312A250A83C9-lucee5.4test/lucee-5.4.4.38

❯ cfconfig import from=lucee_server_context.json to=C:/Users/brad/.CommandBox/server/2CAB2C33D1C62C3F95C8312A250A83C9-lucee5.4test/lucee-5.4.4.38/WEB-INF/lucee-server
Config transferred from C:\sandbox\lucee5.4test\lucee_server_context.json!
I can't reproduce the error importing a JSON file into Lucee 5.4.4
d
interestingly on another host with different config but the same versions of tomcat/lucee/JRE/ubuntu I get the same error> I don't get the error dump/loading from inside a more complicated script that does stuff like stop tomcat and encrypts the dump files. I'm working on narrowing down the difference to a bash script
I am not using cfengine , just lucee/tomcat
b
It doesn't really matter
At the end of the day, CFConfig just writes to XML files. It doesn't care how they got there
I mimicked a non-CommandBox server in my test here
Copy code
❯ cfconfig import from=lucee_server_context.json to=C:/Users/brad/.CommandBox/server/2CAB2C33D1C62C3F95C8312A250A83C9-lucee5.4test/lucee-5.4.4.38/WEB-INF/lucee-server
Config transferred from C:\sandbox\lucee5.4test\lucee_server_context.json!
By just importing directly a folder on disk
Based on the error, I don't think it's even getting that far
I think it's erroring out before then based on your import data
Can you share your JSON file?
That would give me a lot more to work with instead of just guessing what you're doing
d
I will DM it.
👍 1
box ARGV processing and I apparently aren't getting along. No space between param, the '=' and the value is the key # works sudo box cfconfig import \ from=/tmp/lucee_server_context.json \ to=/var/lib/tomcat9/lucee-server/ # fails with: Parameter [pauseTasks] has a value of ["="] which is not of type [boolean]. sudo box cfconfig import \ from = /tmp/lucee_server_context.json \ to = /var/lib/tomcat9/lucee-server/
b
Glad you found the issue, I hadn't had a chance to test, but it sounds like I wouldn't have been able to reproduce anyway!
So basically what was happening, was CommandBox was "seeing" positional args, not named args.
And if we look at the arguments to the import command
Copy code
Arguments:
                string from (CommandBox server name, server home path, or CFConfig JSON file. Defaults to CommandBox server in CWD.)
                string to (CommandBox server name, server home path, or CFConfig JSON file. Defaults to CommandBox server in CWD.)
                string fromFormat (The format to read from when "from" is a directory. Ex: LuceeServer@5)
                string toFormat (The format to write to when "to" is a directory. Ex: LuceeServer@5)
                boolean pauseTasks = "false" (It set to true, all scheduled tasks will be saved to the "to" server in a "Paused" state)
                string includeList = "" (List of properties to include in transfer. Use * for wildcard. i.e. mailservers,datasources.myDSN,event*)
                string excludeList = "" (List of properties to exclude from transfer. Use * for wildcard. i.e. mailservers,datasources.myDSN,event*)
                struct replace (regex/replacement matches to swap data with env var expansions. i.e. replace:datasources.*.password=DB_PASSWORD)
                string dotenvFile (Absolute path to .env file for replace feature. Empty string turns off feature.)
                boolean append = "false" (Append config to destination instead of overwriting. Datasources, caches, etc will be merged instead of removed.)
The
pauseTasks
one is 5th in the list and was getting matched up with one of the
=
signs coming in
So the validation was correcft, it just wasn't clear that the args weren't coming in as expected
👍 1