"Rollback failed handling \"(conn=3405924) (conn=3405924) unexpected end of stream, read 0 bytes from 7 (socket was closed by server)\"

We are getting this error when we try to download the output of a query as CSV. The query is a long running one, and takes about 4 mins to return the output, however the number of rows are only 400k. Metabase is running on H2 db on a dedicated centos 7 machine with 2vCPUs and 7.5GB RAM, Metabase version is 0.32.7. We were getting the below similar error till yesterday >>

error message (conn=3334637) unexpected end of stream, read 0 bytes from 7 (socket was closed by server)

In order to fix that I added below environment variables (in bold)>>

java -Xmx5g -Dc3p0.maxIdleTime=250 -Dc3p0.idleConnectionTestPeriod=250 -jar metabase .jar

Can someone please let me know if I am missing anything or any configuration change that can be done to fix this? Any help would be highly appreciated. Please find the stack trace below:

{:type “query”,
:query {:source-table “card__4”},
:parameters [],
:async? true,
:middleware {:userland-query? true, :skip-results-metadata? true},
:info
{:executed-by 66,
:context :csv-download,
:query-hash [-15, -106, -77, 68, -67, 114, -128, 104, -64, -6, 127, 26, -55, 114, -70, 114, -47, 6, -34, 39, 70, 95, -102, -73, -86, 34, -109, -59, 71, -38, -17, 71]}},
:preprocessed
{:source-metadata
[{:name “created_date”,
:display_name “Created Date”,
:base_type :type/DateTime,
:special_type :type/CreationTimestamp,
:fingerprint {:global {:distinct-count 535, :nil% 0.0}, :type {:type/DateTime {:earliest “2020-01-20T18:33:20.000Z”, :latest “2020-01-20T21:36:37.000Z”}}}}
{:name “accounting_period”,
:display_name “Accounting Period”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 1, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 7.0}}}}
{:name “journal_id”,
:display_name “Journal ID”,
:base_type :type/Integer,
:fingerprint
{:global {:distinct-count 2000, :nil% 0.0},
:type {:type/Number {:min 4.3216249E7, :max 4.3225353E7, :avg 4.32237899295E7, :sd 1629.3726595383353, :q1 4.3223803857191116E7, :q3 4.322483365476076E7}}}}
{:name “accounting_rule_id”,
:display_name “Accounting Rule ID”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 6, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 31.386}}}}
{:name “fgl_account_id”,
:display_name “Fgl Account ID”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 1988, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 11.987}}}}
{:name “eztaxi_driver_id”,
:display_name “Ez Taxi Driver ID”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 1988, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 4.987}}}}
{:name “job_id”,
:display_name “Job ID”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 1, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 1.0}}}}
{:name “accounting_entry”,
:display_name “Accounting Entry”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 2, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 5.0335}}}}
{:name “currency_type_id”,
:display_name “Currency Type ID”,
:base_type :type/Text,
:fingerprint {:global {:distinct-count 1, :nil% 0.0}, :type {:type/Text {:percent-json 0.0, :percent-url 0.0, :percent-email 0.0, :average-length 3.0}}}}
{:name “amount”,
:display_name “Amount”,
:base_type :type/Decimal,
:special_type :type/Income,
:fingerprint
{:global {:distinct-count 82, :nil% 0.0}, :type {:type/Number {:min -10350.0, :max 2500.0, :avg 131.66033000000002, :sd 342.9669914101084, :q1 92.25115837953851, :q3 241.5056386316379}}}}],
:settings {},
:type :query,
:middleware {:userland-query? true, :skip-results-metadata? true},
:info
{:executed-by 66,
:context :csv-download,
:query-hash [-15, -106, -77, 68, -67, 114, -128, 104, -64, -6, 127, 26, -55, 114, -70, 114, -47, 6, -34, 39, 70, 95, -102, -73, -86, 34, -109, -59, 71, -38, -17, 71]},
:database 2,
:driver :mysql,
:query
{:source-query
{:native
“select p.created_date as ‘created_date’,\r\n p.accounting_period as ‘accounting_period’,\r\n p.journal_id as ‘journal_id’,\r\n p.accounting_rule_id as ‘accounting_rule_id’,\r\n p.account_id as ‘fgl_account_id’,\r\n a.reference_id as ‘eztaxi_driver_id’,\r\n p.reference_id as ‘job_id’,\r\n p.accounting_entry as ‘accounting_entry’,\r\n p.currency_type_id as ‘currency_type_id’,\r\n p.amount as ‘amount’\r\nfrom fgl_posting p inner join fgl_account a on p.account_id = a.account_id\r\nwhere upper(p.account_id) like ‘DRIVER%’\r\n and\r\n lower(p.accounting_rule_id) not in (‘job_completed_card_payment_delivery_fee_rule’, ‘job_completed_card_payment_rule’)\r\n and\r\n date (p.created_date) = date(date_add(now(), INTERVAL -1 day))\r\norder by p.reference_id, p.created_date;”},
:limit 1048576}},
:native
{:query
“SELECT * FROM (select p.created_date as ‘created_date’,\r\n p.accounting_period as ‘accounting_period’,\r\n p.journal_id as ‘journal_id’,\r\n p.accounting_rule_id as ‘accounting_rule_id’,\r\n p.account_id as ‘fgl_account_id’,\r\n a.reference_id as ‘eztaxi_driver_id’,\r\n p.reference_id as ‘job_id’,\r\n p.accounting_entry as ‘accounting_entry’,\r\n p.currency_type_id as ‘currency_type_id’,\r\n p.amount as ‘amount’\r\nfrom fgl_posting p inner join fgl_account a on p.account_id = a.account_id\r\nwhere upper(p.account_id) like ‘DRIVER%’\r\n and\r\n lower(p.accounting_rule_id) not in (‘job_completed_card_payment_delivery_fee_rule’, ‘job_completed_card_payment_rule’)\r\n and\r\n date (p.created_date) = date(date_add(now(), INTERVAL -1 day))\r\norder by p.reference_id, p.created_date) source LIMIT 1048576”,
:params nil},
:ex-data {:rollback #error {
:cause “Connection is closed”
:via
[{:type java.sql.SQLNonTransientConnectionException
:message “(conn=3405924) (conn=3405924) Connection is closed”
:at [org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper get “ExceptionMapper.java” 234]}
{:type java.sql.SQLNonTransientConnectionException
:message “(conn=3405924) Connection is closed”
:at [org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper get “ExceptionMapper.java” 234]}
{:type java.sql.SQLException
:message “Connection is closed”
:at [org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol cmdPrologue “AbstractQueryProtocol.java” 1801]}]
:trace
[[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol cmdPrologue “AbstractQueryProtocol.java” 1801]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol executeQuery “AbstractQueryProtocol.java” 212]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol executeQuery “AbstractQueryProtocol.java” 197]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol setMaxRows “AbstractQueryProtocol.java” 1320]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol prolog “AbstractQueryProtocol.java” 1760]
[org.mariadb.jdbc.MariaDbStatement executeQueryPrologue “MariaDbStatement.java” 191]
[org.mariadb.jdbc.MariaDbStatement executeInternal “MariaDbStatement.java” 339]
[org.mariadb.jdbc.MariaDbStatement execute “MariaDbStatement.java” 407]
[org.mariadb.jdbc.MariaDbConnection rollback “MariaDbConnection.java” 786]
[com.mchange.v2.c3p0.impl.NewProxyConnection rollback “NewProxyConnection.java” 1630]
[clojure.java.jdbc$db_transaction_STAR_$fn__14288 invoke “jdbc.clj” 806]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 805]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 834]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 782]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[metabase.driver.sql_jdbc.execute$do_in_transaction invokeStatic “execute.clj” 243]
[metabase.driver.sql_jdbc.execute$do_in_transaction invoke “execute.clj” 242]
[metabase.driver.sql_jdbc.execute$run_query_without_timezone invokeStatic “execute.clj” 260]
[metabase.driver.sql_jdbc.execute$run_query_without_timezone invoke “execute.clj” 259]
[metabase.driver.sql_jdbc.execute$execute_query$fn__62556 invoke “execute.clj” 289]
[metabase.driver.sql_jdbc.execute$do_with_try_catch invokeStatic “execute.clj” 219]
[metabase.driver.sql_jdbc.execute$do_with_try_catch invoke “execute.clj” 213]
[metabase.driver.sql_jdbc.execute$execute_query invokeStatic “execute.clj” 286]
[metabase.driver.sql_jdbc.execute$execute_query invoke “execute.clj” 280]
[metabase.driver.sql_jdbc$fn__62799 invokeStatic “sql_jdbc.clj” 48]
[metabase.driver.sql_jdbc$fn__62799 invoke “sql_jdbc.clj” 47]
[clojure.lang.MultiFn invoke “MultiFn.java” 234]
[metabase.query_processor$fn__40378$execute_query__40383$fn__40384 invoke “query_processor.clj” 61]
[metabase.query_processor$fn__40378$execute_query__40383 invoke “query_processor.clj” 55]
[metabase.query_processor.middleware.mbql_to_native$mbql__GT_native$fn__34658 invoke “mbql_to_native.clj” 36]
[metabase.query_processor.middleware.annotate$result_rows_maps__GT_vectors$fn__32695 invoke “annotate.clj” 368]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.annotate$add_column_info$fn__32600 invoke “annotate.clj” 303]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__34138 invoke “cumulative_aggregations.clj” 57]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.limit$limit$fn__34631 invoke “limit.clj” 19]
[metabase.query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__40243 invoke “results_metadata.clj” 86]
[metabase.query_processor.middleware.format_rows$format_rows$fn__34619 invoke “format_rows.clj” 26]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.add_dimension_projections$add_remapping$fn__31752 invoke “add_dimension_projections.clj” 236]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__32146 invoke “add_row_count_and_status.clj” 16]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.driver_specific$process_query_in_context$fn__34380 invoke “driver_specific.clj” 12]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.resolve_driver$resolve_driver$fn__37209 invoke “resolve_driver.clj” 15]
[metabase.query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__33550$fn__33551 invoke “bind_effective_timezone.clj” 9]
[metabase.util.date$call_with_effective_timezone invokeStatic “date.clj” 88]
[metabase.util.date$call_with_effective_timezone invoke “date.clj” 77]
[metabase.query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__33550 invoke “bind_effective_timezone.clj” 8]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.store$initialize_store$fn__40268$fn__40269 invoke “store.clj” 11]
[metabase.query_processor.store$do_with_new_store invokeStatic “store.clj” 35]
[metabase.query_processor.store$do_with_new_store invoke “store.clj” 31]
[metabase.query_processor.middleware.store$initialize_store$fn__40268 invoke “store.clj” 10]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.async$async__GT_sync$fn__33146 invoke “async.clj” 19]
[metabase.query_processor.middleware.async_wait$runnable$fn__33277 invoke “async_wait.clj” 71]
[clojure.lang.AFn run “AFn.java” 22]
[java.util.concurrent.Executors$RunnableAdapter call “Executors.java” 511]
[java.util.concurrent.FutureTask run “FutureTask.java” 266]
[java.util.concurrent.ThreadPoolExecutor runWorker “ThreadPoolExecutor.java” 1149]
[java.util.concurrent.ThreadPoolExecutor$Worker run “ThreadPoolExecutor.java” 624]
[java.lang.Thread run “Thread.java” 748]]}, :handling #error {
:cause “unexpected end of stream, read 0 bytes from 7 (socket was closed by server)”
:via
[{:type java.sql.SQLNonTransientConnectionException
:message “(conn=3405924) (conn=3405924) unexpected end of stream, read 0 bytes from 7 (socket was closed by server)”
:at [org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper get “ExceptionMapper.java” 234]}
{:type java.sql.SQLNonTransientConnectionException
:message “(conn=3405924) unexpected end of stream, read 0 bytes from 7 (socket was closed by server)”
:at [org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper get “ExceptionMapper.java” 234]}
{:type java.sql.SQLException
:message “unexpected end of stream, read 0 bytes from 7 (socket was closed by server)\nQuery is: set @@SQL_SELECT_LIMIT=DEFAULT\njava thread: pool-5-thread-2”
:at [org.mariadb.jdbc.internal.util.LogQueryTool exceptionWithQuery “LogQueryTool.java” 126]}
{:type java.io.EOFException
:message “unexpected end of stream, read 0 bytes from 7 (socket was closed by server)”
:at [org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream readBlocking “DecompressPacketInputStream.java” 195]}]
:trace
[[org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream readBlocking “DecompressPacketInputStream.java” 195]
[org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream getPacketArray “DecompressPacketInputStream.java” 117]
[org.mariadb.jdbc.internal.io.input.DecompressPacketInputStream getPacket “DecompressPacketInputStream.java” 97]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol readPacket “AbstractQueryProtocol.java” 1427]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol getResult “AbstractQueryProtocol.java” 1407]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol executeQuery “AbstractQueryProtocol.java” 219]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol executeQuery “AbstractQueryProtocol.java” 197]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol setMaxRows “AbstractQueryProtocol.java” 1320]
[org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol prolog “AbstractQueryProtocol.java” 1760]
[org.mariadb.jdbc.MariaDbStatement executeQueryPrologue “MariaDbStatement.java” 191]
[org.mariadb.jdbc.MariaDbStatement executeInternal “MariaDbStatement.java” 339]
[org.mariadb.jdbc.MariaDbStatement execute “MariaDbStatement.java” 407]
[org.mariadb.jdbc.MariaDbConnection rollback “MariaDbConnection.java” 786]
[com.mchange.v2.c3p0.impl.NewProxyConnection rollback “NewProxyConnection.java” 1630]
[metabase.driver.sql_jdbc.execute$do_with_auto_commit_disabled invokeStatic “execute.clj” 240]
[metabase.driver.sql_jdbc.execute$do_with_auto_commit_disabled invoke “execute.clj” 227]
[metabase.driver.sql_jdbc.execute$do_in_transaction$fn__62532 invoke “execute.clj” 244]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 799]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 834]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic “jdbc.clj” 782]
[clojure.java.jdbc$db_transaction_STAR_ invoke “jdbc.clj” 769]
[metabase.driver.sql_jdbc.execute$do_in_transaction invokeStatic “execute.clj” 243]
[metabase.driver.sql_jdbc.execute$do_in_transaction invoke “execute.clj” 242]
[metabase.driver.sql_jdbc.execute$run_query_without_timezone invokeStatic “execute.clj” 260]
[metabase.driver.sql_jdbc.execute$run_query_without_timezone invoke “execute.clj” 259]
[metabase.driver.sql_jdbc.execute$execute_query$fn__62556 invoke “execute.clj” 289]
[metabase.driver.sql_jdbc.execute$do_with_try_catch invokeStatic “execute.clj” 219]
[metabase.driver.sql_jdbc.execute$do_with_try_catch invoke “execute.clj” 213]
[metabase.driver.sql_jdbc.execute$execute_query invokeStatic “execute.clj” 286]
[metabase.driver.sql_jdbc.execute$execute_query invoke “execute.clj” 280]
[metabase.driver.sql_jdbc$fn__62799 invokeStatic “sql_jdbc.clj” 48]
[metabase.driver.sql_jdbc$fn__62799 invoke “sql_jdbc.clj” 47]
[clojure.lang.MultiFn invoke “MultiFn.java” 234]
[metabase.query_processor$fn__40378$execute_query__40383$fn__40384 invoke “query_processor.clj” 61]
[metabase.query_processor$fn__40378$execute_query__40383 invoke “query_processor.clj” 55]
[metabase.query_processor.middleware.mbql_to_native$mbql__GT_native$fn__34658 invoke “mbql_to_native.clj” 36]
[metabase.query_processor.middleware.annotate$result_rows_maps__GT_vectors$fn__32695 invoke “annotate.clj” 368]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.annotate$add_column_info$fn__32600 invoke “annotate.clj” 303]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__34138 invoke “cumulative_aggregations.clj” 57]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.limit$limit$fn__34631 invoke “limit.clj” 19]
[metabase.query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__40243 invoke “results_metadata.clj” 86]
[metabase.query_processor.middleware.format_rows$format_rows$fn__34619 invoke “format_rows.clj” 26]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.add_dimension_projections$add_remapping$fn__31752 invoke “add_dimension_projections.clj” 236]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__32146 invoke “add_row_count_and_status.clj” 16]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.driver_specific$process_query_in_context$fn__34380 invoke “driver_specific.clj” 12]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.resolve_driver$resolve_driver$fn__37209 invoke “resolve_driver.clj” 15]
[metabase.query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__33550$fn__33551 invoke “bind_effective_timezone.clj” 9]
[metabase.util.date$call_with_effective_timezone invokeStatic “date.clj” 88]
[metabase.util.date$call_with_effective_timezone invoke “date.clj” 77]
[metabase.query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__33550 invoke “bind_effective_timezone.clj” 8]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.store$initialize_store$fn__40268$fn__40269 invoke “store.clj” 11]
[metabase.query_processor.store$do_with_new_store invokeStatic “store.clj” 35]
[metabase.query_processor.store$do_with_new_store invoke “store.clj” 31]
[metabase.query_processor.middleware.store$initialize_store$fn__40268 invoke “store.clj” 10]
[clojure.core$comp$fn__5792 invoke “core.clj” 2569]
[metabase.query_processor.middleware.async$async__GT_sync$fn__33146 invoke “async.clj” 19]
[metabase.query_processor.middleware.async_wait$runnable$fn__33277 invoke “async_wait.clj” 71]
[clojure.lang.AFn run “AFn.java” 22]
[java.util.concurrent.Executors$RunnableAdapter call “Executors.java” 511]
[java.util.concurrent.FutureTask run “FutureTask.java” 266]
[java.util.concurrent.ThreadPoolExecutor runWorker “ThreadPoolExecutor.java” 1149]
[java.util.concurrent.ThreadPoolExecutor$Worker run “ThreadPoolExecutor.java” 624]
[java.lang.Thread run “Thread.java” 748]]}}}

01-22 15:25:11 ERROR middleware.log :: POST /api/dataset/csv 500 5 mins (21 DB calls)
“Rollback failed handling “(conn=3405924) (conn=3405924) unexpected end of stream, read 0 bytes from 7 (socket was closed by server)””

01-22 15:26:33 DEBUG middleware.log :: POST /api/card/419/query/xlsx 200 210 ms (10 DB calls) Jetty threads: 2/50 (4 idle, 0 queued) (75 total active threads) Queries in flight: 1
01-22 15:27:06 DEBUG middleware.log :: GET /api/collection/193 200 6 ms (3 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (76 total active threads) Queries in flight: 1
01-22 15:27:06 DEBUG middleware.log :: GET /api/collection/193/items 200 5 ms (8 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (77 total active threads) Queries in flight: 1
01-22 15:27:16 DEBUG middleware.log :: GET /api/card/419 200 8 ms (6 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (77 total active threads) Queries in flight: 1
01-22 15:27:16 DEBUG middleware.log :: GET /api/alert/question/419 200 1 ms (1 DB calls) Jetty threads: 3/50 (4 idle, 0 queued) (77 total active threads) Queries in flight: 1
01-22 15:27:17 DEBUG middleware.log :: POST /api/card/419/query 200 [ASYNC: completed] 93 ms (10 DB calls) Jetty threads: 2/50 (4 idle, 0 queued) (77 total active threads) Queries in flight: 1

It was due to the wait_timeout value set to 300 seconds on the MySQL server. I increased it to 30 mins and was able to download the CSV

1 Like