https://slingdata.io logo
so we've had a mongo-to-bigquery
# sling-help
f
so we've had a mongo-to-bigquery replication running for a few months and all of a sudden its failing since a few days ago...
Copy code
fran@lovelace:~/repositories/oxidine/poseidon-sling$ uvr sling run -r replications/mongodb_to_bq.yaml
12:28PM INF Sling CLI | https://slingdata.io
12:28PM INF Sling Replication | MONGODB -> BIGQUERY | mongodb.***.mqtt_messages
12:28PM INF connecting to source database (mongodb)
12:28PM INF connecting to target database (bigquery)
12:28PM INF reading from source database
12:28PM INF execution failed
could not query to get tables

fatal:
~ failure running replication (see docs @ https://docs.slingdata.io/sling-cli)
--------------------------- mongodb.***.mqtt_messages ---------------------------
~ Could not get source columns
could not query to get tables
f
hello, have you tried re-running this? from the error stack, it seems like it cannot fetch the collections's columns. Not sure if it was dropped or something? If not, can you share your replication?
f
the replications is simple: source: MONGODB target: BIGQUERY defaults: mode: full-refresh streams: "mongodb.**.mqtt_messages": object: "landing.mongodb__measurements"
thanks for answering btw
hey @flarco so we've retried this with a fresh dummy db and collection and it fails in the same way in case it helps, this is a GCP Firestore enterprise instance with mongodb compatibility, and everything had worked correctly for a few months. I wonder if a) something changed on GCP's side and (b) how could we debug this. any ideas?
f
hey @frandribia_42290 , can you try with the [dev build](https://github.com/slingdata-io/sling-cli?tab=readme-ov-file#automated-dev-builds) ? Download the binary and run with
--trace
, can you send me the log with the error message?
f
sure thing, will try and get back to you
so to sum up, looks like we had been hitting this limit https://cloud.google.com/firestore/mongodb-compatibility/quotas#reads_writes_and_transactions which makes sense since there's around 1.2M docs in the mongodb (so that makes 100bytes per doc) and we had been using full-refresh mode. However, we dont quite understand how sling is exploring the collections since this is also happening when we query another small collection. Apparently sling explores all collections always? we are not sure
f
this is the line it runs by the mongo golang client: https://github.com/slingdata-io/sling-cli/blob/270ca2398f8f10a250446107600e60449ddd0ab3/core/dbio/database/database_mongo.go#L479 which generates the error. No sure if it traverses the collection...
f
apparently it does, at least from the errors we are getting it seems so
I guess its trying to get the existing columns? which for mongo means scanning all documents basically, and that drives us to do a giant aggregate operation I guess