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.96k stars 4.1k forks source link

[source-MongoDB] incremental sync giving errors #36994

Closed vatsal-kavida closed 5 months ago

vatsal-kavida commented 6 months ago

Connector Name

source-mongodb

Connector Version

1.3.3

What step the error happened?

During the sync

Relevant information

have deployed my airbyte on eks using helm. I have setup a mongodb source connector and a postgres destination for incremetal updates. When trying tor un the sync it gives errors -> "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details"

Relevant log output

Here is the whole log output for the sync ->
2024-04-11 13:37:47 replication-orchestrator > sync summary: {
  "status" : "failed",
  "startTime" : 1712842649996,
  "endTime" : 1712842667491,
  "totalStats" : {
    "bytesEmitted" : 0,
    "destinationStateMessagesEmitted" : 0,
    "destinationWriteEndTime" : 1712842667344,
    "destinationWriteStartTime" : 1712842650012,
    "meanSecondsBeforeSourceStateMessageEmitted" : 0,
    "maxSecondsBeforeSourceStateMessageEmitted" : 0,
    "meanSecondsBetweenStateMessageEmittedandCommitted" : 0,
    "recordsEmitted" : 0,
    "replicationEndTime" : 1712842667361,
    "replicationStartTime" : 1712842649996,
    "sourceReadEndTime" : 0,
    "sourceReadStartTime" : 1712842650015,
    "sourceStateMessagesEmitted" : 0
  },
  "streamStats" : [ ],
  "performanceMetrics" : {
    "processFromSource" : {
      "elapsedTimeInNanos" : 75674150,
      "executionCount" : 3,
      "avgExecTimeInNanos" : 2.5224716666666668E7
    },
    "readFromSource" : {
      "elapsedTimeInNanos" : 9081713300,
      "executionCount" : 18077,
      "avgExecTimeInNanos" : 502390.5128063285
    },
    "processFromDest" : {
      "elapsedTimeInNanos" : 0,
      "executionCount" : 0,
      "avgExecTimeInNanos" : "NaN"
    },
    "writeToDest" : {
      "elapsedTimeInNanos" : 0,
      "executionCount" : 0,
      "avgExecTimeInNanos" : "NaN"
    },
    "readFromDest" : {
      "elapsedTimeInNanos" : 10360120293,
      "executionCount" : 54113,
      "avgExecTimeInNanos" : 191453.4454382496
    }
  }
}
2024-04-11 13:37:47 replication-orchestrator > failures: [ {
  "failureOrigin" : "source",
  "failureType" : "config_error",
  "internalMessage" : "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details",
  "externalMessage" : "Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details",
  "metadata" : {
    "attemptNumber" : 0,
    "jobId" : 136,
    "from_trace_message" : true,
    "connector_command" : "read"
  },
  "stacktrace" : "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details\n\tat io.airbyte.integrations.source.mongodb.cdc.MongoDbCdcInitializer.createCdcIterators(MongoDbCdcInitializer.java:124)\n\tat io.airbyte.integrations.source.mongodb.MongoDbSource.read(MongoDbSource.java:155)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.readSerial(IntegrationRunner.kt:318)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:187)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:115)\n\tat io.airbyte.integrations.source.mongodb.MongoDbSource.main(MongoDbSource.java:52)\n",
  "timestamp" : 1712842664857
}, {
  "failureOrigin" : "source",
  "failureType" : "system_error",
  "internalMessage" : "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details",
  "externalMessage" : "Something went wrong in the connector. See the logs for more details.",
  "metadata" : {
    "attemptNumber" : 0,
    "jobId" : 136,
    "from_trace_message" : true,
    "connector_command" : "read"
  },
  "stacktrace" : "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details\n\tat io.airbyte.integrations.source.mongodb.cdc.MongoDbCdcInitializer.createCdcIterators(MongoDbCdcInitializer.java:124)\n\tat io.airbyte.integrations.source.mongodb.MongoDbSource.read(MongoDbSource.java:155)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.readSerial(IntegrationRunner.kt:318)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:187)\n\tat io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:115)\n\tat io.airbyte.integrations.source.mongodb.MongoDbSource.main(MongoDbSource.java:52)\n",
  "timestamp" : 1712842664888
}, {
  "failureOrigin" : "source",
  "internalMessage" : "Source process exited with non-zero exit code 1",
  "externalMessage" : "Something went wrong within the source connector",
  "metadata" : {
    "attemptNumber" : 0,
    "jobId" : 136,
    "connector_command" : "read"
  },
  "stacktrace" : "io.airbyte.workers.internal.exception.SourceException: Source process exited with non-zero exit code 1\n\tat io.airbyte.workers.general.BufferedReplicationWorker.readFromSource(BufferedReplicationWorker.java:362)\n\tat io.airbyte.workers.general.BufferedReplicationWorker.lambda$runAsyncWithHeartbeatCheck$3(BufferedReplicationWorker.java:234)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\n",
  "timestamp" : 1712842666444
} ]
2024-04-11 13:37:47 replication-orchestrator > Returning output...
2024-04-11 13:37:47 replication-orchestrator > 
2024-04-11 13:37:47 replication-orchestrator > ----- END REPLICATION -----

