t8y2/dbx · error

scheduler jobs must be read from the scheduler job scope

Error message

scheduler jobs must be read from the scheduler job scope

What it means

getSchedulerJobSource reconstructs a replayable DBMS_SCHEDULER.CREATE_JOB call, but Xugu stores scheduler jobs at database scope rather than under a schema. The function therefore requires the synthetic scheduler-job scope and rejects any other schema value with this error.

Solutions

  1. Pass the synthetic scheduler job scope (as returned when jobs are listed) as the schema parameter
  2. Route scheduler-job requests through the scheduler job sidebar scope, not a database schema
  3. Update client code that assumes jobs are schema-scoped

Example fix

// before
agent.GetSchedulerJobSource(ctx, "public", jobName)
// after
scope := schedulerJobScope() // synthetic scope from job listing
agent.GetSchedulerJobSource(ctx, scope, jobName)
Defensive patterns

Strategy: validation

Validate before calling

if !isXuguSchedulerJobScope(schema) { return errors.New("use the scheduler job scope") }

Type guard

func isSchedulerScope(schema string) bool { return schema == schedulerJobScopeValue }

Try / catch

src, err := agent.GetSchedulerJobSource(ctx, schema, name)
if err != nil && strings.Contains(err.Error(), "scheduler job scope") { return ErrInvalidSchedulerScope }

Prevention

When it happens

Trigger: Calling the scheduler-job source/metadata RPC with a schema that fails isXuguSchedulerJobScope(schema) — e.g. passing a real schema name, an empty schema, or the default scope instead of the special scheduler job scope.

Common situations: Clients treating scheduler jobs like schema-scoped objects and passing the job's apparent schema; stale sidebar routing after the agent changed scope conventions; hardcoding a schema instead of using the synthetic scope returned by job listings.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/9c723200adafaf40. Report an issue: GitHub.

Appendix: source

Thrown at agents/drivers/xugu/main.go:3217

	BeginTime      any
	RepeatInterval any
	EndTime        any
	Enabled        any
	AutoDrop       any
	Comments       any
}

const xuguCatalogSchedulerJobNameSelectSQL = `
SELECT JOB_NAME
FROM ALL_JOBS
WHERE DB_ID = CURRENT_DB_ID`

// getSchedulerJobSource reconstructs a replayable DBMS_SCHEDULER.CREATE_JOB
// call from the catalog. Xugu stores jobs at database scope rather than under
// a schema, so the returned synthetic scope is retained for sidebar routing.
func (s *server) getSchedulerJobSource(schema, name string) (map[string]any, error) {
	if !isXuguSchedulerJobScope(schema) {
		return nil, errors.New("scheduler jobs must be read from the scheduler job scope")
	}
	jobName, err := s.resolveCatalogSchedulerJobName(name)
	if err != nil {
		return nil, err
	}
	rows, err := s.queryRows(xuguSchedulerJobMetadataQuery(jobName), nil)
	if err != nil {
		return nil, err
	}
	defer s.closeRows(rows)

	result := map[string]any{
		"name":        jobName,
		"object_type": "JOB",
		"schema":      xuguSchedulerJobScope,
		"source":      "",
		"editable":    false,
	}

View on GitHub (pinned to c0390bff16)