[SERVER-16543] Wrong error message for net.http.port Created: 13/Dec/14  Updated: 10/Jan/15  Resolved: 15/Dec/14

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: 2.8.0-rc2
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Alexander Komyagin Assignee: Matt Kangas
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-13097 Support changing http interface port ... Closed
Operating System: ALL
Participants:

 Description   

Don't ask me why I tried it, but if I specify the net.http.port in my yaml config, I get the "Expected boolean switch but found string: 20001 for option: net.http.port" on startup.

AD-MAC10G:fffx alexander$ cat config.yaml
net:
  http:
    RESTInterfaceEnabled: true
    enabled: true
    port: 22222
operationProfiling:
  mode: slowOp
processManagement:
  fork: true
replication:
  replSetName: rs0
setParameter:
  internalQueryExecMaxBlockingSortBytes: 1073741824
storage:
  dbPath: /tmp/fffx/db
  engine: wiredtiger
  journal:
    enabled: true
systemLog:
  destination: file
  logAppend: true
  path: /tmp/fffx/log
AD-MAC10G:fffx alexander$ mongod -f config.yaml --cpu true
Expected boolean switch but found string: 20001 for option: net.http.port
try 'mongod --help' for more information

According to the source, the error should've been different:

        // Check options that are not yet supported
        if (params.count("net.http.port")) {
            return Status(ErrorCodes::BadValue,
                          "The net.http.port option is not currently supported");
        }



 Comments   
Comment by Matt Kangas [ 15/Dec/14 ]

The reason you saw this error message with the current incomplete code: it's defined as type "moe::Switch" and Switch is identical to "Bool" except it accepts no value on the command line.

https://github.com/mongodb/mongo/blame/r2.8.0-rc2/src/mongo/db/server_options_helpers.cpp#L255-L257
https://github.com/mongodb/mongo/blame/r2.8.0-rc2/src/mongo/util/options_parser/option_description.h#L44-L45

Duplicates SERVER-13097 (net.http.port is not implemented).

Generated at Thu Feb 08 03:41:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.