Is pivot visualization erroneous in v56? Are there some blocking settings behind the scenes?

Very often, I’m building a query.

I look at the data in table view, to make sure I have the correct data.

I’ll summarize a bit, adding a count per something and another thing. Still looking in table view, all renders well.

I do have the option to switch to pivot. And then, I get the general response: “Error running query”.

And just like that, the only two options left for this query to visualise, are Table and Detail.

I switch back to Table, and I get my data back - PLUS all options to Visualise my data.

There’s nothing too funky about my data - it’s the pivot visualisation that has fallen into pieces, it seems.

Why can’t I render this easy data in pivot mode?

I'm believing it's due to visualization settings, rather than the query itself.
I'll explain.

Faulty query

I have this query, and edited already quite a bit. During these edits, I once switched to pivot table, and was dragging fields about.
Ever since, I got this error, and cannot switch back to pivot.

Query 1 definition:

Pivot view:

Fixed query - identical definition

From scratch I have reconstructed an identical query, and guess what: I can perfectly see my data in pivot style.

Query 2 definition:

Pivot view:

Now the 1 million $ — or € — question is: why can't I go to pivot in my first query? What is wrong with the visualization settings - and how could I fix that?

The example given is a simple query, but if it comprises many tables, custom fields etc, I don't want to do all that work again...

Update 2: simply duplicating the faulty query, copies the issue.
No pivot possible in the duplicate as well.

Is there anything in the Metabase log when you try to run the pivot query?

I see in the first query’s pivot view that no columns are selected in the configuration, but are there in the second query. That is strange.

That is indeed strange. And caused by the invisible faulty config.

And as yet impossible to get rid off.

I’ll see if I can find anything in the log.

same issue for us. downgraded to v55 and works fine

without logs we can’t do nothing

I’ll see if I can provide logs.

But I have this situation like every day. Can’t be so hard to spot. Can’t be so hard to reproduce.

Clearly not, or it would have been fixed by now.

Let’s collect some information and see if there are any common factors.

  • Metabase diagnostic info (Admin→Tools→Diagnostic info)
  • Hosting environment
  • Is an application firewall (WAF) in use
  • Are you routing through a proxy like Cloudflare
  • Database brand and version you are running the query against

Happened on MacOS and Linux. Both with DuckDB. One localhost, one remote

Both had IndexOutOfBound exceptions in the logs

(sorry i reverted them to 55 and haven’t tried again)

I also run into this issue in v56, did not have possibility to test it with another version.

Some Info I can share, hope it helps:

  • Metabase diagnostic info (Admin→Tools→Diagnostic info)

