Description of problem: https://issues.jboss.org/browse/WFLY-2305 Running add-user.sh in silent mode and redirecting the output to a file results in an exception: Exception in thread "main" java.lang.IllegalStateException: JBAS015232: No java.io.Console available to interact with user. How reproducible: always Steps to Reproduce: [tom@orac bin]$ ./add-user.sh --silent=true foo bar > /tmp/capture.log 2>&1 [tom@orac bin]$ cat /tmp/capture.log Exception in thread "main" java.lang.IllegalStateException: JBAS015232: No java.io.Console available to interact with user. at org.jboss.as.domain.management.security.adduser.AddUser.<init>(AddUser.java:101) at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:222) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.modules.Module.run(Module.java:292) at org.jboss.modules.Main.main(Main.java:455)
Darran Lofthouse <darran.lofthouse> updated the status of jira WFLY-2305 to Coding In Progress
Darran Lofthouse <darran.lofthouse> made a comment on jira WFLY-2305 The actual problem here is that --silent=true is not a valid argument, the valid argument is --silent {noformat} [darranl@localhost bin]$ ./add-user.sh --help Usage: ./add-user.sh [args...] where args include: -a If set add an application user instead of a management user -dc <value> Define the location of the domain config directory. -sc <value> Define the location the server config directory. -up, --user-properties <value> The file name of the user properties file which can be an absolute path. -g, --group <value> Comma-separated list of groups for the user. -gp, --group-properties <value> The file name of the group properties file which can be an absolute path. (If group properties is specified then user properties MUST also be specified). -p, --password <value> Password of the user. Should not be same as the username -u, --user <value> Name of the user -r, --realm <value> Name of the realm used to secure the management interfaces (default is "ManagementRealm") -s, --silent Activate the silent mode (no output to the console) -e, --enable Activate the silent mode (no output to the console) -d, --disable Activate the silent mode (no output to the console) -cw, --confirm-warning Automatically confirm warning in interactive mode -h, --help Display this message and exit {noformat} I will add unofficial support for an argument --silent=true.
Proposing we make a change here as it is a tiny fix to address a usability issue. The real issue is that the end user is entering the wrong command and is not setting silent mode as they expect, however a couple of users have been caught by this so adding support for the approach users are using to set silent mode.
Add-user script now supports --silent=true argument. We should update help message for the script and documentation as well, I'll create a BZs for this. Verified on EAP 6.2.0.ER7.
Please DO NOT document --silent=true as a valid option. The only reason for adding support for this option is users are not reading the current help text showing the valid options and are then getting caught out when they use an invalid form of this option - for that reason we are unofficially accepting it.
Thanks for clarification, I won't create any BZ regarding this than.