No fields found for table "orderItems"

Browse data -> particular database -> few tables, always getting the message

There was a problem with your question
Most of the time this is caused by an invalid selection or bad input value. Double check your inputs and retry your query.

Hide error details
Here's the full error message
No fields found for table "orderItems".

But finding the data when I run sql like - "select * from orders"

I'm using

  • metabase docker latest
  • postgres db latest

Log

   {:database_id 2,
 :started_at #t "2022-05-09T11:57:16.504794Z[GMT]",
 :error_type :invalid-query,
 :json_query
 {:database 2,
  :query {:source-table 7},
  :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__51123$sorted_implicit_fields_for_table__51128$fn__51129.invoke(add_implicit_clauses.clj:47)"
  "query_processor.middleware.add_implicit_clauses$fn__51123$sorted_implicit_fields_for_table__51128.invoke(add_implicit_clauses.clj:41)"
  "query_processor.middleware.add_implicit_clauses$fn__51247$add_implicit_fields__51252$fn__51256.invoke(add_implicit_clauses.clj:107)"
  "query_processor.middleware.add_implicit_clauses$fn__51247$add_implicit_fields__51252.invoke(add_implicit_clauses.clj:100)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses$fn__51330.invoke(add_implicit_clauses.clj:150)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses.invokeStatic(add_implicit_clauses.clj:143)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_mbql_clauses.invoke(add_implicit_clauses.clj:140)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_clauses.invokeStatic(add_implicit_clauses.clj:160)"
  "query_processor.middleware.add_implicit_clauses$add_implicit_clauses.invoke(add_implicit_clauses.clj:154)"
  "query_processor$preprocess_STAR_$fn__52890.invoke(query_processor.clj:124)"
  "query_processor$preprocess_STAR_.invokeStatic(query_processor.clj:122)"
  "query_processor$preprocess_STAR_.invoke(query_processor.clj:117)"
  "query_processor$fn__52898$combined_pre_process__52899$combined_pre_process_STAR___52900.invoke(query_processor.clj:204)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51346$fn__51351.invoke(resolve_database_and_driver.clj:35)"
  "driver$do_with_driver.invokeStatic(driver.clj:75)"
  "driver$do_with_driver.invoke(driver.clj:71)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51346.invoke(resolve_database_and_driver.clj:34)"
  "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__47451.invoke(fetch_source_query.clj:281)"
  "query_processor.middleware.store$initialize_store$fn__47639$fn__47640.invoke(store.clj:11)"
  "query_processor.store$do_with_store.invokeStatic(store.clj:44)"
  "query_processor.store$do_with_store.invoke(store.clj:38)"
  "query_processor.middleware.store$initialize_store$fn__47639.invoke(store.clj:10)"
  "query_processor.middleware.normalize_query$normalize$fn__51618.invoke(normalize_query.clj:22)"
  "query_processor.middleware.constraints$add_default_userland_constraints$fn__48708.invoke(constraints.clj:52)"
  "query_processor.middleware.process_userland_query$process_userland_query$fn__51557.invoke(process_userland_query.clj:145)"
  "query_processor.middleware.catch_exceptions$catch_exceptions$fn__51929.invoke(catch_exceptions.clj:162)"
  "query_processor.reducible$async_qp$qp_STAR___44179$thunk__44181.invoke(reducible.clj:100)"
  "query_processor.reducible$async_qp$qp_STAR___44179.invoke(reducible.clj:106)"
  "query_processor.reducible$async_qp$qp_STAR___44179.invoke(reducible.clj:91)"
  "query_processor.reducible$sync_qp$qp_STAR___44190.doInvoke(reducible.clj:126)"
  "query_processor$process_userland_query.invokeStatic(query_processor.clj:326)"
  "query_processor$process_userland_query.doInvoke(query_processor.clj:322)"
  "query_processor$fn__52945$process_query_and_save_execution_BANG___52954$fn__52957.invoke(query_processor.clj:337)"
  "query_processor$fn__52945$process_query_and_save_execution_BANG___52954.invoke(query_processor.clj:330)"
  "query_processor$fn__52989$process_query_and_save_with_max_results_constraints_BANG___52998$fn__53001.invoke(query_processor.clj:349)"
  "query_processor$fn__52989$process_query_and_save_with_max_results_constraints_BANG___52998.invoke(query_processor.clj:342)"
  "api.dataset$run_query_async$fn__66603.invoke(dataset.clj:68)"
  "query_processor.streaming$streaming_response_STAR_$fn__39302$fn__39303.invoke(streaming.clj:162)"
  "query_processor.streaming$streaming_response_STAR_$fn__39302.invoke(streaming.clj:161)"
  "async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
  "async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
  "async.streaming_response$do_f_async$task__18948.invoke(streaming_response.clj:84)"],
 :card_id nil,
 :context :ad-hoc,
 :error "No fields found for table \"orders\".",
 :row_count 0,
 :running_time 0,
 :preprocessed nil,
 :ex-data {:table-id 7, :type :invalid-query},
 :data {:rows [], :cols []}}

I'm new to metabase need yours help badly.

Hi @shihab

Post "Diagnostic Info" from Admin > Troubleshooting.

Do you have JSON columns in the table "orders"?

Run a manual sync via Admin > Databases, and look in the log Admin > Troubleshooting > Logs.
https://www.metabase.com/docs/latest/troubleshooting-guide/cant-see-tables.html

1 Like

Yes i got JSON columns in the table "orders".
But i can also see few tables which has JSON columns too. and i can see all tables there but in case of few tables i can't see the columns. Ran manual sync few times but the result is same.

Here is the Diagnostic 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/101.0.4951.54 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.15+10",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.15",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.15+10",
    "os.name": "Linux",
    "os.version": "5.4.0-109-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "13.4"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.3.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-05-02",
      "tag": "v0.43.0",
      "branch": "release-x.43.x",
      "hash": "ee686fc"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

@flamber according to the logs after running the manual sync what I see is it's problem with JSON, JSON array, and ENUM type columns.

Please help me on this ??

few lines from the logs

Don't know how to map column type 'products_status_enum' to a Field base_type

[967e8c1e-7dc7-43b3-8e83-b4d1ed7e5494] 2022-05-10T11:20:00+06:00 WARN metabase.sync.util Error syncing Fields for Table 'Table 35 'public.careerApplications''
org.postgresql.util.PSQLException: ERROR: relation "careerapplications" does not exist
  Position: 37

@shihab You are seeing this issue, which is being worked on:
https://github.com/metabase/metabase/issues/22448 - upvote by clicking :+1: on the first post

1 Like

@flamber Was this fixed? If so, in what version?

Thanks

@Josef Click the issue I've linked. If it is closed, then check the sidebar to see the Milestone version. If it is open, then it's not implemented.