airbytehq / airbyte

The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
https://airbyte.com
Other
15.45k stars 3.98k forks source link

[destination-mongodb] Connector unable to connect to locally running mongo #30504

Open tshradheya opened 12 months ago

tshradheya commented 12 months ago

Connector Name

destination-mongodb

Connector Version

0.2.0

What step the error happened?

Configuring a new connector

Revelant information

When trying to connect to local instance, I am getting error that string formatter failed

Attached screenshot of configuration I used

image

Relevant log output

2023-09-16 03:48:41 INFO i.a.w.t.TemporalAttemptExecution(get):124 - Docker volume job log path: /tmp/workspace/8e960dd7-a9b1-4c46-9e4d-657b6a25efbb/0/logs.log
2023-09-16 03:48:41 INFO i.a.w.t.TemporalAttemptExecution(get):129 - Executing worker wrapper. Airbyte version: 0.50.29
2023-09-16 03:48:41 INFO i.a.a.c.AirbyteApiClient(retryWithJitterThrows):290 - Attempt 0 to save workflow id for cancellation
2023-09-16 03:48:41 INFO i.a.c.i.LineGobbler(voidCall):149 - 
2023-09-16 03:48:41 INFO i.a.c.EnvConfigs(getEnvOrDefault):1228 - Using default value for environment variable SIDECAR_KUBE_CPU_LIMIT: '2.0'
2023-09-16 03:48:41 INFO i.a.c.i.LineGobbler(voidCall):149 - ----- START CHECK -----
2023-09-16 03:48:41 INFO i.a.c.i.LineGobbler(voidCall):149 - 
2023-09-16 03:48:41 INFO i.a.c.EnvConfigs(getEnvOrDefault):1228 - Using default value for environment variable SOCAT_KUBE_CPU_LIMIT: '2.0'
2023-09-16 03:48:41 INFO i.a.c.EnvConfigs(getEnvOrDefault):1228 - Using default value for environment variable SIDECAR_KUBE_CPU_REQUEST: '0.1'
2023-09-16 03:48:41 INFO i.a.c.EnvConfigs(getEnvOrDefault):1228 - Using default value for environment variable SOCAT_KUBE_CPU_REQUEST: '0.1'
2023-09-16 03:48:41 INFO i.a.c.EnvConfigs(getEnvOrDefault):1228 - Using default value for environment variable LAUNCHDARKLY_KEY: ''
2023-09-16 03:48:41 INFO i.a.c.i.LineGobbler(voidCall):149 - Checking if airbyte/destination-mongodb:0.2.0 exists...
2023-09-16 03:48:41 INFO i.a.c.i.LineGobbler(voidCall):149 - airbyte/destination-mongodb:0.2.0 was found locally.
2023-09-16 03:48:41 INFO i.a.w.p.DockerProcessFactory(create):143 - Creating docker container = destination-mongodb-check-8e960dd7-a9b1-4c46-9e4d-657b6a25efbb-0-qinvb with resources io.airbyte.config.ResourceRequirements@33ab8b54[cpuRequest=,cpuLimit=,memoryRequest=,memoryLimit=,additionalProperties={}] and allowedHosts null
2023-09-16 03:48:41 INFO i.a.w.p.DockerProcessFactory(create):196 - Preparing command: docker run --rm --init -i -w /data/8e960dd7-a9b1-4c46-9e4d-657b6a25efbb/0 --log-driver none --name destination-mongodb-check-8e960dd7-a9b1-4c46-9e4d-657b6a25efbb-0-qinvb --network host -v airbyte_workspace:/data -v /tmp/airbyte_local:/local -e DEPLOYMENT_MODE=OSS -e WORKER_CONNECTOR_IMAGE=airbyte/destination-mongodb:0.2.0 -e AUTO_DETECT_SCHEMA=true -e LAUNCHDARKLY_KEY= -e SOCAT_KUBE_CPU_REQUEST=0.1 -e SOCAT_KUBE_CPU_LIMIT=2.0 -e USE_STREAM_CAPABLE_STATE=true -e FIELD_SELECTION_WORKSPACES= -e AIRBYTE_ROLE= -e WORKER_ENVIRONMENT=DOCKER -e APPLY_FIELD_SELECTION=false -e WORKER_JOB_ATTEMPT=0 -e OTEL_COLLECTOR_ENDPOINT=http://host.docker.internal:4317 -e FEATURE_FLAG_CLIENT=config -e AIRBYTE_VERSION=0.50.29 -e WORKER_JOB_ID=8e960dd7-a9b1-4c46-9e4d-657b6a25efbb airbyte/destination-mongodb:0.2.0 check --config source_config.json
2023-09-16 03:48:41 INFO i.a.w.i.VersionedAirbyteStreamFactory(create):177 - Reading messages from protocol version 0.2.0
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.d.m.MongodbDestination(main):63 starting destination: class io.airbyte.integrations.destination.mongodb.MongodbDestination
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.IntegrationCliParser(parseOptions):126 integration args: {check=null, config=source_config.json}
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.IntegrationRunner(runInternal):106 Running integration: io.airbyte.integrations.base.ssh.SshWrappedDestination
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.IntegrationRunner(runInternal):107 Command: CHECK
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.IntegrationRunner(runInternal):108 Integration config: IntegrationConfig{command=CHECK, configPath='source_config.json', catalogPath='null', statePath='null'}
2023-09-16 03:48:42 WARN i.a.w.i.VersionedAirbyteStreamFactory(internalLog):309 - WARN c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword order - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.s.SshTunnel(getInstance):204 Starting connection with method: NO_TUNNEL
2023-09-16 03:48:42 ERROR i.a.w.i.VersionedAirbyteStreamFactory(internalLog):308 - 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:168) ~[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:?]

