elastic connectors has error : cannot import name 'coroutine' from 'asyncio'

i using elastic connectors to mongodb with docker, when i run then elastic connectors show error like this

this is config.yml

connectors:
-
  connector_id: "id_here"
  service_type: "mongodb"
  api_key: "key_in_here"
  
elasticsearch:
  ca_certs: "/config/certs/ca/ca.crt"  
  host: "https://es01:9200"
  api_key: "key_in_here"
 
sources:
  mongodb: connectors.sources.mongo:MongoDataSource

is this problem when connectors is try connect to mongodb ?

Hi @trunglh88, thanks for your post!

Your issue doesn't seem to be a connection to mongodb problem. For some reason the library we use for mongodb (AsyncIOMotorClient) doesn't seem to be working when the connector begins running.

I took a look and I was able to replicate it myself by trying to run the 8.12.1.0 docker with mongodb as the source choice. It appears to be a bug! I'm sorry you've encountered that.

It appears to have been introduced in 8.12, so if you run an 8.11 stack it shouldn't occur.
Alternatively, you can try and manually build the docker image with a 3.10 version of python. The breaking changes were implemented here so if you rebuild the docker image with the old dockerfile, this shouldn't occur anymore. Here are the steps for manually building and running a dockerfile.

We'll discuss on the team how to fix this going forward and I'll update you once there's a functioning 8.12+ mongodb docker image available.

2 Likes

I saw your github issue on the connectors repo so I've left a response there as well.

i will try with 8.11 stack.
thanks you.

@trunglh88 you're welcome, thanks for flagging the issue for us!

The 8.12.1.1 docker image was built last night and includes the fix for this. I tried running it locally and this specific issue is resolved. So if you'd like to use 8.12 again, there is also that option.