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: conn_executor.go:822: runtime error: index out of range [1] with length 1 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... #91322

Closed
cockroach-teamcity opened this issue Nov 4, 2022 · 1 comment
Labels
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.

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Nov 4, 2022

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

Sentry link: https://sentry.io/organizations/cockroach-labs/issues/3720105959/?referrer=webhooks_plugin

Panic message:

conn_executor.go:822: runtime error: index out of range [1] with length 1
(1) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:822
| [...repeated from below...]
Wraps: (2) while executing: ALTER TABLE _ ALTER PRIMARY KEY USING COLUMNS (_, )
Wraps: (3) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:822
| runtime.gopanic
| GOROOT/src/runtime/panic.go:838
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError.func1
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:58
| runtime.gopanic
| GOROOT/src/runtime/panic.go:838
| runtime.goPanicIndex
| GOROOT/src/runtime/panic.go:89
| github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc.index.GetKeyColumnID
| github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc/index.go:278
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/scmutationexec.(*visitor).AddColumnToIndex
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/scmutationexec/index.go:407
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop.AddColumnToIndex.Visit
| github.com/cockroachdb/cockroach/bazel-out/k8-opt/bin/pkg/sql/schemachanger/scop/mutation_visitor_generated.go:457
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec.executeDescriptorMutationOps
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/exec_mutation.go:43
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec.ExecuteStage
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/executor.go:32
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun.executeStage
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun/scrun.go:175
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun.runTransactionPhase
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun/scrun.go:81
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun.RunStatementPhase
| github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun/scrun.go:42
| github.com/cockroachdb/cockroach/pkg/sql.(*schemaChangePlanNode).startExec
| github.com/cockroachdb/cockroach/pkg/sql/schema_change_plan_node.go:225
| github.com/cockroachdb/cockroach/pkg/sql.startExec.func2
| github.com/cockroachdb/cockroach/pkg/sql/plan.go:518
| github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visitInternal.func1
| github.com/cockroachdb/cockroach/pkg/sql/walk.go:112
| github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visitInternal
| github.com/cockroachdb/cockroach/pkg/sql/walk.go:297
| github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visit
| github.com/cockroachdb/cockroach/pkg/sql/walk.go:79
| github.com/cockroachdb/cockroach/pkg/sql.walkPlan
| github.com/cockroachdb/cockroach/pkg/sql/walk.go:43
| github.com/cockroachdb/cockroach/pkg/sql.startExec
| github.com/cockroachdb/cockroach/pkg/sql/plan.go:521
| github.com/cockroachdb/cockroach/pkg/sql.(*planNodeToRowSource).Start
| github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:147
| github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Columnarizer).Init
| github.com/cockroachdb/cockroach/pkg/sql/colexec/columnarizer.go:166
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Init
| github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:90
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*BatchFlowCoordinator).init.func1
| github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:247
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:92
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*BatchFlowCoordinator).init
| github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:246
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*BatchFlowCoordinator).Run
| github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:291
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*vectorizedFlow).Run
| github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:320
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:695
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRun
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1611
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRunAll
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1334
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1522
Wraps: (4) runtime error: index out of range [1] with length 1
Error types: (1) *withstack.withStack (2) *safedetails.withSafeDetails (3) *withstack.withStack (4) runtime.boundsError
-- report composition:
runtime.boundsError
conn_executor.go:822: *withstack.withStack (top exception)
*safedetails.withSafeDetails: while executing: ALTER TABLE _ ALTER PRIMARY KEY USING COLUMNS (
, _)
conn_executor.go:822: *withstack.withStack (1)
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

