Error with go driver for Field Level Encryption

hello, does anyone ever encounter this issue when with FLE, is there anything am I missing?

mongo-fle go run --tags cse .
# go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt
/home/al/go/pkg/mod/go.mongodb.org/mongo-driver@v1.6.0/x/mongo/driver/mongocrypt/mongocrypt.go:134:11: could not determine kind of name for C.mongocrypt_ctx_setopt_key_encryption_key
/home/al/go/pkg/mod/go.mongodb.org/mongo-driver@v1.6.0/x/mongo/driver/mongocrypt/mongocrypt.go:212:11: could not determine kind of name for C.mongocrypt_setopt_kms_providers

the code: is this field-level-encryption-sandbox/go at master · mongodb-labs/field-level-encryption-sandbox (github.com)

Hello @Student_al_St! I believe this is caused by having an older version of libmongocrypt installed. Please upgrade to the latest release of libmongocrypt 1.2.1 by following the installation instructions here.

Sincerely,
Kevin

@Kevin_Albertson than the Ubuntu apt upstream is outdated for xenial and there is no client for Focal.

EDIT: I got it working. I will share to solution sometime later next week of so.

1 Like

Hello, I’m having a similar issue. What was your solution?

@Student_al_St can you post your solution? We’re running into the same issue.

@Eric_Swann @Mason_Terry If you’re still working on this, here’s what I did to fix it:

The libmongocrypt README on github (GitHub - mongodb/libmongocrypt: Required C library for Client Side and Queryable Encryption in MongoDB) references version 1.0 of the libmongocrypt library. You need to bump this to 1.3 if you’re using the latest go package, otherwise it will complain about functions that aren’t available.

So you would adjust the mongo entry in your sources list (assuming you’re using ubuntu/deb) from:

echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.0 universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list

to

echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.3 universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list

and then an apt update and an apt upgrade

1 Like