Panic while executing SQL query

Hi there,

I am getting a panic on a SQL query and I couldn’t find any existing resources that pointed to why the panic was occurring or how to prevent it. Any direction would be much appreciated.

Here is the panic message and its stacktrace:

panic while executing 1 statements: SELECT _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._, _._ FROM _ AS _ WHERE (((_ = _) AND (_ = _)) AND (_ = _)) AND (_ = _) LIMIT _; caused by flow: no bytes to release, current 10239, free 10240

goroutine 1265558 [running]:
runtime/debug.Stack(0x305ac80, 0xc4293212c0, 0x3)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/cockroachdb/cockroach/pkg/util/log.ReportPanic(0x305ac80, 0xc4293212c0, 0xc4200e7980, 0x296e980, 0xc42816a8d0, 0x1)
	/go/src/github.com/cockroachdb/cockroach/pkg/util/log/crash_reporting.go:213 +0xa5
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).closeWrapper(0xc42be9a000, 0x305ac80, 0xc4293212c0, 0x268ddc0, 0xc425a3cc20)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:645 +0x2df
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1(0xc42be9a000, 0x305ac80, 0xc4293212c0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:387 +0x61
panic(0x268ddc0, 0xc425a3cc20)
	/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/cockroachdb/cockroach/pkg/util/mon.(*BytesMonitor).releaseBytes(0xc426a925a0, 0x305ac80, 0xc427b02300, 0x2800)
	/go/src/github.com/cockroachdb/cockroach/pkg/util/mon/bytes_usage.go:627 +0x3c4
github.com/cockroachdb/cockroach/pkg/util/mon.(*BoundAccount).Close(0xc427f42ca0, 0x305ac80, 0xc427b02300)
	/go/src/github.com/cockroachdb/cockroach/pkg/util/mon/bytes_usage.go:511 +0x66
github.com/cockroachdb/cockroach/pkg/util/mon.(*BoundAccount).Clear(0xc427f42ca0, 0x305ac80, 0xc427b02300)
	/go/src/github.com/cockroachdb/cockroach/pkg/util/mon/bytes_usage.go:498 +0x48
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*accountClearingRowReceiver).Push(0xc427695a70, 0x0, 0x0, 0x0, 0xc428ce9d10, 0xc400000000)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:278 +0x45
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*copyingRowReceiver).Push(0xc427e95880, 0x0, 0x0, 0x0, 0xc428ce9d10, 0xc400000000)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:677 +0x191
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.Run(0x305ad40, 0xc4288928d0, 0x3063d00, 0xc42b10e000, 0x3037e80, 0xc427e95880)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/base.go:175 +0x5c
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcessorBase).Run(0xc42b10e000, 0x305ad40, 0xc4288928d0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:731 +0x98
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*Flow).StartSync(0xc427d2a000, 0x305ad40, 0xc4288928d0, 0x2c37520, 0xc42d024e00, 0x3037b40)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:607 +0x191
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run(0xc420889a00, 0xc42afe9f80, 0xc42bb0f4d0, 0xc42b4f28d8, 0xc425ba1900, 0xc42be9a4b0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:253 +0x879
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRun(0xc420889a00, 0x305ad40, 0xc42cf425a0, 0xc42be9a4b0, 0xc42afe9f80, 0xc42bb0f4d0, 0x304dd40, 0xc42558d8c0, 0xc425ba1900)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:758 +0x24c
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine(0xc42be9a000, 0x305ad40, 0xc42cf425a0, 0xc42be9a418, 0x3, 0x7fe89a9a0e68, 0xc42bb0f560, 0x1, 0x0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:982 +0x2d8
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine(0xc42be9a000, 0x305ad40, 0xc42cf425a0, 0x305e3c0, 0xc427b02240, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:824 +0xa8a
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState(0xc42be9a000, 0x305ad40, 0xc42cf425a0, 0x305e3c0, 0xc427b02240, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:402 +0xb3b
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt(0xc42be9a000, 0x305ad40, 0xc42cf425a0, 0x305e3c0, 0xc427b02240, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:96 +0x341
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run(0xc42be9a000, 0x305ac80, 0xc4293212c0, 0xc420533758, 0x5400, 0x15000, 0xc4205337f0, 0xc427636ed0, 0x0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1118 +0x21aa
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn(0xc4208e94a0, 0x305ac80, 0xc4293212c0, 0xc42be9a000, 0x5400, 0x15000, 0xc4205337f0, 0xc427636ed0, 0x0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:389 +0xce
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).serveImpl.func4(0xc4208e94a0, 0x305ac80, 0xc4293212c0, 0xc42be9a000, 0x5400, 0x15000, 0xc4205337f0, 0xc427636ed0, 0xc427636ee0, 0xc4203d1790)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:313 +0x81
created by github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).serveImpl
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:312 +0x107c

The cockroach cluster is running inside a docker container setup across multiple different hosts, I can provide more information about the query or the cluster setup if its required for debugging.

Thanks!
Jeong