Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46932

Shell produces json output

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc7, 4.7.0
    • Affects Version/s: 4.3.4
    • Component/s: Shell
    • None
    • Minor Change
    • ALL
    • v4.4
    • Service arch 2020-05-04, Service arch 2020-05-18, Service arch 2020-06-01

      When I use 4.3.4 shell to connect to 4.0.16 server I see this in the console:

      carbon% mongo --port 14020
      {"t":{"$date":"2020-03-18T04:10:34.705Z"},"s":"I", "c":"NETWORK", "id":23014,"ctx":"main","msg":"{foStatus_reason}","attr":{"foStatus_reason":"TCP FastOpen support requested, but disabled in kernel. Set /proc/sys/net/ipv4/tcp_fastopen to 3"}}
      MongoDB shell version v4.3.4
      connecting to: mongodb://127.0.0.1:14020/?compressors=disabled&gssapiServiceName=mongodb
      Implicit session: session { "id" : UUID("4f9892ef-1bf7-4416-9e6a-b97f311fa161") }
      MongoDB server version: 4.0.16
      WARNING: shell and server versions do not match
      Server has startup warnings: 
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] 
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] 
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
      2020-03-18T00:10:26.404-0400 I CONTROL  [initandlisten] 
      

      The first line of the output, I presume, comes from the shell:

      {"t":{"$date":"2020-03-18T04:10:34.705Z"},"s":"I", "c":"NETWORK", "id":23014,"ctx":"main","msg":"{foStatus_reason}","attr":{"foStatus_reason":"TCP FastOpen support requested, but disabled in kernel. Set /proc/sys/net/ipv4/tcp_fastopen to 3"}}
      MongoDB shell version v4.3.4
      connecting to: mongodb://127.0.0.1:14020/?compressors=disabled&gssapiServiceName=mongodb
      Implicit session: session { "id" : UUID("4f9892ef-1bf7-4416-9e6a-b97f311fa161") }
      

      It is my understanding that the shell is meant to primarily be used by humans rather than be driven by software (the software generally will use a driver rather than the shell). Therefore my expected behavior is:

      As a user of the shell, I expect the shell to produce its output in a format that is easily human-readable.

      While it is certainly possible for a human to read json server logs, I do not consider them to be in a format that is easy for a human to read (I listed why I do not consider json logs to be easy to read in https://jira.mongodb.org/browse/SERVER-46911).

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: