Mongod fails after start in Satellite6 with "invalid file index requested" error

Solution Verified - Updated

Environment

Red Hat Satellite 6

Issue

  • After a maintenance activity involving services restart or system reboot, mongod service fails to be running, keeping to segfault a short time after the service (re)start.
  • the error message contains invalid file index requested with some random number not related to anything known

Resolution

Ensure integrity of DB files under /var/lib/mongod directory. This includes file ownership and permissions, SELinux context and possibly gzipped file.

For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 2.0 Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 2.0-related Issues

Root Cause

A database file was gzipped due to a mistake. Another possible cause could be wrong file ownership or permissions or SELinux context, which all of them can cause mongod does not access an expected file and raises the mentioned error.

Diagnostic Steps

/var/log/messages contains error like:

2021-06-28T13:32:20.329-0600 I STORAGE  [initandlisten] _getOpenFile() invalid file index requested 47
2021-06-28T13:32:20.329-0600 I -        [initandlisten] Invariant failure false src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp 207
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.