r := recover()
h.ex.closeWrapper(ctx, r)
}(ctx, h)
in pkg/sql.(*Server).ServeConn.func1
GOROOT/src/runtime/panic.go#L837-L839 in runtime.gopanic
if !shouldCatchPanic(panicEmittedFrom) {
panic(panicObj)
}
in pkg/sql/colexecerror.CatchVectorizedRuntimeError.func1
GOROOT/src/runtime/panic.go#L837-L839 in runtime.gopanic
GOROOT/src/runtime/panic.go#L88-L90 in runtime.goPanicIndex
func (w index) GetKeyColumnID(columnOrdinal int) descpb.ColumnID {
return w.desc.KeyColumnIDs[columnOrdinal]
}
in pkg/sql/catalog/tabledesc.index.GetKeyColumnID
for i := 0; i < index.NumKeySuffixColumns(); i++ {
colOrdMap.Set(index.GetKeyColumnID(i), i+index.NumKeyColumns())
}
in pkg/sql/schemachanger/scexec/scmutationexec.(*visitor).AddColumnToIndex
https://github.com/cockroachdb/cockroach/blob/3688055c09cd32f1186624a1ccc3fe35e5a0cffd/bazel-out/k8-opt/bin/pkg/sql/schemachanger/scop/mutation_visitor_generated.go#L456-L458 in pkg/sql/schemachanger/scop.AddColumnToIndex.Visit
for _, op := range ops {
if err := op.(scop.MutationOp).Visit(ctx, v); err != nil {
return errors.Wrapf(err, "%T: %v", op, op)
in pkg/sql/schemachanger/scexec.executeDescriptorMutationOps
case scop.MutationType:
return executeDescriptorMutationOps(ctx, deps, ops)
case scop.BackfillType:
in pkg/sql/schemachanger/scexec.ExecuteStage
}()
if err := scexec.ExecuteStage(ctx, deps, stage.Ops()); err != nil {
// Don't go through the effort to wrap the error if it's a retry or it's a
in pkg/sql/schemachanger/scrun.executeStage
for i := range stages {
if err := executeStage(ctx, knobs, deps, sc, i, stages[i]); err != nil {
return scpb.CurrentState{}, jobspb.InvalidJobID, err
in pkg/sql/schemachanger/scrun.runTransactionPhase
) (scpb.CurrentState, jobspb.JobID, error) {
return runTransactionPhase(ctx, knobs, deps, state, scop.StatementPhase)
}
in pkg/sql/schemachanger/scrun.RunStatementPhase
)
after, jobID, err := scrun.RunStatementPhase(
params.ctx, p.ExecCfg().DeclarativeSchemaChangerTestingKnobs, runDeps, s.plannedState,
in pkg/sql.(*schemaChangePlanNode).startExec

cockroach/pkg/sql/plan.go

Lines 517 to 519 in 3688055

}
return n.startExec(params)
},
in pkg/sql.startExec.func2

cockroach/pkg/sql/walk.go

Lines 111 to 113 in 3688055

}
v.err = v.observer.leaveNode(name, plan)
}()
in pkg/sql.(*planVisitor).visitInternal.func1

cockroach/pkg/sql/walk.go

Lines 296 to 298 in 3688055

}
}
in pkg/sql.(*planVisitor).visitInternal
}
v.visitInternal(plan, name)
return plan
in pkg/sql.(*planVisitor).visit
v := makePlanVisitor(ctx, observer)
v.visit(plan)
return v.err
in pkg/sql.walkPlan

cockroach/pkg/sql/plan.go