{ "browser-info": { "language": "de", "platform": "Win32", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0", "vendor": "Google Inc." }, "metabase-info": { "databases": [ "postgres", "h2", "mysql" ], "run-mode": "prod", "plan-alias": "", "version": { "date": "2025-09-17", "tag": "v0.56.6", "hash": "c168e71" }, "settings": { "report-timezone": null }, "hosting-env": "unknown", "application-database": "postgres", "application-database-details": { "database": { "name": "PostgreSQL", "version": "16.10" }, "jdbc-driver": { "name": "PostgreSQL JDBC Driver", "version": "42.7.7" } } }, "system-info": { "file.encoding": "UTF-8", "java.runtime.name": "OpenJDK Runtime Environment", "java.runtime.version": "21.0.8+9-LTS", "java.vendor": "Eclipse Adoptium", "java.vendor.url": "https://adoptium.net/", "java.version": "21.0.8", "java.vm.name": "OpenJDK 64-Bit Server VM", "java.vm.version": "21.0.8+9-LTS", "os.name": "Linux", "os.version": "6.1.146.1-microsoft-standard", "user.language": "en", "user.timezone": "GMT" } }

  • Hosting environment

–> Docker

  • Is an application firewall (WAF) in use

–> no

  • Are you routing through a proxy like Cloudflare

–> No

  • Database brand and version you are running the query against

–> PostgreSQL 16.10

Query in Table form:

When clicking

SELECT
  "Bcm Service - Bcm Service Obj"."bcm_service_id" AS "Bcm Service - Bcm Service Obj__bcm_service_id",
  COUNT(*) AS "count"
FROM
  "public"."bcr_connection"
 
LEFT JOIN (
    SELECT
      "public"."bu_benutzer"."aenderungbenutzer" AS "aenderungbenutzer",
      "public"."bu_benutzer"."aenderungdatum" AS "aenderungdatum",
      "public"."bu_benutzer"."aenderungzeit" AS "aenderungzeit",
      "public"."bu_benutzer"."benutzer" AS "benutzer",
      "public"."bu_benutzer"."ldap_id" AS "ldap_id",
      "public"."bu_benutzer"."name" AS "name",
      "public"."bu_benutzer"."suchname" AS "suchname",
      "public"."bu_benutzer"."geburtstag" AS "geburtstag",
      "public"."bu_benutzer"."kurzzeichen" AS "kurzzeichen",
      "public"."bu_benutzer"."mitarbeiter" AS "mitarbeiter",
      "public"."bu_benutzer"."telefon" AS "telefon",
      "public"."bu_benutzer"."telefax" AS "telefax",
      "public"."bu_benutzer"."email" AS "email",
      "public"."bu_benutzer"."abteilung" AS "abteilung",
      "public"."bu_benutzer"."stellvertreter" AS "stellvertreter",
      "public"."bu_benutzer"."handlungsbefugnis" AS "handlungsbefugnis",
      "public"."bu_benutzer"."aktive_firma" AS "aktive_firma",
      "public"."bu_benutzer"."freigegebene_firmen" AS "freigegebene_firmen",
      "public"."bu_benutzer"."isactive" AS "isactive",
      "public"."bu_benutzer"."isb2buser" AS "isb2buser",
      "public"."bu_benutzer"."hasdevpriviledges" AS "hasdevpriviledges",
      "public"."bu_benutzer"."hasaccesstoupdateprograms" AS "hasaccesstoupdateprograms",
      "public"."bu_benutzer"."hasupdatepriviledges" AS "hasupdatepriviledges",
      "public"."bu_benutzer"."sachbearbeiter" AS "sachbearbeiter",
      "public"."bu_benutzer"."sprache" AS "sprache",
      "public"."bu_benutzer"."letzte_passwortaenderung" AS "letzte_passwortaenderung",
      "public"."bu_benutzer"."pwgueltigkeit" AS "pwgueltigkeit",
      "public"."bu_benutzer"."passwortaendern" AS "passwortaendern",
      "public"."bu_benutzer"."minpwlaenge" AS "minpwlaenge",
      "public"."bu_benutzer"."passwort" AS "passwort",
      "public"."bu_benutzer"."anlagebenutzer" AS "anlagebenutzer",
      "public"."bu_benutzer"."anlagedatum" AS "anlagedatum",
      "public"."bu_benutzer"."anlagezeit" AS "anlagezeit",
      "public"."bu_benutzer"."bu_benutzer_obj" AS "bu_benutzer_obj",
      "public"."bu_benutzer"."dbm_navmenu_obj" AS "dbm_navmenu_obj",
      "public"."bu_benutzer"."certificatefingerprint" AS "certificatefingerprint",
      "public"."bu_benutzer"."hassignaturepriviledges" AS "hassignaturepriviledges",
      "public"."bu_benutzer"."emailfrom" AS "emailfrom",
      "public"."bu_benutzer"."useraccountid" AS "useraccountid",
      "public"."bu_benutzer"."failedloginscount" AS "failedloginscount",
      "public"."bu_benutzer"."bpmuserid" AS "bpmuserid",
      "public"."bu_benutzer"."limitedfrom" AS "limitedfrom",
      "public"."bu_benutzer"."limitedto" AS "limitedto",
      "public"."bu_benutzer"."h_ekaer_login" AS "h_ekaer_login",
      "public"."bu_benutzer"."h_ekaer_password" AS "h_ekaer_password"
    FROM
      "public"."bu_benutzer"
  ) AS "Bu Benutzer - Bu Benutzer Obj" ON "public"."bcr_connection"."bu_benutzer_obj" = "Bu Benutzer - Bu Benutzer Obj"."bu_benutzer_obj"
  LEFT JOIN (
    SELECT
      "public"."bcm_service"."bcm_service_id" AS "bcm_service_id",
      "public"."bcm_service"."bcm_service_obj" AS "bcm_service_obj",
      "public"."bcm_service"."servicetype" AS "servicetype",
      "public"."bcm_service"."maxidletime" AS "maxidletime"
    FROM
      "public"."bcm_service"
  ) AS "Bcm Service - Bcm Service Obj" ON "public"."bcr_connection"."bcm_service_obj" = "Bcm Service - Bcm Service Obj"."bcm_service_obj"
WHERE
  (
    "Bcm Service - Bcm Service Obj"."bcm_service_id" = 'GUI'
  )
 
    OR (
    "Bcm Service - Bcm Service Obj"."bcm_service_id" = 'WebUI'
  )
GROUP BY
  "Bcm Service - Bcm Service Obj"."bcm_service_id"
ORDER BY
  "Bcm Service - Bcm Service Obj"."bcm_service_id" ASC

When clicking on

Result:

Admin –>Tools–> Logs

[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:42+01:00 DEBUG metabase.server.middleware.log GET /api/session/properties 200 3529ms (13 DB calls) App DB connections: 5/14 Jetty threads: 7/50 (0 idle, 0 queued) (129 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:42+01:00 DEBUG metabase.server.middleware.log GET /api/collection/root 200 1166ms (3 DB calls) App DB connections: 1/14 Jetty threads: 7/50 (0 idle, 0 queued) (129 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:42+01:00 DEBUG metabase.server.middleware.log GET /api/database 200 1931ms (2 DB calls) App DB connections: 1/14 Jetty threads: 6/50 (1 idle, 0 queued) (129 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:42+01:00 DEBUG metabase.server.middleware.log GET /api/collection/trash 200 1947ms (3 DB calls) App DB connections: 0/14 Jetty threads: 6/50 (1 idle, 0 queued) (129 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:42+01:00 DEBUG metabase.server.middleware.log GET /api/collection/tree 200 1204ms (4 DB calls) App DB connections: 0/14 Jetty threads: 6/50 (1 idle, 0 queued) (129 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:43+01:00 DEBUG metabase.server.middleware.log GET /api/bookmark 200 22ms (1 DB calls) App DB connections: 3/14 Jetty threads: 6/50 (2 idle, 0 queued) (131 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:43+01:00 DEBUG metabase.server.middleware.log GET /api/user-key-value/namespace/user_acknowledgement/key/upsell-dev_instances 204 13ms (1 DB calls) App DB connections: 3/14 Jetty threads: 7/50 (1 idle, 0 queued) (131 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:43+01:00 DEBUG metabase.server.middleware.log GET /api/setting/version-info 200 517ms (0 DB calls) App DB connections: 3/14 Jetty threads: 7/50 (2 idle, 0 queued) (131 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:43+01:00 DEBUG metabase.server.middleware.log GET /api/search 200 547ms (6 DB calls) App DB connections: 1/14 Jetty threads: 7/50 (2 idle, 0 queued) (131 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:43+01:00 DEBUG metabase.server.middleware.log GET /api/bug-reporting/details 200 10ms (1 DB calls) App DB connections: 3/14 Jetty threads: 6/50 (3 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:44+01:00 DEBUG metabase.server.middleware.log GET /api/task/unique-tasks 200 988ms (1 DB calls) App DB connections: 5/15 Jetty threads: 7/50 (1 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:44+01:00 DEBUG metabase.server.middleware.log GET /api/setting 200 1574ms (16 DB calls) App DB connections: 3/15 Jetty threads: 7/50 (1 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:44+01:00 DEBUG metabase.server.middleware.log GET /api/task/info 200 39ms (0 DB calls) App DB connections: 4/15 Jetty threads: 6/50 (2 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:45+01:00 DEBUG metabase.server.middleware.log GET /api/task 200 1072ms (2 DB calls) App DB connections: 1/15 Jetty threads: 5/50 (3 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:45+01:00 DEBUG metabase.server.middleware.log GET /api/activity/recents 200 2335ms (28 DB calls) App DB connections: 2/15 Jetty threads: 4/50 (4 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:47+01:00 DEBUG metabase.server.middleware.log GET /api/task 200 32ms (2 DB calls) App DB connections: 0/15 Jetty threads: 4/50 (4 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued) {:metabase-user-id 1}
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:49+01:00 ERROR metabase.query-processor.middleware.catch-exceptions Error processing query: Error running query
{:database_id 2,
 :parameterized false,
 :started_at #t "2025-12-19T09:52:33.394972804Z[GMT]",
 :action_id nil,
 :json_query
 {:constraints {:max-results 10000, :max-results-bare-rows 2000},
  :lib/type :mbql/query,
  :pivot-rows [0],
  :qp.pivot/breakout-combination [],
  :lib/metadata
  (metabase.lib.metadata.invocation-tracker/invocation-tracker-provider (metabase.lib.metadata.cached-provider/cached-metadata-provider (metabase.lib-be.metadata.jvm/->UncachedApplicationDatabaseMetadataProvider 2))),
  :stages
  [{:lib/type :mbql.stage/mbql,
    :source-table 287,
    :joins
    [{:fields
      [[:field
        {:base-type :type/Text,
         :join-alias "Bu Benutzer - Bu Benutzer Obj",
         :lib/uuid "33e7c600-909e-49bb-a5f5-e9e817619d1d",
         :effective-type :type/Text}
        5020]],
      :strategy :left-join,
      :alias "Bu Benutzer - Bu Benutzer Obj",
      :conditions
      [[:=
        {:lib/uuid "6e75fdb0-7a50-4bb8-8d44-d2e17ae16a06"}
        [:field
         {:base-type :type/Text, :lib/uuid "6252051b-e800-40e3-bbfa-7ab1db1dba71", :effective-type :type/Text}
         5727]
        [:field
         {:base-type :type/Text,
          :join-alias "Bu Benutzer - Bu Benutzer Obj",
          :lib/uuid "bcc86f19-9d3f-48a3-bd6e-6ece83e4016a",
          :effective-type :type/Text}
         4996]]],
      :lib/type :mbql/join,
      :stages [{:lib/type :mbql.stage/mbql, :source-table 271}],
      :lib/options {:lib/uuid "c051acaa-39af-494b-8833-ac7757e8a37d"}}
     {:fields
      [[:field
        {:base-type :type/Text,
         :join-alias "Bcm Service - Bcm Service Obj",
         :lib/uuid "334bd9b7-7bfc-4aa1-8a18-48fd2e0a94bc",
         :effective-type :type/Text}
        5723]],
      :strategy :left-join,
      :alias "Bcm Service - Bcm Service Obj",
      :conditions
      [[:=
        {:lib/uuid "149cb518-72e0-4e49-92e3-f32bc4938516"}
        [:field
         {:base-type :type/Text, :lib/uuid "b565a19a-86a1-42bc-b511-e058afdbc9fd", :effective-type :type/Text}
         5747]
        [:field
         {:base-type :type/Text,
          :join-alias "Bcm Service - Bcm Service Obj",
          :lib/uuid "828d6b28-c670-435a-a070-2ba27d63d111",
          :effective-type :type/Text}
         5724]]],
      :lib/type :mbql/join,
      :stages [{:lib/type :mbql.stage/mbql, :source-table 288}],
      :lib/options {:lib/uuid "d2a633bc-eea4-4217-a615-32fe90ab7489"}}],
    :fields
    [[:field
      {:base-type :type/Text, :lib/uuid "67c89d50-5a75-4697-a33b-75e56d1a89e8", :effective-type :type/Text}
      5735]],
    :aggregation [[:count {:lib/uuid "34a62a98-ed4d-4d71-baf5-8dc1c0ba01f7"}]],
    :filters
    [[:in
      {:lib/uuid "51a59137-3f53-4105-a3ff-c1bbdce13f88"}
      [:field
       {:base-type :type/Text,
        :join-alias "Bcm Service - Bcm Service Obj",
        :lib/uuid "272c4ceb-a7be-429d-ae00-0ad5eb73a954",
        :effective-type :type/Text}
       5723]
      "GUI"
      "WebUI"]],
    :expressions [[:abs {:lib/uuid "8d14e2d9-9860-413e-9b63-10561769fa35", :lib/expression-name "pivot-grouping"} 1]],
    :breakout
    [[:expression
      {:lib/uuid "813a6750-36f3-42d8-9e72-abc755bfc916", :base-type :type/Integer, :effective-type :type/Integer}
      "pivot-grouping"]]}],
  :show-row-totals false,
  :middleware
  {:pivot-options {:pivot-rows [0], :show-row-totals false, :show-column-totals true}, :userland-query? true},
  :lib.convert/converted? true,
  :database 2,
  :show-column-totals true},
 :status :failed,
 :class java.lang.IndexOutOfBoundsException,
 :stacktrace
 ["clojure.lang.PersistentVector.arrayFor(PersistentVector.java:162)"
  "clojure.lang.PersistentVector.nth(PersistentVector.java:166)"
  "clojure.lang.RT.nth(RT.java:916)"
  "--> query_processor.pivot$row_mapping_fn$iter__86712__86716$fn__86717$fn__86718$fn__86719.invoke(pivot.clj:249)"
  "util.performance$juxt_STAR_$fn__9296$fn__9299.invoke(performance.cljc:199)"
  "util.performance$apply_and_small...
[6e0cc94e-885d-4997-8ed4-941b3eb73ceb] 2025-12-19T10:52:49+01:00 DEBUG metabase.server.middleware.log POST /api/dataset/pivot 202 [ASYNC: completed] 23462ms (17 DB calls) App DB connections: 0/15 Jetty threads: 2/50 (6 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued); postgres DB 2 connections: 0/1 (0 threads blocked) {:metabase-user-id 1}

@JoeD

Can you open the visualization settings panel and show us how the pivot table is set up when you get this error?

Also, can you reproduce this on a newer point version of v56? 56.6 is 3 months old and I’m pretty sure pivot tables got some work done on them between then and now.

@dwhitemv ,

these are the visualization settings:

I’ll see if I can get this updated, as this is our coperate installation…also also just see that .57 is released so I will get this updated (in the next days)

Then I will also retry this.

The pivot viz didn’t identify any valid rows/columns/measures, that’s why you’re getting the error.

The sample query you provided doesn’t seem to gain any value from a pivot as it’s just a 2x2 table. Pivots usually have a metric to pivot around that can be summed and thus collapsed into categories.

Were you trying to transpose it (turn the columns into rows and vice versa)?

1 Like

@dwhitemv , this explanation makes perfect sense.

I like to use the pivot visualization to sum up data.

E.g. from the example I came up with earlier:

I just want a way to show the sum/total easily.
So for this case i wanted it to display 74.

Am I missing something?

I also updated to v0.57.6 today (which came when I used --image metabase/metabase:latest .. I thoughts I would get 57.7 with that, according to Releases · metabase/metabase · GitHub , there 57.7 is marked as latest release)

In 57.6 the situation is the same

Metabase’s concept of pivot tables is a bit complicated. It isn’t going to grok a 2x2 table, as I said; you need at least 2 dimensions for it to set up the pivot.

If you want a total, either create a custom summary column with a cumulative sum, or put your query in a CTE, output the query and UNION ALL a total row, something like:

WITH cte AS (
SELECT ...
)

SELECT service, count FROM cte
UNION ALL
SELECT 'Total', sum(count) from cte

The Metabase folks will tell you not to rely on ‘latest’ Docker tags as tags are sticky and won’t update unless you force a pull. If you want a specific version, pull that version.