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: errors.go:83: referenced descriptor ID 88: descriptor not found (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql/catalog/int... #106557

Closed
cockroach-sentry opened this issue Jul 10, 2023 · 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-sentry
Copy link
Collaborator

cockroach-sentry commented Jul 10, 2023

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/4306436766/?referrer=webhooks_plugin

Panic Message:

errors.go:83: referenced descriptor ID 88: descriptor not found
(1) assertion failure
Wraps: (2) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.wrapError
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:128
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogQuery.processDescriptorResultRow
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:111
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogQuery.query
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:73
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogReader.GetDescriptorEntries
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_reader.go:224
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.(*StoredCatalog).EnsureFromStorageByIDs
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/stored_catalog.go:308
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.getDescriptorsByID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:191
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getDescriptorByID
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:88
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getDescriptorByName
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:336
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getSchemaByName
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/schema.go:73
  | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).GetImmutableSchemaByName
  | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/schema.go:61
  | github.com/cockroachdb/cockroach/pkg/sql.(*schemaResolver).LookupSchema
  | 	github.com/cockroachdb/cockroach/pkg/sql/schema_resolver.go:132
  | github.com/cockroachdb/cockroach/pkg/sql.(*schemaResolver).ResolveFunction
  | 	github.com/cockroachdb/cockroach/pkg/sql/schema_resolver.go:416
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*ResolvableFunctionReference).Resolve
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/function_name.go:113
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).VisitPre
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:1061
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:825
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*BinaryExpr).Walk
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:69
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:828
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*ParenExpr).Walk
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:489
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:828
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*BinaryExpr).Walk
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:69
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:828
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).walkExprTree
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:428
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).resolveType
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:467
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).analyzeSelectList
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/project.go:160
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).analyzeProjectionList
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/project.go:94
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1059
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:996
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:965
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).processWiths
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:117
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:964
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:316
Wraps: (3) referenced descriptor ID 88
Wraps: (4) secondary error attachment
  | failed to find descriptor [88]
  | (1) attached stack trace
  |   -- stack trace:
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.requiredError
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:172
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.build
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:142
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogQuery.processDescriptorResultRow
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:109
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogQuery.query
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_query.go:73
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.catalogReader.GetDescriptorEntries
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/catalog_reader.go:224
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv.(*StoredCatalog).EnsureFromStorageByIDs
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/catkv/stored_catalog.go:308
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.getDescriptorsByID
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:191
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getDescriptorByID
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:88
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getDescriptorByName
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/descriptor.go:336
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).getSchemaByName
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/schema.go:73
  |   | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).GetImmutableSchemaByName
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/schema.go:61
  |   | github.com/cockroachdb/cockroach/pkg/sql.(*schemaResolver).LookupSchema
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/schema_resolver.go:132
  |   | github.com/cockroachdb/cockroach/pkg/sql.(*schemaResolver).ResolveFunction
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/schema_resolver.go:416
  |   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*ResolvableFunctionReference).Resolve
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/function_name.go:113
  |   | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).VisitPre
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:1061
  |   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:825
  |   | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*BinaryExpr).Walk
  |   | 	github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:69
  | ...
Stacktrace (expand for inline code snippets):

b.ctes = nil
outScope = b.buildStmt(stmt, desiredTypes, inScope)
// Build With operators for any CTEs hoisted to the top level.

case *tree.Select:
return b.buildSelect(stmt, noRowLocking, desiredTypes, inScope)

return b.processWiths(with, inScope, func(inScope *scope) *scope {
return b.buildSelectStmtWithoutParens(

inScope.atRoot = false
outScope := buildStmt(inScope)
outScope.expr = b.buildWiths(outScope.expr, correlatedCTEs)

return b.processWiths(with, inScope, func(inScope *scope) *scope {
return b.buildSelectStmtWithoutParens(
wrapped, orderBy, limit, locking, desiredTypes, inScope,

case *tree.SelectClause:
outScope = b.buildSelectClause(t, orderBy, locking, desiredTypes, inScope)

// aggInScope and aggOutScope.
b.analyzeProjectionList(sel.Exprs, desiredTypes, fromScope, projectionsScope)

b.analyzeSelectList(selects, desiredTypes, inScope, outScope)
}

texpr = inScope.resolveType(e.Expr, desired)
}

func (s *scope) resolveType(expr tree.Expr, desired *types.T) tree.TypedExpr {
expr = s.walkExprTree(expr)
texpr, err := tree.TypeCheck(s.builder.ctx, expr, s.builder.semaCtx, desired)

expr, _ = tree.WalkExpr(s, expr)
s.builder.semaCtx.IVarContainer = s

if recurse {
newExpr = newExpr.Walk(v)
newExpr = v.VisitPost(newExpr)

left, changedL := WalkExpr(v, expr.Left)
right, changedR := WalkExpr(v, expr.Right)
if changedL || changedR {

if recurse {
newExpr = newExpr.Walk(v)
newExpr = v.VisitPost(newExpr)

func (expr *ParenExpr) Walk(v Visitor) Expr {
e, changed := WalkExpr(v, expr.Expr)
if changed {

if recurse {
newExpr = newExpr.Walk(v)
newExpr = v.VisitPost(newExpr)

left, changedL := WalkExpr(v, expr.Left)
right, changedR := WalkExpr(v, expr.Right)
if changedL || changedR {

func WalkExpr(v Visitor, expr Expr) (newExpr Expr, changed bool) {
recurse, newExpr := v.VisitPre(expr)

// can handle overloads with the same name.
def, err := t.Func.Resolve(s.builder.ctx, semaCtx.SearchPath, semaCtx.FunctionResolver)
if err != nil {

// Use the resolver if it is provided.
fd, err := resolver.ResolveFunction(ctx, t, path)
if err != nil {

schema := path.GetSchema(i)
found, prefix, err := sr.LookupSchema(ctx, sr.CurrentDatabase(), schema)
if err != nil {

}
sc, err := sr.descCollection.GetImmutableSchemaByName(ctx, sr.txn, db, scName, flags)
if err != nil || sc == nil {

flags.RequireMutable = false
return tc.getSchemaByName(ctx, txn, db, scName, flags)
}

) (catalog.SchemaDescriptor, error) {
desc, err := tc.getDescriptorByName(ctx, txn, db, nil /* sc */, schemaName, flags, catalog.Schema)
if err != nil {

desc, err := tc.getDescriptorByID(ctx, txn, flags, id)
if err != nil {

var arr [1]catalog.Descriptor
if err := getDescriptorsByID(
ctx, tc, txn, flags, arr[:], ids...,

if !readIDs.Empty() {
if err = tc.stored.EnsureFromStorageByIDs(ctx, txn, readIDs, catalog.Any); err != nil {
return err

}
c, err := sc.GetDescriptorEntries(ctx, txn, ids.Ordered(), true /* isRequired */, descriptorType)
if err != nil {

}
err := cq.query(ctx, txn, &mc, func(codec keys.SQLCodec, b *kv.Batch) {
for _, id := range ids {

case keys.DescriptorTableID:
err = cq.processDescriptorResultRow(row, out)
default:

if err != nil {
return wrapError(expectedType, id, err)
}

}
return errors.Wrapf(err, "referenced descriptor ID %d", id)
}

src/runtime/asm_amd64.s#L1593-L1595
GOROOT/src/runtime/proc.go#L232-L234
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6324-L6326
GOROOT/src/runtime/proc.go#L6347-L6349
// found with the given id.
var ErrDescriptorNotFound = errors.New("descriptor not found")

pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 256
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 316
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 964
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 117
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 965
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 996
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 1059
pkg/sql/opt/optbuilder/project.go in pkg/sql/opt/optbuilder.(*Builder).analyzeProjectionList at line 94
pkg/sql/opt/optbuilder/project.go in pkg/sql/opt/optbuilder.(*Builder).analyzeSelectList at line 160
pkg/sql/opt/optbuilder/scope.go in pkg/sql/opt/optbuilder.(*scope).resolveType at line 467
pkg/sql/opt/optbuilder/scope.go in pkg/sql/opt/optbuilder.(*scope).walkExprTree at line 428
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.WalkExpr at line 828
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.(*BinaryExpr).Walk at line 69
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.WalkExpr at line 828
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.(*ParenExpr).Walk at line 489
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.WalkExpr at line 828
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.(*BinaryExpr).Walk at line 69
pkg/sql/sem/tree/walk.go in pkg/sql/sem/tree.WalkExpr at line 825
pkg/sql/opt/optbuilder/scope.go in pkg/sql/opt/optbuilder.(*scope).VisitPre at line 1061
pkg/sql/sem/tree/function_name.go in pkg/sql/sem/tree.(*ResolvableFunctionReference).Resolve at line 113
pkg/sql/schema_resolver.go in pkg/sql.(*schemaResolver).ResolveFunction at line 416
pkg/sql/schema_resolver.go in pkg/sql.(*schemaResolver).LookupSchema at line 132
pkg/sql/catalog/descs/schema.go in pkg/sql/catalog/descs.(*Collection).GetImmutableSchemaByName at line 61
pkg/sql/catalog/descs/schema.go in pkg/sql/catalog/descs.(*Collection).getSchemaByName at line 73
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByName at line 336
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.(*Collection).getDescriptorByID at line 88
pkg/sql/catalog/descs/descriptor.go in pkg/sql/catalog/descs.getDescriptorsByID at line 191
pkg/sql/catalog/internal/catkv/stored_catalog.go in pkg/sql/catalog/internal/catkv.(*StoredCatalog).EnsureFromStorageByIDs at line 308
pkg/sql/catalog/internal/catkv/catalog_reader.go in pkg/sql/catalog/internal/catkv.catalogReader.GetDescriptorEntries at line 224
pkg/sql/catalog/internal/catkv/catalog_query.go in pkg/sql/catalog/internal/catkv.catalogQuery.query at line 73
pkg/sql/catalog/internal/catkv/catalog_query.go in pkg/sql/catalog/internal/catkv.catalogQuery.processDescriptorResultRow at line 111
pkg/sql/catalog/internal/catkv/catalog_query.go in pkg/sql/catalog/internal/catkv.wrapError at line 128
src/runtime/asm_amd64.s in runtime.goexit at line 1594
GOROOT/src/runtime/proc.go in runtime.main at line 233
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6325
GOROOT/src/runtime/proc.go in runtime.doInit at line 6348
pkg/sql/catalog/errors.go in pkg/sql/catalog.init at line 83

Tags

Tag Value
Command demo
Environment v22.2.9
Go Version go1.19.6
Platform darwin amd64
Distribution CCL
Cockroach Release v22.2.9
Cockroach SHA 1b11ca6
# of CPUs 16
# of Goroutines 404

Jira issue: CRDB-29614

@cockroach-sentry cockroach-sentry added O-sentry Originated from an in-the-wild panic report. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Jul 10, 2023
@yuzefovich
Copy link
Member

dup of #105257

@exalate-issue-sync exalate-issue-sync bot changed the title Sentry: errors.go:83: referenced descriptor ID 88: descriptor not found (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql/catalog/int... Sentry: errors.go:83: referenced descriptor ID 88: descriptor not found (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql/catalog/int... Jul 27, 2023
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