Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongodb "--version" output changed in 4.3 or 4.4 #487

Closed
mlev opened this issue Jun 25, 2021 · 8 comments
Closed

Mongodb "--version" output changed in 4.3 or 4.4 #487

mlev opened this issue Jun 25, 2021 · 8 comments
Labels
bug released on @beta released Pull Request released | Issue is fixed
Milestone

Comments

@mlev
Copy link
Contributor

mlev commented Jun 25, 2021

Version: 7.0.0-beta-46
Mongo version: v4.4.4
Node verson: 14.15.5

When using a pre-installed system binary and passing MONGOMS_SYSTEM_BINARY - the version isn't parsed. In the past this only caused a warning but new versions of the beta throw the error Couldnt find an version from system binary output! so my tests fail.

On my system the version command returns this format:

root@bc5c9e6eb7c6:/home/node# /usr/local/bin/mongod --version
db version v4.4.4
Build Info: {
    "version": "4.4.4",
    "gitVersion": "8db30a63db1a9d84bdcad0c83369623f708e0397",
    "openSSLVersion": "OpenSSL 1.1.0l  10 Sep 2019",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "debian92",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

The problem seems to be this line:

const spawnOutput = spawnSync(binaryPath, ['--version'])

For me this command spawnSync(binaryPath, ['--version']).toString() produces [object Object] which is why the regex fails to match the value.
To get the actual output I need to run spawnSync(binaryPath, ['--version']).stdout.toString() instead.

@mlev mlev changed the title System binary version not parsed correctly with Mongodb 4.4.4 System binary version not parsed correctly Jun 25, 2021
@hasezoey hasezoey added bug has repro script This issue has an reproduce script labels Jun 25, 2021
@hasezoey hasezoey added this to the 7.0 milestone Jun 25, 2021
@hasezoey
Copy link
Collaborator

For me this command spawnSync(binaryPath, ['--version']).toString() produces [object Object] which is why the regex fails to match the value.

this is because its probably logged wrong


it seems like for 4.3 or 4.4 the output of --version changed:

Command Output
$ ./mongod-x64-ubuntu-4.0.20 --version
db version v4.0.20
git version: e2416422da84a0b63cde2397d60b521758b56d1b
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64

$ ./mongod-x64-ubuntu-4.2.10 --version
db version v4.2.10
git version: 88276238fa97b47c0ef14362b343c5317ecbd739
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64

$ ./mongod-x64-ubuntu-4.4.1 --version
db version v4.4.1
Build Info: {
    "version": "4.4.1",
    "gitVersion": "ad91a93a5a31e175f5cbf8c69561e788bbc55ce1",
    "openSSLVersion": "OpenSSL 1.1.1f  31 Mar 2020",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu2004",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

@hasezoey hasezoey changed the title System binary version not parsed correctly Mongodb "--version" output changed in 4.3 or 4.4 Jun 25, 2021
@hasezoey hasezoey removed the has repro script This issue has an reproduce script label Jun 25, 2021
@hasezoey
Copy link
Collaborator

actually, i cannot reproduce i, what system are you trying to run this on?

(i will still change to the suggested .stdout)

@mlev
Copy link
Contributor Author

mlev commented Jun 25, 2021

Yeah I'm a bit surprised I'm the first to see this. I'm running this in a docker image built from the official node:14 image. This is the entirety of the docker build.

FROM node:14

ARG MONGO_RELEASE=mongodb-linux-x86_64-debian92-4.4.4
RUN wget --no-check-certificate https://fastdl.mongodb.org/linux/$MONGO_RELEASE.tgz
RUN tar --directory /usr/local/bin -xzvf $MONGO_RELEASE.tgz --strip-components=2 $MONGO_RELEASE/bin/mongod
RUN rm $MONGO_RELEASE.tgz

@hasezoey
Copy link
Collaborator

d8d6749 implements the mentioned .stdout, will be in 7.0.0-beta.47 after the build finished

@github-actions
Copy link

🎉 This issue has been resolved in version 7.0.0-beta.47 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mlev
Copy link
Contributor Author

mlev commented Jun 25, 2021

Great thanks!

@hasezoey
Copy link
Collaborator

hasezoey commented Jul 1, 2021

closing, because included in 7.0.0-beta.47

@hasezoey hasezoey closed this as completed Jul 1, 2021
@github-actions
Copy link

github-actions bot commented Jul 1, 2021

@github-actions github-actions bot added the released Pull Request released | Issue is fixed label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug released on @beta released Pull Request released | Issue is fixed
Projects
None yet
Development

No branches or pull requests

2 participants