Contribute

marcosmarxm commented 6 months ago

@vatsal-kavida can you share the complete sync log?

DevBey commented 6 months ago

we have the same issue @marcosmarxm, please find the logs.

io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details

addtional information this is actually working with this option set to re-sync but then it crashed our postgres in a day by increasing the size from 200MB to 20GB incrementally in a day. image

2024-04-15 16:04:46 platform > Executing worker wrapper. Airbyte version: 0.57.2
2024-04-15 16:04:46 platform > Attempt 0 to save workflow id for cancellation
2024-04-15 16:04:46 platform > 
2024-04-15 16:04:46 platform > ----- START CHECK -----
2024-04-15 16:04:46 platform > 
2024-04-15 16:04:46 platform > Using default value for environment variable SIDECAR_KUBE_CPU_LIMIT: '2.0'
2024-04-15 16:04:46 platform > Using default value for environment variable SOCAT_KUBE_CPU_LIMIT: '2.0'
2024-04-15 16:04:46 platform > Using default value for environment variable SIDECAR_KUBE_CPU_REQUEST: '0.1'
2024-04-15 16:04:46 platform > Using default value for environment variable SOCAT_KUBE_CPU_REQUEST: '0.1'
2024-04-15 16:04:46 platform > Attempting to start pod = source-mongodb-v2-check-1052-0-ftkeq for airbyte/source-mongodb-v2:1.3.3 with resources ConnectorResourceRequirements[main=io.airbyte.config.ResourceRequirements@5a00e87a[cpuRequest=1m,cpuLimit=1200m,memoryRequest=100Mi,memoryLimit=4Gi,additionalProperties={}], heartbeat=io.airbyte.config.ResourceRequirements@1f9d99de[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdErr=io.airbyte.config.ResourceRequirements@1ee11c9b[cpuRequest=0.25,cpuLimit=2,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdIn=io.airbyte.config.ResourceRequirements@6525ec6a[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdOut=io.airbyte.config.ResourceRequirements@6525ec6a[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}]] and allowedHosts null
2024-04-15 16:04:46 platform > source-mongodb-v2-check-1052-0-ftkeq stdoutLocalPort = 9024
2024-04-15 16:04:46 platform > source-mongodb-v2-check-1052-0-ftkeq stderrLocalPort = 9025
2024-04-15 16:04:46 platform > Creating stdout socket server...
2024-04-15 16:04:46 platform > Creating stderr socket server...
2024-04-15 16:04:46 platform > Creating pod source-mongodb-v2-check-1052-0-ftkeq...
2024-04-15 16:04:47 platform > Waiting for init container to be ready before copying files...
2024-04-15 16:04:49 platform > Init container ready..
2024-04-15 16:04:49 platform > Copying files...
2024-04-15 16:04:49 platform > Uploading file: source_config.json
2024-04-15 16:04:49 platform > kubectl cp /tmp/32f9c363-50e6-4f87-aa05-04870a994d2a/source_config.json airbyte/source-mongodb-v2-check-1052-0-ftkeq:/config/source_config.json -c init --retries=3
2024-04-15 16:04:49 platform > Waiting for kubectl cp to complete
2024-04-15 16:04:49 platform > kubectl cp complete, closing process
2024-04-15 16:04:49 platform > Uploading file: FINISHED_UPLOADING
2024-04-15 16:04:49 platform > kubectl cp /tmp/1b83253d-5674-4d53-87a6-2b6b2a7f71bd/FINISHED_UPLOADING airbyte/source-mongodb-v2-check-1052-0-ftkeq:/config/FINISHED_UPLOADING -c init --retries=3
2024-04-15 16:04:49 platform > Waiting for kubectl cp to complete
2024-04-15 16:04:49 platform > kubectl cp complete, closing process
2024-04-15 16:04:49 platform > Waiting until pod is ready...
2024-04-15 16:04:50 platform > Setting stdout...
2024-04-15 16:04:50 platform > Setting stderr...
2024-04-15 16:04:51 platform > Reading pod IP...
2024-04-15 16:04:51 platform > Pod IP: 10.0.5.138
2024-04-15 16:04:51 platform > Using null stdin output stream...
2024-04-15 16:04:51 platform > Reading messages from protocol version 0.2.0
2024-04-15 16:04:52 platform > INFO main i.a.i.s.m.MongoDbSource(main):51 starting source: class io.airbyte.integrations.source.mongodb.MongoDbSource
2024-04-15 16:04:53 platform > INFO main i.a.c.i.b.IntegrationCliParser$Companion(parseOptions):146 integration args: {check=null, config=source_config.json}
2024-04-15 16:04:53 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):123 Running integration: io.airbyte.integrations.source.mongodb.MongoDbSource
2024-04-15 16:04:53 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):124 Command: CHECK
2024-04-15 16:04:53 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):125 Integration config: IntegrationConfig{command=CHECK, configPath='source_config.json', catalogPath='null', statePath='null'}
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword groups - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main 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
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword group - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword display_type - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword airbyte_secret - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword always_show - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword min - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword max - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:04:53 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-srv-production.cxb4j.mongodb.net c.m.i.d.l.SLF4JLogger(info):71 Adding discovered server production-shard-00-00.cxb4j.mongodb.net:27017 to client view of cluster
2024-04-15 16:04:54 platform > INFO main c.m.i.d.l.SLF4JLogger(info):71 MongoClient with metadata {"driver": {"name": "mongo-java-driver|sync|Airbyte", "version": "4.10.2"}, "os": {"type": "Linux", "name": "Linux", "architecture": "amd64", "version": "5.10.209-198.858.amzn2.x86_64"}, "platform": "Java/Amazon.com Inc./21.0.2+14-LTS"} created with settings MongoClientSettings{readPreference=ReadPreference{name=secondaryPreferred, hedgeOptions=null}, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=MongoCredential{mechanism=null, userName='prod-user-airbyte', source='admin', password=<hidden>, mechanismProperties=<hidden>}, streamFactoryFactory=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, CollectionCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.client.model.mql.ExpressionCodecProvider@240139e1, com.mongodb.Jep395RecordCodecProvider@7ea4d397, com.mongodb.KotlinCodecProvider@49298ce7]}, loggerSettings=LoggerSettings{maxDocumentLength=1000}, clusterSettings={hosts=[127.0.0.1:27017], srvHost=production.cxb4j.mongodb.net, srvServiceName=mongodb, mode=MULTIPLE, requiredClusterType=REPLICA_SET, requiredReplicaSetName='atlas-hz77e8-shard-0', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='30000 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, sendBufferSize=0}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, sendBufferSize=0}, connectionPoolSettings=ConnectionPoolSettings{maxSize=100, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=true, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=UNSPECIFIED, serverApi=null, autoEncryptionSettings=null, dnsClient=null, inetAddressResolver=null, contextProvider=null}
2024-04-15 16:04:54 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-srv-production.cxb4j.mongodb.net c.m.i.d.l.SLF4JLogger(info):71 Adding discovered server production-shard-00-01.cxb4j.mongodb.net:27017 to client view of cluster
2024-04-15 16:04:54 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-srv-production.cxb4j.mongodb.net c.m.i.d.l.SLF4JLogger(info):71 Adding discovered server production-shard-00-02.cxb4j.mongodb.net:27017 to client view of cluster
2024-04-15 16:04:54 platform > INFO main c.m.i.d.l.SLF4JLogger(info):71 No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=production-shard-00-00.cxb4j.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=production-shard-00-02.cxb4j.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=production-shard-00-01.cxb4j.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
2024-04-15 16:04:55 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-production-shard-00-01.cxb4j.mongodb.net:27017 c.m.i.d.l.SLF4JLogger(info):71 Monitor thread successfully connected to server with description ServerDescription{address=production-shard-00-01.cxb4j.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=21, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=862076339, setName='atlas-hz77e8-shard-0', canonicalAddress=production-shard-00-01.cxb4j.mongodb.net:27017, hosts=[production-shard-00-00.cxb4j.mongodb.net:27017, production-shard-00-01.cxb4j.mongodb.net:27017, production-shard-00-02.cxb4j.mongodb.net:27017], passives=[], arbiters=[], primary='production-shard-00-02.cxb4j.mongodb.net:27017', tagSet=TagSet{[Tag{name='availabilityZone', value='use1-az6'}, Tag{name='diskState', value='READY'}, Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='US_EAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=66156b02152577aae0c40808, counter=5}, lastWriteDate=Mon Apr 15 16:04:52 UTC 2024, lastUpdateTimeNanos=3306767916076322}
2024-04-15 16:04:55 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-production-shard-00-00.cxb4j.mongodb.net:27017 c.m.i.d.l.SLF4JLogger(info):71 Monitor thread successfully connected to server with description ServerDescription{address=production-shard-00-00.cxb4j.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=21, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=860506698, setName='atlas-hz77e8-shard-0', canonicalAddress=production-shard-00-00.cxb4j.mongodb.net:27017, hosts=[production-shard-00-00.cxb4j.mongodb.net:27017, production-shard-00-01.cxb4j.mongodb.net:27017, production-shard-00-02.cxb4j.mongodb.net:27017], passives=[], arbiters=[], primary='production-shard-00-02.cxb4j.mongodb.net:27017', tagSet=TagSet{[Tag{name='availabilityZone', value='use1-az4'}, Tag{name='diskState', value='READY'}, Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='US_EAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=66156b02bf27aaade7d23f58, counter=8}, lastWriteDate=Mon Apr 15 16:04:52 UTC 2024, lastUpdateTimeNanos=3306767914577402}
2024-04-15 16:04:55 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-production-shard-00-02.cxb4j.mongodb.net:27017 c.m.i.d.l.SLF4JLogger(info):71 Monitor thread successfully connected to server with description ServerDescription{address=production-shard-00-02.cxb4j.mongodb.net:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=21, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=862684686, setName='atlas-hz77e8-shard-0', canonicalAddress=production-shard-00-02.cxb4j.mongodb.net:27017, hosts=[production-shard-00-00.cxb4j.mongodb.net:27017, production-shard-00-01.cxb4j.mongodb.net:27017, production-shard-00-02.cxb4j.mongodb.net:27017], passives=[], arbiters=[], primary='production-shard-00-02.cxb4j.mongodb.net:27017', tagSet=TagSet{[Tag{name='availabilityZone', value='use1-az5'}, Tag{name='diskState', value='READY'}, Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='US_EAST_1'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=7fffffff0000000000000002, setVersion=1, topologyVersion=TopologyVersion{processId=66156af009bf689bdc79b488, counter=7}, lastWriteDate=Mon Apr 15 16:04:52 UTC 2024, lastUpdateTimeNanos=3306767916828332}
2024-04-15 16:04:55 platform > INFO cluster-ClusterId{value='661d50251a33755e8f6c15e9', description='null'}-production-shard-00-02.cxb4j.mongodb.net:27017 c.m.i.d.l.SLF4JLogger(info):71 Discovered replica set primary production-shard-00-02.cxb4j.mongodb.net:27017 with max election id 7fffffff0000000000000002 and max set version 1
2024-04-15 16:04:56 platform > INFO main i.a.i.s.m.MongoDbSource(check):97 The source passed the check operation test!
2024-04-15 16:04:56 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):252 Completed integration: io.airbyte.integrations.source.mongodb.MongoDbSource
2024-04-15 16:04:56 platform > INFO main i.a.i.s.m.MongoDbSource(main):53 completed source: class io.airbyte.integrations.source.mongodb.MongoDbSource
2024-04-15 16:04:57 platform > (pod: airbyte / source-mongodb-v2-check-1052-0-ftkeq) - Closed all resources for pod
2024-04-15 16:04:57 platform > Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@11286c0f[status=succeeded,message=<null>,additionalProperties={}]
2024-04-15 16:04:57 platform > 
2024-04-15 16:04:57 platform > ----- END CHECK -----
2024-04-15 16:04:57 platform > 
2024-04-15 16:04:57 platform > Cloud storage job log path: /workspace/1052/0/logs.log
2024-04-15 16:04:57 platform > Executing worker wrapper. Airbyte version: 0.57.2
2024-04-15 16:04:57 platform > Attempt 0 to save workflow id for cancellation
2024-04-15 16:04:57 platform > 
2024-04-15 16:04:57 platform > Using default value for environment variable SIDECAR_KUBE_CPU_LIMIT: '2.0'
2024-04-15 16:04:57 platform > Using default value for environment variable SOCAT_KUBE_CPU_LIMIT: '2.0'
2024-04-15 16:04:57 platform > ----- START CHECK -----
2024-04-15 16:04:57 platform > 
2024-04-15 16:04:57 platform > Using default value for environment variable SIDECAR_KUBE_CPU_REQUEST: '0.1'
2024-04-15 16:04:57 platform > Using default value for environment variable SOCAT_KUBE_CPU_REQUEST: '0.1'
2024-04-15 16:04:57 platform > Attempting to start pod = destination-postgres-check-1052-0-vhysw for airbyte/destination-postgres:2.0.5 with resources ConnectorResourceRequirements[main=io.airbyte.config.ResourceRequirements@70282df1[cpuRequest=1m,cpuLimit=1200m,memoryRequest=100Mi,memoryLimit=4Gi,additionalProperties={}], heartbeat=io.airbyte.config.ResourceRequirements@1f9d99de[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdErr=io.airbyte.config.ResourceRequirements@1ee11c9b[cpuRequest=0.25,cpuLimit=2,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdIn=io.airbyte.config.ResourceRequirements@6525ec6a[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}], stdOut=io.airbyte.config.ResourceRequirements@6525ec6a[cpuRequest=0.1,cpuLimit=2.0,memoryRequest=25Mi,memoryLimit=50Mi,additionalProperties={}]] and allowedHosts null
2024-04-15 16:04:57 platform > destination-postgres-check-1052-0-vhysw stdoutLocalPort = 9026
2024-04-15 16:04:57 platform > destination-postgres-check-1052-0-vhysw stderrLocalPort = 9027
2024-04-15 16:04:57 platform > Creating stdout socket server...
2024-04-15 16:04:57 platform > Creating pod destination-postgres-check-1052-0-vhysw...
2024-04-15 16:04:57 platform > Creating stderr socket server...
2024-04-15 16:04:57 platform > Waiting for init container to be ready before copying files...
2024-04-15 16:04:58 platform > Init container ready..
2024-04-15 16:04:58 platform > Copying files...
2024-04-15 16:04:58 platform > Uploading file: source_config.json
2024-04-15 16:04:58 platform > kubectl cp /tmp/c50a343c-1592-4371-94f2-7d09c7a6f92a/source_config.json airbyte/destination-postgres-check-1052-0-vhysw:/config/source_config.json -c init --retries=3
2024-04-15 16:04:58 platform > Waiting for kubectl cp to complete
2024-04-15 16:04:58 platform > kubectl cp complete, closing process
2024-04-15 16:04:58 platform > Uploading file: FINISHED_UPLOADING
2024-04-15 16:04:58 platform > kubectl cp /tmp/3db01d26-a420-45b7-b7b4-f2622e135442/FINISHED_UPLOADING airbyte/destination-postgres-check-1052-0-vhysw:/config/FINISHED_UPLOADING -c init --retries=3
2024-04-15 16:04:58 platform > Waiting for kubectl cp to complete
2024-04-15 16:04:58 platform > kubectl cp complete, closing process
2024-04-15 16:04:58 platform > Waiting until pod is ready...
2024-04-15 16:05:08 platform > Setting stdout...
2024-04-15 16:05:08 platform > Setting stderr...
2024-04-15 16:05:09 platform > Reading pod IP...
2024-04-15 16:05:09 platform > Pod IP: 10.0.5.64
2024-04-15 16:05:09 platform > Using null stdin output stream...
2024-04-15 16:05:09 platform > Reading messages from protocol version 0.2.0
2024-04-15 16:05:10 platform > INFO main i.a.i.d.p.PostgresDestination(main):165 starting destination: class io.airbyte.integrations.destination.postgres.PostgresDestination
2024-04-15 16:05:11 platform > INFO main i.a.c.i.b.IntegrationCliParser(parseOptions):126 integration args: {check=null, config=source_config.json}
2024-04-15 16:05:11 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):132 Running integration: io.airbyte.cdk.integrations.base.ssh.SshWrappedDestination
2024-04-15 16:05:11 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):133 Command: CHECK
2024-04-15 16:05:11 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):134 Integration config: IntegrationConfig{command=CHECK, configPath='source_config.json', catalogPath='null', statePath='null'}
2024-04-15 16:05:11 platform > WARN main 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
2024-04-15 16:05:11 platform > WARN main c.n.s.JsonMetaSchema(newValidator):278 Unknown keyword airbyte_secret - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
2024-04-15 16:05:12 platform > INFO main i.a.c.i.b.s.SshTunnel(getInstance):252 Starting connection with method: NO_TUNNEL
2024-04-15 16:05:12 platform > INFO main c.z.h.HikariDataSource(<init>):79 HikariPool-1 - Starting...
2024-04-15 16:05:12 platform > INFO main c.z.h.HikariDataSource(<init>):81 HikariPool-1 - Start completed.
2024-04-15 16:05:13 platform > INFO main c.z.h.HikariDataSource(close):349 HikariPool-1 - Shutdown initiated...
2024-04-15 16:05:13 platform > INFO main c.z.h.HikariDataSource(close):351 HikariPool-1 - Shutdown completed.
2024-04-15 16:05:13 platform > INFO main i.a.c.i.b.IntegrationRunner(runInternal):227 Completed integration: io.airbyte.cdk.integrations.base.ssh.SshWrappedDestination
2024-04-15 16:05:13 platform > INFO main i.a.i.d.p.PostgresDestination(main):167 completed destination: class io.airbyte.integrations.destination.postgres.PostgresDestination
2024-04-15 16:05:17 platform > (pod: airbyte / destination-postgres-check-1052-0-vhysw) - Closed all resources for pod
2024-04-15 16:05:17 platform > Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@7c4009fa[status=succeeded,message=<null>,additionalProperties={}]
2024-04-15 16:05:17 platform > 
2024-04-15 16:05:17 platform > ----- END CHECK -----
2024-04-15 16:05:17 platform > 
2024-04-15 16:05:18 platform > Cloud storage job log path: /workspace/1052/0/logs.log
2024-04-15 16:05:18 platform > Executing worker wrapper. Airbyte version: 0.57.2
2024-04-15 16:05:18 platform > Attempt 0 to save workflow id for cancellation
2024-04-15 16:05:18 platform > Creating orchestrator-repl-job-1052-attempt-0 for attempt number: 0
2024-04-15 16:05:18 platform > Successfully deleted all running pods for the connection!
2024-04-15 16:05:18 platform > Waiting for pod to be running...
2024-04-15 16:05:20 platform > Pod airbyte/orchestrator-repl-job-1052-attempt-0 is running on 10.0.5.212
2024-04-15 16:05:20 platform > Uploading file: envMap.json
2024-04-15 16:05:20 platform > kubectl cp /tmp/642fda08-fba5-45ef-bfeb-042280e4d20f/envMap.json airbyte/orchestrator-repl-job-1052-attempt-0:/config/envMap.json -c init --retries=3
2024-04-15 16:05:20 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:20 platform > kubectl cp complete, closing process
2024-04-15 16:05:20 platform > Uploading file: application.txt
2024-04-15 16:05:20 platform > kubectl cp /tmp/beae3209-7be4-4037-bd0a-947ec94d0fc0/application.txt airbyte/orchestrator-repl-job-1052-attempt-0:/config/application.txt -c init --retries=3
2024-04-15 16:05:20 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:20 platform > kubectl cp complete, closing process
2024-04-15 16:05:20 platform > Uploading file: jobRunConfig.json
2024-04-15 16:05:20 platform > kubectl cp /tmp/a61dc0ec-2b6f-4aa1-900f-98301bb5a968/jobRunConfig.json airbyte/orchestrator-repl-job-1052-attempt-0:/config/jobRunConfig.json -c init --retries=3
2024-04-15 16:05:20 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:21 platform > kubectl cp complete, closing process
2024-04-15 16:05:21 platform > Uploading file: destinationLauncherConfig.json
2024-04-15 16:05:21 platform > kubectl cp /tmp/3ca14cf4-9415-4a40-8f62-2aa802e6e3dd/destinationLauncherConfig.json airbyte/orchestrator-repl-job-1052-attempt-0:/config/destinationLauncherConfig.json -c init --retries=3
2024-04-15 16:05:21 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:21 platform > kubectl cp complete, closing process
2024-04-15 16:05:21 platform > Uploading file: sourceLauncherConfig.json
2024-04-15 16:05:21 platform > kubectl cp /tmp/5a9232fd-9874-4c92-b314-a00e8f151608/sourceLauncherConfig.json airbyte/orchestrator-repl-job-1052-attempt-0:/config/sourceLauncherConfig.json -c init --retries=3
2024-04-15 16:05:21 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:21 platform > kubectl cp complete, closing process
2024-04-15 16:05:21 platform > Uploading file: input.json
2024-04-15 16:05:21 platform > kubectl cp /tmp/bd1ec7b0-5680-4e66-8075-aa477e604237/input.json airbyte/orchestrator-repl-job-1052-attempt-0:/config/input.json -c init --retries=3
2024-04-15 16:05:21 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:21 platform > kubectl cp complete, closing process
2024-04-15 16:05:21 platform > Uploading file: KUBE_POD_INFO
2024-04-15 16:05:21 platform > kubectl cp /tmp/012d2094-ef11-41d8-b255-426b185dcb95/KUBE_POD_INFO airbyte/orchestrator-repl-job-1052-attempt-0:/config/KUBE_POD_INFO -c init --retries=3
2024-04-15 16:05:21 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:21 platform > kubectl cp complete, closing process
2024-04-15 16:05:21 platform > Uploading file: FINISHED_UPLOADING
2024-04-15 16:05:21 platform > kubectl cp /tmp/e834ac31-be6c-41ae-8ca3-5f6587370362/FINISHED_UPLOADING airbyte/orchestrator-repl-job-1052-attempt-0:/config/FINISHED_UPLOADING -c init --retries=3
2024-04-15 16:05:21 platform > Waiting for kubectl cp to complete
2024-04-15 16:05:22 platform > kubectl cp complete, closing process
2024-04-15 16:05:49 INFO i.m.r.Micronaut(start):100 - Startup completed in 6822ms. Server Running: http://orchestrator-repl-job-1052-attempt-0:9000
2024-04-15 16:05:53 replication-orchestrator > Writing async status INITIALIZING for KubePodInfo[namespace=airbyte, name=orchestrator-repl-job-1052-attempt-0, mainContainerInfo=KubeContainerInfo[image=airbyte/container-orchestrator:0.57.2, pullPolicy=IfNotPresent]]...
2024-04-15 16:06:17 platform > State Store reports orchestrator pod orchestrator-repl-job-1052-attempt-0 succeeded
2024-04-15 16:06:17 platform > Retry State: RetryManager(completeFailureBackoffPolicy=BackoffPolicy(minInterval=PT10S, maxInterval=PT30M, base=3), partialFailureBackoffPolicy=null, successiveCompleteFailureLimit=5, totalCompleteFailureLimit=10, successivePartialFailureLimit=1000, totalPartialFailureLimit=10, successiveCompleteFailures=1, totalCompleteFailures=1, successivePartialFailures=0, totalPartialFailures=0)
 Backoff before next attempt: 10 seconds
2024-04-15 16:06:17 platform > Failing job: 1052, reason: Connection Check Failed ef202176-43f3-4f7d-8d7d-50c78fd45ae3
DevBey commented 6 months ago

image quick update from our side @marcosmarxm

secondly what we aren't able to understand is why it's loading all the 4k articles again and again ideally we use mage for mongodb to mongodb sync and it just catches the updates/inserts from the oplog and only inserts updates those rows.

update on the above issue is we were able to understand why our postres crashed. the issue was postgres write head log, as it kept increasing after setting up incremental sync for every 5 minute and then postgres crashed taking 20GB of space.

meanwhile our actualy sample dataset is only 100MB

DevBey commented 6 months ago

further update is that even if you somehow turn off WAL in postgres.

another issue is the stead increase of raw tables in postgres, the size just keeps on increasing with every passing second.

DevBey commented 6 months ago

further investigation shows that the airbyte_internal.public_raw__stream tables have almost 100 times more rows than the actual tables.

we have already verified that oplog size is more than a day and we are syncing in near real time basically every 5 minutes.

actual tables => 694 airbyte internal raw table => 31000

is this because the being re-sync ?? because anyway without this it isn't even working, we get offset invalid issue. image

DevBey commented 6 months ago

Hello @marcosmarxm, can we please get any help on this ??

akashkulk commented 6 months ago

Hi @DevBey the team recently released some fixes on the mongo connector which we believe fix this issue. Could you upgrade to 1.3.8 and check if you are encountering the same issue?

DevBey commented 6 months ago

Hello @akashkulk,

thanks for the help, but sadly because of no communication from airbyte team in last two weeks, we have moved to another brilliant product https://github.com/mage-ai/mage-ai.

thanks anyway for the help.

ngocquang2797 commented 1 month ago

i have same issue "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details"

I sync every 30 minutes and my oplog config is: image

i'm using mongodb source connector version 1.5.9

vinhhap commented 1 month ago

i have same issue "io.airbyte.commons.exceptions.ConfigErrorException: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future. See https://docs.airbyte.com/integrations/sources/mongodb-v2#mongodb-oplog-and-change-streams for more details"

I sync every 30 minutes and my oplog config is: image

i'm using mongodb source connector version 1.5.9

Hi @ngocquang2797, can you recheck the oplogSizeMB configuration of your MongoDB cluster, the actual oplog size from your photo is nearly x2.5 the configured oplog size. When the oplog exceeds its maximum configured size, it begins to overwrite its oldest entries. Airbyte attempts to resume CDC from the last oplog stream position, if last offset position was removed from the oplog, it might fail to start