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

when started with --repair mongod should not try to bind to a port

    • Fully Compatible
    • ALL
    • v4.0
    • Platforms 2018-08-27, Platforms 2018-09-10, Platforms 2018-09-24

      Currently, when started with --repair mongod will exit after attempting to repair the data files, but it still tries to bind to a port:

      mongod --repair --dbpath /data/test
      2017-04-26T16:25:53.745-0400 I CONTROL  [initandlisten] MongoDB starting : pid=4805 port=27017 dbpath=/data/test 64-bit host=Asyas-MacBook-Pro.local
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] db version v3.5.6
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] git version: 6408dcd1b5f4fa1747fa2acac50b8cd004343ca7
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] allocator: system
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] modules: none
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] build environment:
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten]     distarch: x86_64
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten]     target_arch: x86_64
      2017-04-26T16:25:53.746-0400 I CONTROL  [initandlisten] options: { repair: true, storage: { dbPath: "/data/test" } }
      2017-04-26T16:25:53.746-0400 E NETWORK  [initandlisten] listen(): bind() failed Address already in use for socket:
      2017-04-26T16:25:53.746-0400 E NETWORK  [initandlisten]   addr already in use
      2017-04-26T16:25:53.746-0400 E NETWORK  [initandlisten] Failed to set up sockets during startup.
      2017-04-26T16:25:53.746-0400 E STORAGE  [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
      2017-04-26T16:25:53.746-0400 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
      2017-04-26T16:25:53.747-0400 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
      2017-04-26T16:25:53.747-0400 I CONTROL  [initandlisten] now exiting
      2017-04-26T16:25:53.747-0400 I CONTROL  [initandlisten] shutting down with code:48

      This happens with all storage engines.

      After --repair mongod will shut down so it doesn't make sense that it should need to listen to a port since it won't accept any connections anyway.

            annie.black@mongodb.com Annie Black
            asya.kamsky@mongodb.com Asya Kamsky
            0 Vote for this issue
            9 Start watching this issue