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

Customizable libmongoc driver version #114

Open
baumgold opened this issue Nov 18, 2023 · 3 comments
Open

Customizable libmongoc driver version #114

baumgold opened this issue Nov 18, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@baumgold
Copy link

baumgold commented Nov 18, 2023

Upon the recent release of MongoC_jll.jl v1.25.1+1 (a major version bump) my client code that uses Mongoc.jl automatically picked up the new MongoC_jll.jl (as expected). However this caused my previously working code to break with the following error:

ERROR: LoadError: BSONError: domain=3, code=15, message=Server at mongo-server:27017 reports wire version 4, but this version of libmongoc requires at least 6 (MongoDB 3.6)
Stacktrace:
  [1] _iterate(cursor::Mongoc.Cursor{Mongoc.Collection}, state::Nothing)
    @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:690
  [2] iterate (repeats 2 times)
    @ ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:698 [inlined]
  [3] iterate
    @ ./generator.jl:44 [inlined]

How can I explicitly specify the libmongoc driver version that I want to use in my client code? Suggestions appreciated.

@baumgold baumgold changed the title Customizable mongo driver version Customizable libmongoc driver version Nov 18, 2023
@felipenoris
Copy link
Owner

@baumgold thanks for reporting this! This is really bad, actually.

As a workaround, you can add this to the [compat] section of your Project.toml file to use the previous version for the driver:

MongoC_jll = "=1.19.1"

Can you give more detail on your error? (code example, mongodb server version, operating system, Julia version).

@felipenoris felipenoris added the bug Something isn't working label Nov 18, 2023
@baumgold
Copy link
Author

baumgold commented Nov 18, 2023

Using Mongoc v0.9.0 and MongoC_jll v1.25.1+0:

julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 48 × Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
  Threads: 4 on 48 virtual cores
Environment:
  JULIA_NUM_THREADS = 4

julia> using Mongoc

julia> client = Mongoc.Client("mongo-hedge-solicitor-prod", 27017)

julia> Mongoc.find_one(client["hedge-solicitor"]["hedge-notifications"])
ERROR: BSONError: domain=3, code=15, message=Server at mongo-hedge-solicitor-prod:27017 reports wire version 4, but this version of libmongoc requires at least 6 (MongoDB 3.6)
Stacktrace:
 [1] _iterate(cursor::Mongoc.Cursor{Mongoc.Collection}, state::Nothing)
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:690
 [2] _iterate
   @ ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:680 [inlined]
 [3] #find_one#62
   @ ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:332 [inlined]
 [4] find_one
   @ ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:327 [inlined]
 [5] find_one(collection::Mongoc.Collection)
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:327
 [6] top-level scope
   @ REPL[3]:1

julia> Mongoc.get_server_mongodb_version(client)
ERROR: BSONError: domain=3, code=15, message=Server at mongo-hedge-solicitor-prod:27017 reports wire version 4, but this version of libmongoc requires at least 6 (MongoDB 3.6)
Stacktrace:
 [1] command_simple
   @ ~/.julia/packages/Mongoc/tJNDW/src/database.jl:33 [inlined]
 [2] get_server_mongodb_version(client::Mongoc.Client{Nothing})
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/client.jl:79
 [3] top-level scope
   @ REPL[8]:1

After downgrading MongoC_jll to v1.19.1+0:

julia> using Mongoc

julia> Mongoc.get_server_mongodb_version(Mongoc.Client("mongo-hedge-solicitor-prod", 27017))
v"3.2.22"

@baumgold
Copy link
Author

@felipenoris - anything I can do to help here? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants