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: validate.go:298: relation × (67): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found (1) keys: [sql.schema.validation_errors.read.cross_references.... #94908

Closed
cockroach-teamcity opened this issue Jan 9, 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-teamcity
Copy link
Member

cockroach-teamcity commented Jan 9, 2023

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

Panic message:

validate.go:298: relation × (67): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found
(1) keys: [sql.schema.validation_errors.read.cross_references.relation sql.schema.validation_errors.read.cross_references.relation sql.schema.validation_errors.read.cross_references.relation sql.schema.validation_errors.read.cross_references.relation sql.schema.validation_errors.read.cross_references.relation]
Wraps: (2) secondary error attachment
| relation × (69): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found
| (1) secondary error attachment
| | relation × (70): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found
| | (1) secondary error attachment
| | | relation × (71): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found
| | | (1) secondary error attachment
| | | | relation × (72): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found
| | | | (1) keys: [sql.schema.validation_errors.read.cross_references.relation]
| | | | Wraps: (2) attached stack trace
| | | | -- stack trace:
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).decorate
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:214
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).Report
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:149
| | | | | [...repeated from below...]
| | | | Wraps: (3) relation × (72)
| | | | Wraps: (4) assertion failure
| | | | Wraps: (5) attached stack trace
| | | | -- stack trace:
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc.(*wrapper).validateInboundTableRef
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc/validate.go:298
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc.(*wrapper).ValidateCrossReferences
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc/validate.go:188
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate.func2
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:77
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:165
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:72
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/nstree.Catalog.Validate
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/nstree/catalog.go:144
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*kvDescriptors).getAllDescriptors
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/kv_descriptors.go:279
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).GetAllDescriptors
| | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/collection.go:284
| | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternal
| | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2403
| | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookup
| | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2357
| | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDesc
| | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2285
| | | | | github.com/cockroachdb/cockroach/pkg/sql.glob..func157
| | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:1122
| | | | | github.com/cockroachdb/cockroach/pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1
| | | | | github.com/cockroachdb/cockroach/pkg/sql/virtual_schema.go:567
| | | | | github.com/cockroachdb/cockroach/pkg/sql.setupGenerator.func3
| | | | | github.com/cockroachdb/cockroach/pkg/sql/virtual_table.go:127
| | | | | github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
| | | | | github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:494
| | | | | runtime.goexit
| | | | | GOROOT/src/runtime/asm_amd64.s:1581
| | | | Wraps: (6) invalid depended-on-by relation back reference
| | | | Wraps: (7) referenced table ID 66: referenced descriptor not found
| | | | | -- cause hidden behind barrier
| | | | | referenced table ID 66: referenced descriptor not found
| | | | | (1) attached stack trace
| | | | | -- stack trace:
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog.WrapTableDescRefErr
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/errors.go:164
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationDescGetterImpl).GetTableDescriptor
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:284
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc.(*wrapper).validateInboundTableRef
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc/validate.go:296
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc.(*wrapper).ValidateCrossReferences
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc/validate.go:188
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate.func2
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:77
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:165
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate.Validate
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate/validate.go:72
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/nstree.Catalog.Validate
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/nstree/catalog.go:144
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*kvDescriptors).getAllDescriptors
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/kv_descriptors.go:279
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs.(*Collection).GetAllDescriptors
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/catalog/descs/collection.go:284
| | | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookupInternal
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2403
| | | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDescWithTableLookup
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2357
| | | | | | github.com/cockroachdb/cockroach/pkg/sql.forEachTableDesc
| | | | | | github.com/cockroachdb/cockroach/pkg/sql/information_schema.go:2285
| | | | | | github.com/cockroachdb/cockroach/pkg/sql.glob..func157
| | | | | | github.com/cockroachdb/cockroac...

Stacktrace (expand for inline code snippets):

