bHello! Everything was fine on my PC (I use Julia 1.8) but I needed to deploy the app in a container and could not find the official 1.8 image so I installed 1.9.
The problem appeared with Mongoc package. I have the same versions in PC and container but errors were like
mongoc_collection_find_with_opts (collection couldn’t be NULL) for Mongoc.find
mongoc_collection_count_documents (call couldn’t be NULL) for Mongoc.count_documents
etc
It seems that package Mongoc is only a wrapper for libmongoc (Mongo C driver). I use Windows so how I can check the version of this driver in Windows and put it in my docker file for Debian, it’s a nonsense error that occurs even if I wrap Mongoc.find with try-catch handling…
Or maybe the problem is in Julia versions?
for example, simple function is_presented even with try-catch
function is_presented(storage::MongoStorage, symbolname)
result = true
try
bson_filter = Mongoc.BSON("symbol" => symbolname)
result = Mongoc.count_documents(storage.common_data, bson_filter) > 0
catch e
println(e)
result = true
end
result
end
Get the error
The parameter: coll, in function mongoc_collection_count_documents, cannot be NULL
[42] signal (6.-6): Aborted
in expression starting at none:0
unknown function (ip: 0x7f9524140d3c)
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
mongoc_collection_count_documents at /home/worker/.julia/artifacts/b4eaa7bb890b09ed9a8a26c2b79b8603c581c504/lib/libmongoc-1.0.so (unknown line)
mongoc_collection_count_documents at /home/worker/.julia/packages/Mongoc/tJNDW/src/c_api.jl:618 [inlined]
#count_documents#61 at /home/worker/.julia/packages/Mongoc/tJNDW/src/collection.jl:302 [inlined]
count_documents at /home/worker/.julia/packages/Mongoc/tJNDW/src/collection.jl:297 [inlined]
is_presented at /coinstrategies/history/src/StorageNew.jl:296
The stupidest thing is that 296 line is inside the try-catch
result = Mongoc.count_documents(storage.common_data, bson_filter) > 0
And it always work perfectly it is one one-liner function… Was… Than I wrap it with try-catch - no reaction. All warkers were aborted and app died.