Unifi controller container can't start mongo

After a power outage my unifi controller container starts, but when I try to access the unifi controller web interface, I get a message saying “Unifi controller is starting up” and it just stays there.

I checked the container’s log files and mongod.log give me the following:

2019-07-19T08:32:13.051+0300 I CONTROL  [main] ***** SERVER RESTARTED *****
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] MongoDB starting : pid=1311 port=27117 dbpath=/usr/lib/unifi/data/db 64-bit host=unifi
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] db version v3.4.21
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] git version: ba2e818de44c9a331ce09a624780a2bd841cf6e4
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] allocator: tcmalloc
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] modules: none
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] build environment:
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten]     distmod: ubuntu1604
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten]     distarch: x86_64
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten]     target_arch: x86_64
2019-07-19T08:32:13.054+0300 I CONTROL  [initandlisten] options: { net: { bindIp: "", port: 27117, unixDomainSocket: { pathPrefix: "/usr/lib/unifi/run" } }, storage: { dbPath: "/usr/lib/unifi/data/db" }, systemLog: { destination: "file", logAppend: true, path: "/usr/lib/unifi/logs/mongod.log" } }
2019-07-19T08:32:13.065+0300 I -        [initandlisten] Detected data files in /usr/lib/unifi/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2019-07-19T08:32:13.065+0300 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1461M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),verbose=(recovery_progress),
2019-07-19T08:32:13.066+0300 E STORAGE  [initandlisten] WiredTiger error (11) [1563514333:66219][1311:0x7f4796251d40], wiredtiger_open: /usr/lib/unifi/data/db/WiredTiger.lock: handle-lock: fcntl: Resource temporarily unavailable
2019-07-19T08:32:13.066+0300 E STORAGE  [initandlisten] WiredTiger error (16) [1563514333:66243][1311:0x7f4796251d40], wiredtiger_open: WiredTiger database is already being managed by another process: Device or resource busy
2019-07-19T08:32:13.066+0300 I -        [initandlisten] Assertion: 28595:16: Device or resource busy src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 277
2019-07-19T08:32:13.066+0300 I STORAGE  [initandlisten] exception in initAndListen: 28595 16: Device or resource busy, terminating
2019-07-19T08:32:13.066+0300 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-07-19T08:32:13.066+0300 I NETWORK  [initandlisten] removing socket file: /usr/lib/unifi/run/mongodb-27117.sock
2019-07-19T08:32:13.067+0300 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2019-07-19T08:32:13.067+0300 I CONTROL  [initandlisten] now exiting
2019-07-19T08:32:13.067+0300 I CONTROL  [initandlisten] shutting down with code:100

and it keeps repeating this pattern.
Any idea on how can I fix this issue?


You can ignore this.

I stopped the container, deleted /usr/lib/unifi/data/db/WiredTiger.lock and started the container again.

Problem solved.