case catalog.Table:
err = errors.Wrapf(err, catalog.Table+" %q (%d)", name, id)
case catalog.Database:
in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).decorate
}
vea.errors = append(vea.errors, vea.decorate(err))
}
in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).Report
for _, by := range desc.DependedOnBy {
vea.Report(desc.validateInboundTableRef(by, vdg))
}
in pkg/sql/catalog/tabledesc.(*wrapper).ValidateCrossReferences
if !desc.Dropped() {
desc.ValidateCrossReferences(&vea, vdg)
}
in pkg/sql/catalog/internal/validate.Validate.func2
vea.currentDescriptor = desc
validationFn(desc)
}
in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel
// Descriptor cross-reference checks.
if !vea.validateDescriptorsAtLevel(
catalog.ValidationLevelCrossReferences,
in pkg/sql/catalog/internal/validate.Validate
) (ve catalog.ValidationErrors) {
return validate.Validate(ctx, version, c, telemetry, targetLevel, descriptors...)
}
in pkg/sql/catalog/nstree.Catalog.Validate
descs := c.OrderedDescriptors()
ve := c.Validate(ctx, version, catalog.ValidationReadTelemetry, catalog.ValidationLevelCrossReferences, descs...)
if err := ve.CombinedError(); err != nil {
in pkg/sql/catalog/descs.(*kvDescriptors).getAllDescriptors
func (tc *Collection) GetAllDescriptors(ctx context.Context, txn *kv.Txn) (nstree.Catalog, error) {
return tc.kv.getAllDescriptors(ctx, txn, tc.version)
}
in pkg/sql/catalog/descs.(*Collection).GetAllDescriptors
) error {
all, err := p.Descriptors().GetAllDescriptors(ctx, p.txn)
if err != nil {
in pkg/sql.forEachTableDescWithTableLookupInternal
) error {
return forEachTableDescWithTableLookupInternal(
ctx, p, dbContext, virtualOpts, false /* allowAdding */, fn,
in pkg/sql.forEachTableDescWithTableLookup
) error {
return forEachTableDescWithTableLookup(ctx, p, dbContext, virtualOpts, func(
db catalog.DatabaseDescriptor,
in pkg/sql.forEachTableDesc
populate: func(ctx context.Context, p *planner, dbContext catalog.DatabaseDescriptor, addRow func(...tree.Datum) error) error {
return forEachTableDesc(ctx, p, dbContext, hideVirtual, /* no sequences in virtual schemas */
func(db catalog.DatabaseDescriptor, scName string, table catalog.TableDescriptor) error {
in pkg/sql.glob..func157
generator, cleanup, setupError := setupGenerator(ctx, func(ctx context.Context, pusher rowPusher) error {
return def.populate(ctx, p, dbDesc, func(row ...tree.Datum) error {
if err := e.validateRow(row, columns); err != nil {
in pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1
}
err := worker(ctx, funcRowPusher(addRow))
// If the query was canceled, next() will already return a
in pkg/sql.setupGenerator.func3
f(ctx)
}()
in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
GOROOT/src/runtime/asm_amd64.s#L1580-L1582 in runtime.goexit

pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).decorate at line 214
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).Report at line 149
pkg/sql/catalog/tabledesc/validate.go in pkg/sql/catalog/tabledesc.(*wrapper).ValidateCrossReferences at line 188
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate.func2 at line 77
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.(*validationErrorAccumulator).validateDescriptorsAtLevel at line 165
pkg/sql/catalog/internal/validate/validate.go in pkg/sql/catalog/internal/validate.Validate at line 72
pkg/sql/catalog/nstree/catalog.go in pkg/sql/catalog/nstree.Catalog.Validate at line 144
pkg/sql/catalog/descs/kv_descriptors.go in pkg/sql/catalog/descs.(*kvDescriptors).getAllDescriptors at line 279
pkg/sql/catalog/descs/collection.go in pkg/sql/catalog/descs.(*Collection).GetAllDescriptors at line 284
pkg/sql/information_schema.go in pkg/sql.forEachTableDescWithTableLookupInternal at line 2403
pkg/sql/information_schema.go in pkg/sql.forEachTableDescWithTableLookup at line 2357
pkg/sql/information_schema.go in pkg/sql.forEachTableDesc at line 2285
pkg/sql/information_schema.go in pkg/sql.glob..func157 at line 1122
pkg/sql/virtual_schema.go in pkg/sql.(*virtualDefEntry).getPlanInfo.func1.1 at line 567
pkg/sql/virtual_table.go in pkg/sql.setupGenerator.func3 at line 127
pkg/util/stop/stopper.go in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2 at line 494
GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1581
Tag Value
Cockroach Release v22.1.12
Cockroach SHA: 3b76f78
Platform linux amd64
Distribution CCL
Environment v22.1.12
Command server
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-23221

@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 Jan 9, 2023
@yuzefovich
Copy link
Member

dup of #91645

@exalate-issue-sync exalate-issue-sync bot changed the title sentry: validate.go:298: relation × (67): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found (1) keys: [sql.schema.validation_errors.read.cross_references.... sentry: validate.go:298: relation × (67): invalid depended-on-by relation back reference: referenced table ID 66: referenced descriptor not found (1) keys: [sql.schema.validation_errors.read.cross_references.... Jan 19, 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