Audit Plugin on Ubuntu: CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/path" : exit status 1 We use MongoDB 3.2.11 and try to enable Audit.


  New in version 2.6.
  
  MongoDB Enterprise includes an auditing capability for mongod and
  mongos instances. The auditing facility allows administrators and
  users to track system activity for deployments with multiple users and
  applications.


This is our startup configuration mongodb.conf

auditLog:
  destination: file
  filter: '{ atype: { $in: [ "createCollection", "dropCollection", "createDatabase",
    "createIndex", "renameCollection", "dropDatabase", "dropIndex", "createUser",
    "dropUser", "dropAllUsersFromDatabase", "updateUser", "grantRolesToUser", "revokeRolesFromUser",
    "createRole", "updateRole", "dropRole", "dropAllRolesFromDatabase", "grantRolesToRole",
    "revokeRolesFromRole", "grantPrivilegesToRole", "revokePrivilegesFromRole", "enableSharding",
    "shardCollection", "addShard", "removeShard", "shutdown", "applicationMessage",
    "authCheck" ] } }'
  format: BSON
  path: /opt/mongouser/store/mongodb-audit
net:
  port: 27000
operationProfiling: {}
processManagement:
  fork: "true"
replication:
  replSetName: rs-testname
security:
  authorization: enabled
  keyFile: /opt/mongouser/store/auto-mms/keyfile
storage:
  dbPath: /opt/mongouser/store/mongodb-data/rs-testname_1
  directoryPerDB: true
  engine: wiredTiger
  wiredTiger:
    engineConfig:
      directoryForIndexes: true
systemLog:
  destination: file
  path: /opt/mongouser/store/mongodb-data/rs-testname_1/mongodb.log


mongodb.log (the only entry). Here the strace output with startup.

2017-02-23T16:20:54.430+0000 F CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/opt/mongouser/store/mongodb-audit/"
 : exit status 1


Output (stdout/stderr): 

about to fork child process, waiting until server is ready for connections.
forked process: 56468
ERROR: child process failed, exited with error number 1


directory perms. The data dir and audit dir have the same permissions. The data dir works.

 # ls -ald mongodb-*
drwxrwxrwx 2 mongouser mongouser   17 Feb 23 16:19 mongodb-audit
drwxrwxrwx 3 mongouser mongouser   37 Dec  7 11:14 mongodb-data
drwxr-xr-x 6 mongouser mongouser 4096 Dec  7 11:24 auto-mms


I added maximum verbosity and there is still only one line in mongodb.log

systemLog:
  destination: file
  path: /path/mongodb.log
  verbosity: 5


about the Linux box. With a search engine you find similar errors only for Windows based Systems.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"


any idea what's wrong?
You can give it a try using the following changes (without the trailing /):

path: /opt/mongouser/store/mongodb-audit


instead of:

path: /opt/mongouser/store/mongodb-audit/