Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry: indexed_vars.go:159: invalid var index 18 (columns: 14) (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*IndexedV... #135981

Open
cockroach-sentry opened this issue Nov 22, 2024 · 2 comments
Labels
branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner

Comments

@cockroach-sentry
Copy link
Collaborator

cockroach-sentry commented Nov 22, 2024

This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry Link: https://cockroach-labs.sentry.io/issues/6082306353/?referrer=webhooks_plugin

Panic Message:

indexed_vars.go:159: invalid var index 18 (columns: 14)
(1) assertion failure
Wraps: (2) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*IndexedVarHelper).checkIndex
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/indexed_vars.go:159
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*IndexedVarHelper).IndexedVarWithType
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/indexed_vars.go:181
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).indexedVar
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:154
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildVariable
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:144
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:114
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildComparison
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:242
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:114
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildBoolean
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:215
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:114
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildBoolean
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:184
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:114
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildLookupJoin
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:2519
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:254
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).initJoinBuild
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1492
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildHashJoin
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1365
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:373
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupByInput
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1710
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupBy
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1553
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:232
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).initJoinBuild
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1492
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildHashJoin
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1365
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:373
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupByInput
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1710
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupBy
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1553
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:232
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildProject
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1046
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:229
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildTopK
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:1895
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:239
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).build
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:291
  | github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder.(*Builder).Build
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:233
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).runExecBuilder
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:670
Wraps: (3) invalid var index 18 (columns: 14)
Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *errutil.leafError
-- report composition:
*errutil.leafError: invalid var index 18 (columns: 14)
indexed_vars.go:159: *withstack.withStack (top exception)
*assert.withAssertionFailure
Stacktrace (expand for inline code snippets):

)
plan, err := bld.Build()
if err != nil {

func (b *Builder) Build() (_ exec.Plan, err error) {
plan, err := b.build(b.e)
if err != nil {

return b.buildRelational(rel)
}

case *memo.TopKExpr:
ep, err = b.buildTopK(t)

inputExpr := e.Input
input, err := b.buildRelational(inputExpr)
if err != nil {

case *memo.ProjectExpr:
ep, err = b.buildProject(t)

md := b.mem.Metadata()
input, err := b.buildRelational(prj.Input)
if err != nil {

case *memo.GroupByExpr, *memo.ScalarGroupByExpr:
ep, err = b.buildGroupBy(e)

func (b *Builder) buildGroupBy(groupBy memo.RelExpr) (execPlan, error) {
input, err := b.buildGroupByInput(groupBy)
if err != nil {

groupByInput := groupBy.Child(0).(memo.RelExpr)
input, err := b.buildRelational(groupByInput)
if err != nil {

case opt.IsJoinNonApplyOp(e):
ep, err = b.buildHashJoin(e)

left, right, onExpr, outputCols, err := b.initJoinBuild(
leftExpr,

}
rightPlan, err = b.buildRelational(rightChild)
if err != nil {

case *memo.GroupByExpr, *memo.ScalarGroupByExpr:
ep, err = b.buildGroupBy(e)

func (b *Builder) buildGroupBy(groupBy memo.RelExpr) (execPlan, error) {
input, err := b.buildGroupByInput(groupBy)
if err != nil {

groupByInput := groupBy.Child(0).(memo.RelExpr)
input, err := b.buildRelational(groupByInput)
if err != nil {

case opt.IsJoinNonApplyOp(e):
ep, err = b.buildHashJoin(e)

left, right, onExpr, outputCols, err := b.initJoinBuild(
leftExpr,

}
rightPlan, err = b.buildRelational(rightChild)
if err != nil {

case *memo.LookupJoinExpr:
ep, err = b.buildLookupJoin(t)

var err error
onExpr, err = b.buildScalar(&ctx, &join.On)
if err != nil {

}
return fn(b, ctx, scalar)
}

case opt.AndOp, opt.OrOp:
expr, err := b.buildScalar(ctx, scalar.Child(0).(opt.ScalarExpr))
if err != nil {

}
return fn(b, ctx, scalar)
}

case opt.FiltersItemOp:
return b.buildScalar(ctx, scalar.Child(0).(opt.ScalarExpr))

}
return fn(b, ctx, scalar)
}

) (tree.TypedExpr, error) {
left, err := b.buildScalar(ctx, scalar.Child(0).(opt.ScalarExpr))
if err != nil {

}
return fn(b, ctx, scalar)
}

) (tree.TypedExpr, error) {
return b.indexedVar(ctx, b.mem.Metadata(), *scalar.Private().(*opt.ColumnID))
}

}
return ctx.ivh.IndexedVarWithType(idx, md.ColumnMeta(colID).Type), nil
}

func (h *IndexedVarHelper) IndexedVarWithType(idx int, typ *types.T) *IndexedVar {
h.checkIndex(idx)
v := &h.vars[idx]

if idx < 0 || idx >= len(h.vars) {
panic(errors.AssertionFailedf(
"invalid var index %d (columns: %d)", redact.Safe(idx), redact.Safe(len(h.vars))))

pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).runExecBuilder at line 670
pkg/sql/opt/exec/execbuilder/builder.go in pkg/sql/opt/exec/execbuilder.(*Builder).Build at line 233
pkg/sql/opt/exec/execbuilder/builder.go in pkg/sql/opt/exec/execbuilder.(*Builder).build at line 291
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 239
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildTopK at line 1895
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 229
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildProject at line 1046
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 232
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupBy at line 1553
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupByInput at line 1710
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 373
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildHashJoin at line 1365
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).initJoinBuild at line 1492
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 232
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupBy at line 1553
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildGroupByInput at line 1710
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 373
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildHashJoin at line 1365
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).initJoinBuild at line 1492
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildRelational at line 254
pkg/sql/opt/exec/execbuilder/relational.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildLookupJoin at line 2519
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar at line 114
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildBoolean at line 184
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar at line 114
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildBoolean at line 215
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar at line 114
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildComparison at line 242
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildScalar at line 114
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).buildVariable at line 144
pkg/sql/opt/exec/execbuilder/scalar.go in pkg/sql/opt/exec/execbuilder.(*Builder).indexedVar at line 154
pkg/sql/sem/tree/indexed_vars.go in pkg/sql/sem/tree.(*IndexedVarHelper).IndexedVarWithType at line 181
pkg/sql/sem/tree/indexed_vars.go in pkg/sql/sem/tree.(*IndexedVarHelper).checkIndex at line 159

Tags

Tag Value
Command server
Environment v23.2.5
Go Version go1.21.9 X:nocoverageredesign
Platform linux amd64
Distribution CCL
Cockroach Release v23.2.5
Cockroach SHA 57ab107
# of CPUs 4
# of Goroutines 431

Jira issue: CRDB-44811

@cockroach-sentry cockroach-sentry added branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. labels Nov 22, 2024
Copy link

blathers-crl bot commented Nov 22, 2024

CC'ing via the CODEOWNERS-based sentry heuristic:

  • @cockroachdb/sql-foundations

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner labels Nov 22, 2024
Copy link

blathers-crl bot commented Nov 22, 2024

This issue has multiple T-eam labels. Please make sure it only has one, or else issue synchronization will not work correctly.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-23.2 Used to mark GA and release blockers, technical advisories, and bugs for 23.2 C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

No branches or pull requests

1 participant