Unable to browse database tables

Hello,

Software looks amazing but unfortunately I’m having trouble even browsing the data in MySQL 5.5 or Mariadb 10.

Both give me this error:
Distinct, non-empty sequence of Field clauses

This happens without trying to create a custom report or anything. I click on the DB, click on any table and immediately get this error.

A RAW SQL query does indeed return data from the tables correctly.

:native nil,
:status :failed,
:class clojure.lang.ExceptionInfo,
:stacktrace
("--> query_processor$fn__44044$receive_native_query__44049$fn__44050.invoke(query_processor.clj:236)"
"query_processor$query__GT_preprocessed.invokeStatic(query_processor.clj:257)"
"query_processor$query__GT_preprocessed.invoke(query_processor.clj:243)"
"query_processor$query__GT_native_with_spliced_params.invokeStatic(query_processor.clj:294)"
"query_processor$query__GT_native_with_spliced_params.invoke(query_processor.clj:284)"
"api.dataset$fn__47690.invokeStatic(dataset.clj:182)"
"api.dataset$fn__47690.invoke(dataset.clj:179)"
"middleware.auth$enforce_authentication$fn__64168.invoke(auth.clj:14)"
"routes$fn__65545$fn__65546.doInvoke(routes.clj:56)"
"middleware.exceptions$catch_uncaught_exceptions$fn__64267.invoke(exceptions.clj:104)"
"middleware.exceptions$catch_api_exceptions$fn__64264.invoke(exceptions.clj:92)"
"middleware.log$log_api_call$fn__65919$fn__65920.invoke(log.clj:170)"
"middleware.log$log_api_call$fn__65919.invoke(log.clj:164)"
"middleware.security$add_security_headers$fn__64230.invoke(security.clj:122)"
"middleware.json$wrap_json_body$fn__65624.invoke(json.clj:61)"
"middleware.json$wrap_streamed_json_response$fn__65642.invoke(json.clj:97)"
"middleware.session$bind_current_user$fn__60792$fn__60793.invoke(session.clj:209)"
"middleware.session$do_with_current_user.invokeStatic(session.clj:184)"
"middleware.session$do_with_current_user.invoke(session.clj:177)"
"middleware.session$bind_current_user$fn__60792.invoke(session.clj:208)"
"middleware.session$wrap_current_user_id$fn__60777.invoke(session.clj:161)"
"middleware.session$wrap_session_id$fn__60762.invoke(session.clj:123)"
"middleware.auth$wrap_api_key$fn__64176.invoke(auth.clj:27)"
"middleware.misc$maybe_set_site_url$fn__65946.invoke(misc.clj:56)"
"middleware.misc$bind_user_locale$fn__65949.invoke(misc.clj:72)"
"middleware.misc$add_content_type$fn__65934.invoke(misc.clj:28)"
"middleware.misc$disable_streaming_buffering$fn__65957.invoke(misc.clj:87)"),
:error "Distinct, non-empty sequence of Field clauses",
:query {:type "query", :query {:source-table 352}, :middleware {:disable-mbql->native? true}, :preprocessing-level 1},
:preprocessed nil,
:ex-data {:type :schema.core/error, :value (), :error (named (not ("Non-empty" a-clojure.lang.LazySeq)) "Distinct, non-empty sequence of Field clauses")},
:message "Error preprocessing query"}```

General info:
```{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.3+7",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.3",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.3+7",
    "os.name": "Linux",
    "os.version": "5.3.0-23-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "mysql"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "run-mode": "prod",
    "version": {
      "date": "2019-11-13",
      "tag": "v0.33.5.1",
      "branch": "release-0.33.x",
      "hash": "26159d2"
    },
    "settings": {
      "report-timezone": null
    }
  }
}```

Hi @davegohyperion
Please post the Diagnostic Info from Admin > Troubleshooting.
Did Metabase finish scanning the database? You should see log entries of the scanning process. Admin > Troubleshooting > Logs.
Try running a forced sync+scan again, and check the log for any problems.
Admin > Databases > (db) > Sync database schema now + Re-scan field values now

Maybe it hasn’t finished yet because I don’t see a log entry of it completing the scan. I’ll force a rescan. It is a large DB so maybe that is the issue.

If so, sorry for wasting your time :slight_smile:

I’ll update tomorrow if the scan completes and it still isn’t working.

Oh sorry the diagnostic info got buried in the first post, here it is:

  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.3+7",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.3",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.3+7",
    "os.name": "Linux",
    "os.version": "5.3.0-23-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "mysql"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "run-mode": "prod",
    "version": {
      "date": "2019-11-13",
      "tag": "v0.33.5.1",
      "branch": "release-0.33.x",
      "hash": "26159d2"
    },
    "settings": {
      "report-timezone": null
    }
  }
}```

@davegohyperion Okay, I don’t know what you consider a large database, but Metabase has to chunk through all the tables and columns, so it can provide the graphical interface. And yes, that process can take a lot of time (specially first time).
Don’t run a forced sync/scan, if it’s still syncing - just check the log for updates.
If you see any errors, then those are of interest.

Also, please be careful of using H2 application database (metadata) in production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html