question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lack of mongo resilience after unplanned shutdown.

See original GitHub issue

Using stable Docker and latest docker-compose, my laptop overheated and emergency shut down kicked in due to reasons unrelated to wekan. After cooling down and powering back on, the containers started without error messages, but with an unclean shutdown warning from mongo. The boards were usable, but login was not, I was getting “Login Forbidden”.

After some research (four hours divided in multiple days), I found the solution in Stack Overflow, apparently mongo doesn’t self-repair when starting unless it has journaling enabled. I do not know how to enable journaling in mongo, but a docker-compose down; docker-compose run wekandb mongod --repair; docker-compose up fixed my issues.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ofekpcommented, Sep 24, 2018

For anyone interested, this is how I go about doing it:

version: "2"
services:
  mongo:
    container_name: mongo
    restart: on-failure:10
    image: mongo
    environment:
      - MONGO_INITDB_ROOT_USERNAME=<dbuser>
      - MONGO_INITDB_ROOT_PASSWORD=<dbpass>
      - MONGO_INITDB_DATABASE=db
    volumes:
      - ./data:/data/db
    ports:
      - "27017:27017"
    command: bash -c "mongod --repair && mongod"

mongod --repair will repair the issue with the lock file, then mongod will start mongo regularly, this is needed since the repair also shuts down mongo.

This way I do not change the docker-compose up command to start my service.

1reaction
xet7commented, Sep 24, 2018

@ofekp

Thanks! I added to wiki link to this post. https://github.com/wekan/wekan/wiki#Repair

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recover a Standalone after an Unexpected Shutdown
Starting in MongoDB 4.4, for the WiredTiger storage engine, mongod --repair : Rebuilds all indexes for collections with one or more inconsistent indexes....
Read more >
Cannot restart or repair mongodb database after the crash ...
Your database is actually remarkably resilient. Left to its own devices (and all other things being equal) it will recover from a server ......
Read more >
Repair MongoDB after an Unclean Shutdown - Cisco
This document describes how to repair the MongoDB on the Secure Network Analytics (formerly Stealthwatch) Manager appliance after an unclean ...
Read more >
MongoDB Replication: A Complete Introduction - BMC Software
Replica set elections · Loss of connectivity to the primary node (detected by heartbeats) · Initializing a replica set · Adding a new...
Read more >
Weathering the Unexpected - ACM Queue
Failures happen, and resilience drills help organizations prepare for ... DiRT has caused accidental outages and in some cases revenue loss.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found