Some Mongodb Collections have no Data

Hello everyone,
I have connected a mongodb database to metabase, the connection was successful but not all the collections have data even though I can see the data on the database.

Appreciate your help.

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.18+10",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.18",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.18+10",
    "os.name": "Linux",
    "os.version": "5.19.0-1022-aws",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "mongo",
      "h2",
      "googleanalytics"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "12.11"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.5.1"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2023-04-05",
      "tag": "v0.46.1",
      "branch": "release-x.46.x",
      "hash": "12a6e1d"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Logs:

[7e35993b-3a25-4eec-a55c-10caf2a3f5ce] 2023-04-15T21:16:31+03:00 ERROR metabase.query-processor.middleware.catch-exceptions Error processing query: No fields found for table "Leads".
{:database_id 37,
 :started_at #t "2023-04-15T18:16:31.581349Z[GMT]",
 :error_type :invalid-query,
 :json_query
 {:database 37,
  :query {:source-table 2289, :limit 10},
  :type "query",
  :parameters [],
  :middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
 :native nil,
 :status :failed,
 :class clojure.lang.ExceptionInfo,
 :stacktrace
 ["--> query_processor.middleware.add_implicit_clauses$fn__68854$sorted_implicit_fields_for_table__68859$fn__68860.invoke(add_implicit_clauses.clj:48)"
  "query_processor.middleware.add_implicit_clauses$fn__68854$sorted_implicit_fields_for_table__68859.invoke(add_implicit_clauses.clj:42)"
  "query_processor.middleware.add_implicit_clauses$fn__68982$add_implicit_fields__68987$fn__68991.invoke(add_implicit_clauses.clj:108)"
  "query_processor.middleware.add_implicit_clauses$fn__68982$add_implicit_fields__68987.invoke(add_implicit_clauses.clj:101)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses$fn__69066.invoke(add_implicit_clauses.clj:151)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses.invokeStatic(add_implicit_clauses.clj:144)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses.invoke(add_implicit_clauses.clj:141)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_clauses.invokeStatic(add_implicit_clauses.clj:161)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_clauses.invoke(add_implicit_clauses.clj:155)"
  "query_processor$preprocess_STAR_$fn__70682.invoke(query_processor.clj:158)"
  "query_processor$preprocess_STAR_.invokeStatic(query_processor.clj:156)"
  "query_processor$preprocess_STAR_.invoke(query_processor.clj:151)"
  "query_processor$fn__70690$combined_pre_process__70691$combined_pre_process_STAR___70692.invoke(query_processor.clj:240)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__69082$fn__69087.invoke(resolve_database_and_driver.clj:36)"
  "driver$do_with_driver.invokeStatic(driver.clj:90)"
  "driver$do_with_driver.invoke(driver.clj:86)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__69082.invoke(resolve_database_and_driver.clj:35)"
  "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__64952.invoke(fetch_source_query.clj:310)"
  "query_processor.middleware.store$initialize_store$fn__65130$fn__65131.invoke(store.clj:12)"
  "query_processor.store$do_with_store.invokeStatic(store.clj:47)"
  "query_processor.store$do_with_store.invoke(store.clj:41)"
  "query_processor.middleware.store$initialize_store$fn__65130.invoke(store.clj:11)"
  "query_processor.middleware.normalize_query$normalize$fn__69371.invoke(normalize_query.clj:25)"
  "query_processor.middleware.constraints$add_default_userland_constraints$fn__66308.invoke(constraints.clj:54)"
  "query_processor.middleware.process_userland_query$process_userland_query$fn__69307.invoke(process_userland_query.clj:150)"
  "query_processor.middleware.catch_exceptions$catch_exceptions$fn__69684.invoke(catch_exceptions.clj:171)"
  "query_processor.reducible$async_qp$qp_STAR___59455$thunk__59457.invoke(reducible.clj:103)"
  "query_processor.reducible$async_qp$qp_STAR___59455.invoke(reducible.clj:109)"
  "query_processor.reducible$async_qp$qp_STAR___59455.invoke(reducible.clj:94)"
  "query_processor.reducible$sync_qp$qp_STAR___59467.doInvoke(reducible.clj:129)"
  "query_processor$process_userland_query.invokeStatic(query_processor.clj:362)"
  "query_processor$process_userland_query.doInvoke(query_processor.clj:358)"
  "query_processor$fn__70738$process_query_and_save_execution_BANG___70747$fn__70750.invoke(query_processor.clj:373)"
  "query_processor$fn__70738$process_query_and_save_execution_BANG___70747.invoke(query_processor.clj:366)"
  "query_processor$fn__70783$process_query_and_save_with_max_results_constraints_BANG___70792$fn__70795.invoke(query_processor.clj:385)"
  "query_processor$fn__70783$process_query_and_save_with_max_results_constraints_BANG___70792.invoke(query_processor.clj:378)"
  "api.dataset$run_query_async$fn__86539.invoke(dataset.clj:73)"
  "query_processor.streaming$streaming_response_STAR_$fn__54305$fn__54306.invoke(streaming.clj:166)"
  "query_processor.streaming$streaming_response_STAR_$fn__54305.invoke(streaming.clj:165)"
  "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:69)"
  "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:67)"
  "async.streaming_response$do_f_async$task__36922.invoke(streaming_response.clj:88)"],
 :card_id nil,
 :context :ad-hoc,
 :error "No fields found for table \"Leads\".",
 :row_count 0,
 :running_time 0,
 :preprocessed nil,
 :ex-data {:table-id 2289, :type :invalid-query},
 :data {:rows [], :cols []}}

Have you forced a sync? What’s the log when you sync?

I got the following when trying to force a sync.

[7e35993b-3a25-4eec-a55c-10caf2a3f5ce] 2023-04-17T12:32:35+03:00 WARN metabase.sync.util Error syncing Fields for Table 'Table 2,289 'Leads''
clojure.lang.ExceptionInfo: Output of table-metadata does not match schema: 
	   {:fields #{{:nested-fields #{{:name (not ("Non-blank string" ""))}}} {:nested-fields #{{:name (not ("Non-blank string" ""))}}}}}  
 {:type :schema.core/error, :schema {:name (constrained Str "Non-blank string"), :schema (maybe (constrained Str "Non-blank string")), :fields #{{#schema.core.OptionalKey{:k :effective-type} (maybe (pred "Valid field type")), #schema.core.OptionalKey{:k :database-is-auto-increment} java.lang.Boolean, :base-type (pred "Valid field type"), #schema.core.OptionalKey{:k :pk?} java.lang.Boolean, #schema.core.OptionalKey{:k :database-required} java.lang.Boolean, :name (constrained Str "Non-blank string"), #schema.core.OptionalKey{:k :field-comment} (maybe (constrained Str "Non-blank string")), #schema.core.OptionalKey{:k :custom} {Any Any}, :database-type (maybe (constrained Str "Non-blank string")), #schema.core.OptionalKey{:k :nfc-path} [Any], #schema.core.OptionalKey{:k :coercion-strategy} (maybe (pred "Valid coercion strategy")), #schema.core.OptionalKey{:k :nested-fields} #{(recursive (var metabase.sync.interface/TableMetadataField))}, Keyword Any, #schema.core.OptionalKey{:k :semantic-type} (maybe (pred "Valid field semantic or relation type")), :database-position (constrained Int "Integer greater than or equal to zero")}}, #schema.core.OptionalKey{:k :description} (maybe Str)}, :value {:schema nil, :name "Leads", :fields #{{:name "User Modified Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 28} {:name "Leads Scoring Rule Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 22} {:name "Salutation", :database-type "java.lang.String", :base-type :type/Text, :database-position 52} {:name "Did the Client Sign Up?", :database-type "java.lang.String", :base-type :type/Text, :database-position 61} {:name "Created Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 11} {:name "Full Name", :database-type "java.lang.String", :base-type :type/Text, :database-position 13} {:name "Leads Scoring Rule Negative Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 24} {:name "Locked", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 34} {:name "Email Opt Out", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 17} {:name "Lead Source", :database-type "java.lang.String", :base-type :type/Text, :database-position 37} {:name "Company", :database-type "java.lang.String", :base-type :type/Text, :database-position 3} {:name "Did you pitch the Quantum?", :database-type "java.lang.String", :base-type :type/Text, :database-position 55} {:name "Street", :database-type "java.lang.String", :base-type :type/Text, :database-position 65} {:name "Last Activity Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 20} {:name "System Modified Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 39} {:name "Other Lead Source", :database-type "java.lang.String", :base-type :type/Text, :database-position 59} {:name "Number Of Chats", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 45} {:name "Leads Scoring Rule Negative Touch Point Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 27} {:name "System Related Activity Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 56} {:name "State", :database-type "java.lang.String", :base-type :type/Text, :database-position 38} {:name "Record Id", :database-type "java.lang.String", :base-type :type/Text, :database-position 1} {:name "Enrich Status", :database-type "java.lang.String", :base-type :type/Text, :database-position 47} {:name "Proposal Status", :database-type "java.lang.String", :base-type :type/Text, :database-position 63} {:name "Currency", :database-type "java.lang.String", :base-type :type/Text, :database-position 18} {:name "Mobile", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 35} {:name "Is Converted", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 33} {:name "Email", :database-type "java.lang.String", :base-type :type/Text, :database-position 7} {:name "Country", :database-type "java.lang.String", :base-type :type/Text, :database-position 16} {:name "Average Time Spent (Minutes)", :database-type "java.lang.Double", :base-type :type/Float, :database-position 42} {:name "Last Name", :database-type "java.lang.String", :base-type :type/Text, :database-position 5} {:name "Modified Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 12} {:name "_id", :database-type "org.bson.types.ObjectId", :base-type :type/MongoBSONID, :database-position 0, :pk? true} {:name "Created By Id", :database-type "java.lang.String", :base-type :type/Text, :database-position 9} {:name "Exchange Rate", :database-type "java.lang.Double", :base-type :type/Float, :database-position 19} {:name "Most Recent Visit", :database-type "java.lang.String", :base-type :type/Text, :database-position 43} {:name "Social Media", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 31} {:name "Zip Code", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 15} {:name "Did the Client submit the Brief?", :database-type "java.lang.String", :base-type :type/Text, :database-position 62} {:name "Referrer", :database-type "java.lang.String", :base-type :type/Text, :database-position 54, :semantic-type :type/URL} {:name "Title", :database-type "java.lang.String", :base-type :type/Text, :database-position 6} {:name "Designation", :database-type "clojure.lang.PersistentArrayMap", :base-type :type/Dictionary, :database-position 49, :nested-fields #{{:name "", :database-type "java.lang.String", :base-type :type/Text, :database-position 50}}} {:name "Leads Scoring Rule Positive Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 23} {:name "City", :database-type "java.lang.String", :base-type :type/Text, :database-position 14} {:name "Visitor Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 41} {:name "Project Creation", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 32} {:name "Layout Id", :database-type "java.lang.String", :base-type :type/Text, :database-position 21} {:name "Fax", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 64} {:name "Phone", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 48} {:name "Lead Status", :database-type "clojure.lang.PersistentArrayMap", :base-type :type/Dictionary, :database-position 57, :nested-fields #{{:name "", :database-type "java.lang.String", :base-type :type/Text, :database-position 58}}} {:name "Description", :database-type "java.lang.String", :base-type :type/Text, :database-position 60} {:name "Leads Scoring Rule Touch Point Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 26} {:name "Is Record Duplicate", :database-type "java.lang.Boolean", :base-type :type/Boolean, :database-position 30} {:name "User Related Activity Time", :database-type "java.lang.String", :base-type :type/Text, :database-position 36} {:name "Days Visited", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 46} {:name "Modified By Id", :database-type "java.lang.String", :base-type :type/Text, :database-position 10} {:name "Lead Owner Id", :database-type "java.lang.String", :base-type :type/Text, :database-position 2} {:name "Industry", :database-type "java.lang.String", :base-type :type/Text, :database-position 8} {:name "Website", :database-type "java.lang.String", :base-type :type/Text, :database-position 51, :semantic-type :type/URL} {:name "Referred By", :database-type "java.lang.String", :base-type :type/Text, :database-position 53} {:name "Record Approval Status", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 29} {:name "First Visit", :database-type "java.lang.String", :base-type :type/Text, :database-position 40} {:name "Leads Scoring Rule Positive Touch Point Score", :database-type "java.lang.Integer", :base-type :type/Integer, :database-position 25} {:name "First Page Visited", :database-type "java.lang.String", :base-type :type/Text, :database-position 44, :semantic-type :type/URL} {:name "First Name", :database-type "java.lang.String", :base-type :type/Text, :database-position 4}}}, :error {:fields #{{:nested-fields #{{:name (not ("Non-blank string" ""))}}} {:nested-fields #{{:name (not ("Non-blank string" ""))}}}}}}
	at metabase.sync.fetch_metadata$fn__83366$table_metadata__83371.invoke(fetch_metadata.clj:17)
	at metabase.sync.sync_metadata.fields.fetch_metadata$fn__83642$db_metadata__83647$fn__83648.invoke(fetch_metadata.clj:91)
	at metabase.sync.sync_metadata.fields.fetch_metadata$fn__83642$db_metadata__83647.invoke(fetch_metadata.clj:87)
	at metabase.sync.sync_metadata.fields$fn__84171$sync_fields_for_table_BANG___84180$fn__84183$fn__84184.invoke(fields.clj:73)
	at metabase.sync.util$do_with_error_handling.invokeStatic(util.clj:161)
	at metabase.sync.util$do_with_error_handling.invoke(util.clj:154)
	at metabase.sync.sync_metadata.fields$fn__84171$sync_fields_for_table_BANG___84180$fn__84183.invoke(fields.clj:72)
	at metabase.sync.sync_metadata.fields$fn__84171$sync_fields_for_table_BANG___84180.invoke(fields.clj:66)
	at clojure.core$partial$fn__5908.invoke(core.clj:2641)
	at clojure.core$map$fn__5935.invoke(core.clj:2770)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.RT.seq(RT.java:535)
	at clojure.core$seq__5467.invokeStatic(core.clj:139)
	at clojure.core$filter$fn__5962.invoke(core.clj:2826)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.Cons.next(Cons.java:39)
	at clojure.lang.RT.boundedLength(RT.java:1790)
	at clojure.lang.RestFn.applyTo(RestFn.java:130)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:662)
	at metabase.sync.sync_metadata.fields$fn__84210$sync_fields_BANG___84215$fn__84216.invoke(fields.clj:86)
	at metabase.sync.sync_metadata.fields$fn__84210$sync_fields_BANG___84215.invoke(fields.clj:78)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:662)
	at metabase.sync.util$fn__55915$run_step_with_metadata__55920$fn__55924$fn__55926.doInvoke(util.clj:379)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:103)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:97)
	at metabase.sync.util$with_start_and_finish_debug_logging.invokeStatic(util.clj:120)
	at metabase.sync.util$with_start_and_finish_debug_logging.invoke(util.clj:117)
	at metabase.sync.util$fn__55915$run_step_with_metadata__55920$fn__55924.invoke(util.clj:374)
	at metabase.sync.util$fn__55915$run_step_with_metadata__55920.invoke(util.clj:369)
	at metabase.sync.util$fn__56142$run_sync_operation__56147$fn__56148$fn__56156.invoke(util.clj:486)
	at metabase.sync.util$fn__56142$run_sync_operation__56147$fn__56148.invoke(util.clj:484)
	at metabase.sync.util$fn__56142$run_sync_operation__56147.invoke(util.clj:478)
	at metabase.sync.sync_metadata$fn__85755$sync_db_metadata_BANG___85760$fn__85761$fn__85762.invoke(sync_metadata.clj:60)
	at metabase.sync.util$do_with_error_handling.invokeStatic(util.clj:161)
	at metabase.sync.util$do_with_error_handling.invoke(util.clj:154)
	at clojure.core$partial$fn__5910.invoke(core.clj:2647)
	at metabase.driver.mongo$fn__120445$f__119411__auto____120446.invoke(mongo.clj:104)
	at metabase.driver.mongo.util$do_with_mongo_connection$fn__119399.invoke(util.clj:230)
	at metabase.util.ssh$do_with_ssh_tunnel.invokeStatic(ssh.clj:141)
	at metabase.util.ssh$do_with_ssh_tunnel.invoke(ssh.clj:130)
	at metabase.driver.mongo.util$do_with_mongo_connection.invokeStatic(util.clj:224)
	at metabase.driver.mongo.util$do_with_mongo_connection.invoke(util.clj:219)
	at metabase.driver.mongo$fn__120445.invokeStatic(mongo.clj:103)
	at metabase.driver.mongo$fn__120445.invoke(mongo.clj:101)
	at clojure.lang.MultiFn.invoke(MultiFn.java:239)
	at metabase.sync.util$sync_in_context$fn__55835.invoke(util.clj:139)
	at metabase.sync.util$with_db_logging_disabled$fn__55832.invoke(util.clj:130)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:103)
	at metabase.sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:97)
	at metabase.sync.util$with_start_and_finish_logging$fn__55819.invoke(util.clj:115)
	at metabase.sync.util$with_sync_events$fn__55814.invoke(util.clj:89)
	at metabase.sync.util$with_duplicate_ops_prevented$fn__55804.invoke(util.clj:68)
	at metabase.sync.util$do_sync_operation.invokeStatic(util.clj:182)
	at metabase.sync.util$do_sync_operation.invoke(util.clj:179)
	at metabase.sync.sync_metadata$fn__85755$sync_db_metadata_BANG___85760$fn__85761.invoke(sync_metadata.clj:59)
	at metabase.sync.sync_metadata$fn__85755$sync_db_metadata_BANG___85760.invoke(sync_metadata.clj:55)
	at metabase.api.database$fn__94897$fn__94898.invoke(database.clj:977)
	at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Thanks, there seems to be something weird on the data. Do you have any key with empty values?