Lines 520 to 522 in 3688055

}
return walkPlan(params.ctx, plan, o)
}
in pkg/sql.startExec
// This starts all of the nodes below this node.
if err := startExec(p.params, p.node); err != nil {
p.MoveToDraining(err)
in pkg/sql.(*planNodeToRowSource).Start
ctx = c.StartInternalNoSpan(ctx)
c.input.Start(ctx)
if execStatsHijacker, ok := c.input.(execinfra.ExecStatsForTraceHijacker); ok {
in pkg/sql/colexec.(*Columnarizer).Init
func (bic *batchInfoCollector) Init(ctx context.Context) {
bic.Operator.Init(ctx)
bic.mu.Lock()
in pkg/sql/colflow.(*batchInfoCollector).Init
return colexecerror.CatchVectorizedRuntimeError(func() {
f.input.Root.Init(ctx)
})
in pkg/sql/colflow.(*BatchFlowCoordinator).init.func1
}()
operation()
return retErr
in pkg/sql/colexecerror.CatchVectorizedRuntimeError
func (f *BatchFlowCoordinator) init(ctx context.Context) error {
return colexecerror.CatchVectorizedRuntimeError(func() {
f.input.Root.Init(ctx)
in pkg/sql/colflow.(*BatchFlowCoordinator).init
if err := f.init(ctx); err != nil {
f.pushError(err)
in pkg/sql/colflow.(*BatchFlowCoordinator).Run
log.VEvent(ctx, 1, "running the batch flow coordinator in the flow's goroutine")
f.batchFlowCoordinator.Run(ctx)
}
in pkg/sql/colflow.(*vectorizedFlow).Run
// TODO(radu): this should go through the flow scheduler.
flow.Run(ctx, func() {})
in pkg/sql.(*DistSQLPlanner).Run
recv.expectedRowsRead = int64(physPlan.TotalEstimatedScannedRows)
runCleanup := dsp.Run(ctx, planCtx, txn, physPlan, recv, evalCtx, nil /* finishedSetupFn */)
return func() {
in pkg/sql.(*DistSQLPlanner).PlanAndRun
// the planner whether or not to plan remote table readers.
cleanup := dsp.PlanAndRun(
ctx, evalCtx, planCtx, planner.txn, planner.curPlan.main, recv,
in pkg/sql.(*DistSQLPlanner).PlanAndRunAll
}
err := ex.server.cfg.DistSQLPlanner.PlanAndRunAll(ctx, evalCtx, planCtx, planner, recv, evalCtxFactory)
return *recv.stats, err
in pkg/sql.(*connExecutor).execWithDistSQLEngine

pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn.func1 at line 822
GOROOT/src/runtime/panic.go in runtime.gopanic at line 838
pkg/sql/colexecerror/error.go in pkg/sql/colexecerror.CatchVectorizedRuntimeError.func1 at line 58
GOROOT/src/runtime/panic.go in runtime.gopanic at line 838
GOROOT/src/runtime/panic.go in runtime.goPanicIndex at line 89
pkg/sql/catalog/tabledesc/index.go in pkg/sql/catalog/tabledesc.index.GetKeyColumnID at line 278
pkg/sql/schemachanger/scexec/scmutationexec/index.go in pkg/sql/schemachanger/scexec/scmutationexec.(*visitor).AddColumnToIndex at line 407
bazel-out/k8-opt/bin/pkg/sql/schemachanger/scop/mutation_visitor_generated.go in pkg/sql/schemachanger/scop.AddColumnToIndex.Visit at line 457
pkg/sql/schemachanger/scexec/exec_mutation.go in pkg/sql/schemachanger/scexec.executeDescriptorMutationOps at line 43
pkg/sql/schemachanger/scexec/executor.go in pkg/sql/schemachanger/scexec.ExecuteStage at line 32
pkg/sql/schemachanger/scrun/scrun.go in pkg/sql/schemachanger/scrun.executeStage at line 175
pkg/sql/schemachanger/scrun/scrun.go in pkg/sql/schemachanger/scrun.runTransactionPhase at line 81
pkg/sql/schemachanger/scrun/scrun.go in pkg/sql/schemachanger/scrun.RunStatementPhase at line 42
pkg/sql/schema_change_plan_node.go in pkg/sql.(*schemaChangePlanNode).startExec at line 225
pkg/sql/plan.go in pkg/sql.startExec.func2 at line 518
pkg/sql/walk.go in pkg/sql.(*planVisitor).visitInternal.func1 at line 112
pkg/sql/walk.go in pkg/sql.(*planVisitor).visitInternal at line 297
pkg/sql/walk.go in pkg/sql.(*planVisitor).visit at line 79
pkg/sql/walk.go in pkg/sql.walkPlan at line 43
pkg/sql/plan.go in pkg/sql.startExec at line 521
pkg/sql/plan_node_to_row_source.go in pkg/sql.(*planNodeToRowSource).Start at line 147
pkg/sql/colexec/columnarizer.go in pkg/sql/colexec.(*Columnarizer).Init at line 166
pkg/sql/colflow/stats.go in pkg/sql/colflow.(*batchInfoCollector).Init at line 90
pkg/sql/colflow/flow_coordinator.go in pkg/sql/colflow.(*BatchFlowCoordinator).init.func1 at line 247
pkg/sql/colexecerror/error.go in pkg/sql/colexecerror.CatchVectorizedRuntimeError at line 92
pkg/sql/colflow/flow_coordinator.go in pkg/sql/colflow.(*BatchFlowCoordinator).init at line 246
pkg/sql/colflow/flow_coordinator.go in pkg/sql/colflow.(*BatchFlowCoordinator).Run at line 291
pkg/sql/colflow/vectorized_flow.go in pkg/sql/colflow.(*vectorizedFlow).Run at line 320
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).Run at line 695
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRun at line 1611
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRunAll at line 1334
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithDistSQLEngine at line 1522
Tag Value
Cockroach Release v22.2.0-alpha.1
Cockroach SHA: 3688055
Platform linux amd64
Distribution CCL
Environment v22.2.0-alpha.1
Command demo
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-21202

@cockroach-teamcity cockroach-teamcity added 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 4, 2022
@yuzefovich
Copy link
Member

dup of #91301

@exalate-issue-sync exalate-issue-sync bot changed the title sentry: conn_executor.go:822: runtime error: index out of range [1] with length 1 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... sentry: conn_executor.go:822: runtime error: index out of range [1] with length 1 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

2 participants