Same query returns different number of rows

Hey @flamber!

Thanks for providing some guidance back in March.

I managed to fix this today.

For anyone who happens to land here:

Context

My infra was setup like this:
Client -> Haproxy -> EC2 Instance running Metabase Docker

TL:DR

Issue: Haproxy (proxy/load balancer) setting

I had the following setting in Haproxy:

frontend web-http
  bind *:80
  # ...
  option http-server-close

Offending line was option http-server-close

Changed it to option http-keep-alive and managed to have correct number of rows returned for my queries.

Longer Story
From reading metabase logs, I saw that I was getting ClosedChannelException

This indicated to me that it's a network issue.

After coming across the following links:

I figured it was a network issue, and not a metabase issue.

  1. Check the metabase webserver (jetty) error logs
  2. Cross reference the errors reported and how you setup your infra

If you face the same issue, it could be a network setting in your infra because metabase uses a buffer to send the data to your client.

1 Like