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

[destination-mongodb] Format specifier exception when connecting to MongoDB destination #49829

Open
1 task
shybovycha opened this issue Dec 17, 2024 · 2 comments
Labels
area/connectors Connector related issues community connectors/destination/mongodb team/destinations Destinations team's backlog type/bug Something isn't working

Comments

@shybovycha
Copy link

shybovycha commented Dec 17, 2024

Connector Name

destination-mongodb

Connector Version

1.5.12

What step the error happened?

Configuring a new connector

Relevant information

When setting up the source connector for MongoDB and pointing it to my local instance running on Docker, I get an error "Configuration check failed"

I have tried various combinations of credentials, auth methods, instance type (replica set vs standalone) but it all seems to fall into the same code path.

Relevant log output

2024-12-17 05:01:27,017 [main]  ERROR   i.a.w.i.VersionedAirbyteStreamFactory(internalLog):310 - ERROR i.a.i.d.m.MongodbDestination(check):85 Check failed. java.util.MissingFormatArgumentException: Format specifier '%s'
        at java.util.Formatter.format(Formatter.java:2688) ~[?:?]
        at java.util.Formatter.format(Formatter.java:2625) ~[?:?]
        at java.lang.String.format(String.java:4143) ~[?:?]
        at io.airbyte.integrations.destination.mongodb.MongodbDestination.buildConnectionString(MongodbDestination.java:174) ~[io.airbyte.airbyte-integrations.connectors-destination-mongodb-24.0.2.jar:?]
        at io.airbyte.integrations.destination.mongodb.MongodbDestination.getConnectionString(MongodbDestination.java:150) ~[io.airbyte.airbyte-integrations.connectors-destination-mongodb-24.0.2.jar:?]
        at io.airbyte.integrations.destination.mongodb.MongodbDestination.getDatabase(MongodbDestination.java:136) ~[io.airbyte.airbyte-integrations.connectors-destination-mongodb-24.0.2.jar:?]
        at io.airbyte.integrations.destination.mongodb.MongodbDestination.check(MongodbDestination.java:71) ~[io.airbyte.airbyte-integrations.connectors-destination-mongodb-24.0.2.jar:?]
        at io.airbyte.integrations.base.ssh.SshTunnel.sshWrap(SshTunnel.java:270) ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]
        at io.airbyte.integrations.base.ssh.SshWrappedDestination.check(SshWrappedDestination.java:67) ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]
        at io.airbyte.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:124) ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]
        at io.airbyte.integrations.base.IntegrationRunner.run(IntegrationRunner.java:99) ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]
        at io.airbyte.integrations.destination.mongodb.MongodbDestination.main(MongodbDestination.java:64) ~[io.airbyte.airbyte-integrations.connectors-destination-mongodb-24.0.2.jar:?]

Contribute

  • Yes, I want to contribute
@marcosmarxm
Copy link
Member

Hello @shybovycha can you share the format of host and configs you're using to access the local Mongo instance?

@shybovycha
Copy link
Author

shybovycha commented Jan 15, 2025

The format of host - as in the type of deployment? It is a local 2-node replica set, running in Docker. Pretty much just following the tutorial to set up the replica set. Or what I mentioned in #49934 :

$ docker run -d --rm -p 27017:27017 -v ${PWD}:/home --name mongo1 mongodb/mongodb-community-server mongod --replSet myReplicaSet --tlsMode allowTLS --tlsCertificateKeyFile /home/test-server1.pem --tlsCAFile /home/test-ca.pem --bind_ip_all

$ docker run -d --rm -p 27018:27017 -v ${PWD}:/home --name mongo1 mongodb/mongodb-community-server mongod --replSet myReplicaSet --tlsMode allowTLS --tlsCertificateKeyFile /home/test-server1.pem --tlsCAFile /home/test-ca.pem --bind_ip_all

$  docker exec -it mongo1 mongosh --eval "rs.initiate({ _id: \"myReplicaSet\", members: [ {_id: 0, host: \"host.docker.internal:27017\"}, {_id: 1, host: \"host.docker.internal:27018\"} ] })"

For TLS, I followed this tutorial and the docs to generate TLS certificates and set up TLS for the replica set, correspondingly.

Here is my job config in Airbyte:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues community connectors/destination/mongodb team/destinations Destinations team's backlog type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants