Queries don't return when SQL text is longer than 1400 characters

Hello! I am a new Redash user coming into a company which has been using Redash for a short time.
In brief, we are having an issue where if a query’s source text is longer than 1400 characters, the query will not return data to either the query viewer or an associated dashboard.
Table size in rows or columns is not an issue.

We are running Redash with Docker. I pulled these versions from our docker-compose.yml file.

  • redash:10.1.0.b50633
  • postgres:9.6-alpine
  • redis:5.0-alpine

System info:

  • Linux 5.10.0-1057-oem #61-Ubuntu SMP Thu Jan 13 15:06:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Browser is Firefox 99.0.1

Redash installation info:

Here are the docker-compose logs from a failed query (greater than 1400 characters in the query text). I removed URLs and emails.
The log includes free(): corrupted unsorted chunks so we may be overflowing memory with the long queries.

server_1            | [2022-04-28 17:19:55,187][PID:9][INFO][rq.job.redash.tasks.queries.execution] job.func_name= job.id= Inserting job for fe5567c986bfed2c35c9f708dd9464c7 with metadata={'Username': XXX@YYY.com', 'query_id': 31}
adhoc_worker_1      | [2022-04-28 17:19:55,188][PID:11][INFO][rq.worker] default: 4c052cb2-071d-4fed-a8b4-8b224c5c8e01
server_1            | [2022-04-28 17:19:55,188][PID:9][INFO][rq.job.redash.tasks.queries.execution] job.func_name= job.id= [fe5567c986bfed2c35c9f708dd9464c7] Created new job: 262dcccd-ed39-4f7d-9bf2-cbd43845eecb
adhoc_worker_1      | [2022-04-28 17:19:55,189][PID:10][INFO][rq.worker] queries: 262dcccd-ed39-4f7d-9bf2-cbd43845eecb
server_1            | [2022-04-28 17:19:55,190][PID:9][INFO][metrics] method=POST path=/api/query_results endpoint=query_results status=200 content_type=application/json content_length=139 duration=13.06 query_count=7 query_duration=6.23
nginx_1             | 10.10.1.1 - - [28/Apr/2022:17:19:55 +0000] "POST /api/query_results HTTP/1.1" 200 139 "https://ZZZ.com/queries/31/source?p_date-range=d_last_12_months" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0"
adhoc_worker_1      | [2022-04-28 17:19:55,197][PID:87547][INFO][rq.job.redash.tasks.queries.execution] job.func_name=redash.tasks.queries.execution.execute_query job.id=262dcccd-ed39-4f7d-9bf2-cbd43845eecb job=execute_query state=load_ds ds_id=1
adhoc_worker_1      | [2022-04-28 17:19:55,224][PID:87547][INFO][rq.job.redash.tasks.queries.execution] job.func_name=redash.tasks.queries.execution.execute_query job.id=262dcccd-ed39-4f7d-9bf2-cbd43845eecb job=execute_query state=executing_query query_hash=fe5567c986bfed2c35c9f708dd9464c7 type=mssql ds_id=1 job_id=262dcccd-ed39-4f7d-9bf2-cbd43845eecb queue=queries query_id=31 username=XXX@YYY.com
adhoc_worker_1      | [2022-04-28 17:19:55,229][PID:87546][INFO][rq.worker] default: Job OK (4c052cb2-071d-4fed-a8b4-8b224c5c8e01)
adhoc_worker_1      | [2022-04-28 17:19:55,229][PID:87546][INFO][rq.worker] Result is kept for 500 seconds
server_1            | [2022-04-28 17:19:55,260][PID:10][INFO][metrics] method=GET path=/api/jobs/262dcccd-ed39-4f7d-9bf2-cbd43845eecb endpoint=job status=200 content_type=application/json content_length=163 duration=1.15 query_count=2 query_duration=2.06
nginx_1             | 10.10.1.1 - - [28/Apr/2022:17:19:55 +0000] "GET /api/jobs/262dcccd-ed39-4f7d-9bf2-cbd43845eecb HTTP/1.1" 200 163 "https://ZZZ.com/queries/31/source?p_date-range=d_last_12_months" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0"
adhoc_worker_1      | free(): corrupted unsorted chunks
adhoc_worker_1      | [2022-04-28 17:19:55,612][PID:10][WARNING][rq.worker] Moving job to FailedJobRegistry (work-horse terminated unexpectedly; waitpid returned 134)
server_1            | [2022-04-28 17:19:55,841][PID:14][INFO][metrics] method=GET path=/api/jobs/262dcccd-ed39-4f7d-9bf2-cbd43845eecb endpoint=job status=200 content_type=application/json content_length=139 duration=1.56 query_count=2 query_duration=2.42
nginx_1             | 10.10.1.1 - - [28/Apr/2022:17:19:55 +0000] "GET /api/jobs/262dcccd-ed39-4f7d-9bf2-cbd43845eecb HTTP/1.1" 200 139 "https://ZZZ.com/queries/31/source?p_date-range=d_last_12_months" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0"
server_1            | [2022-04-28 17:19:56,019][PID:9][INFO][metrics] method=POST path=/api/events endpoint=events status=200 content_type=application/json content_length=4 duration=1.66 query_count=2 query_duration=2.59
scheduled_worker_1  | [2022-04-28 17:19:56,019][PID:10][INFO][rq.worker] default: 44d9ff55-804b-4516-81f6-c5548953eba3
nginx_1             | 10.10.1.1 - - [28/Apr/2022:17:19:56 +0000] "POST /api/events HTTP/1.1" 200 4 "https://ZZZ.com/queries/31/source?p_date-range=d_last_12_months" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0"
scheduled_worker_1  | [2022-04-28 17:19:56,059][PID:88280][INFO][rq.worker] default: Job OK (44d9ff55-804b-4516-81f6-c5548953eba3)
scheduled_worker_1  | [2022-04-28 17:19:56,059][PID:88280][INFO][rq.worker] Result is kept for 500 seconds

Thank you in advance for your help and please let me know if you need more information.