rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.89k stars 403 forks source link

Version detection fails without diagnostics #867

Closed p-mongo closed 2 years ago

p-mongo commented 2 years ago

When mlaunch tries to figure out mongod's version, if this operation fails, no diagnostics is provided and mlaunch just says that it failed.

Code in question: https://github.com/rueckstiess/mtools/blob/develop/mtools/mlaunch/mlaunch.py#L147

Expected behavior

E.g.

Failed to launch mongod: [Errno 2] No such file or directory: 'mongod'

Actual/current behavior

Failed to launch mongod

This is doubly confusing because the deployment actually starts:

Running mlaunch --replicaset --name ruby-driver-rs --auth --username dev --password dev --dir /mnt/zram/mongodb/4.0-rs-auth --setParameter diagnosticDataCollectionEnabled=false --wiredTigerCacheSizeGB 0.25 --setParameter honorSystemUmask=true --networkMessageCompressors snappy,zlib --setParameter enableTestCommands=1 --filePermissions 0666 --binarypath /usr/local/m/v
ersions/4.0 --port 27150                                                                                                   
Failed to launch mongod                                                                                                    
Generating keyfile: /mnt/zram/mongodb/4.0-rs-auth/keyfile                                                                  
launching: "/usr/local/m/versions/4.0/mongod" on port 27150                                                                
launching: "/usr/local/m/versions/4.0/mongod" on port 27151                                                                
launching: "/usr/local/m/versions/4.0/mongod" on port 27152                                                                
replica set 'ruby-driver-rs' initialized.                                           

Steps to reproduce the actual/current behavior

Run mlaunch without there being a global mongod

Environment

Software Version
mtools develop
Python 3.10
MongoDB server
Operating system Debian
p-mongo commented 2 years ago

I applied https://github.com/p-mongodb/mtools-legacy/commit/4cddb86d76453d39943ecaffb173055eed7d08c6 to repair this in mtools-legacy.

stennie commented 2 years ago

Fixed via b8677a0. Thanks @p-mongo !