Stack Trace: java.util.MissingFormatArgumentException: Format specifier '%s'
    at java.base/java.util.Formatter.format(Formatter.java:2688)
    at java.base/java.util.Formatter.format(Formatter.java:2625)
    at java.base/java.lang.String.format(String.java:4143)
    at io.airbyte.integrations.destination.mongodb.MongodbDestination.buildConnectionString(MongodbDestination.java:168)
    at io.airbyte.integrations.destination.mongodb.MongodbDestination.getConnectionString(MongodbDestination.java:150)
    at io.airbyte.integrations.destination.mongodb.MongodbDestination.getDatabase(MongodbDestination.java:136)
    at io.airbyte.integrations.destination.mongodb.MongodbDestination.check(MongodbDestination.java:71)
    at io.airbyte.integrations.base.ssh.SshTunnel.sshWrap(SshTunnel.java:270)
    at io.airbyte.integrations.base.ssh.SshWrappedDestination.check(SshWrappedDestination.java:67)
    at io.airbyte.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:124)
    at io.airbyte.integrations.base.IntegrationRunner.run(IntegrationRunner.java:99)
    at io.airbyte.integrations.destination.mongodb.MongodbDestination.main(MongodbDestination.java:64)

2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.b.IntegrationRunner(runInternal):197 Completed integration: io.airbyte.integrations.base.ssh.SshWrappedDestination
2023-09-16 03:48:42 INFO i.a.w.i.VersionedAirbyteStreamFactory(internalLog):312 - INFO i.a.i.d.m.MongodbDestination(main):65 completed destination: class io.airbyte.integrations.destination.mongodb.MongodbDestination
2023-09-16 03:48:42 INFO i.a.w.g.DefaultCheckConnectionWorker(run):117 - Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@657f76f3[status=failed,message=Format specifier '%s',additionalProperties={}]
2023-09-16 03:48:42 INFO i.a.c.i.LineGobbler(voidCall):149 - 
2023-09-16 03:48:42 INFO i.a.c.i.LineGobbler(voidCall):149 - ----- END CHECK -----
2023-09-16 03:48:42 INFO i.a.c.i.LineGobbler(voidCall):149 -

Contribute

tshradheya commented 11 months ago

Any help on this?

akoebbe commented 11 months ago

+1 having the same issue. The only things I can figure out is from the history of this line...

https://github.com/airbytehq/airbyte/blob/2faff020ee050047d5449154bfe501049c4dc4f6/airbyte-integrations/connectors/destination-mongodb/src/main/java/io/airbyte/integrations/destination/mongodb/MongoUtils.java#L73

For a brief time in July it was changed to the following

https://github.com/airbytehq/airbyte/blob/b017ee67f9d197c8712d80a3a30c545ab9658163/airbyte-db/db-lib/src/main/java/io/airbyte/db/mongodb/MongoUtils.java#L72

But airbyte-integrations/connectors/destination-mongodb/src/main/java/io/airbyte/integrations/destination/mongodb/MongodbDestination.java was not updated with the extra parameter.

It was like this for a week, then reverted. And the 0.2.0 version was released in June, so I'm not sure if that was the cause of the error, but it certainly would cause an error like we're seeing.

zigorlekaroz commented 10 months ago

+1 having the same issue.

avishmonga commented 9 months ago

+1 facing same error

Janzenzzc commented 8 months ago

I found that switching the version of destination to 0.1.9 in settings can temporarily solve the problem.

Janzenzzc commented 8 months ago

And need to use admin user. 4f289510c5d3b9f01d99db39962ea78