{"record":{"id":"0367681f0cfb4b2e","repo":"t8y2/dbx","slug":"scheduler-job-not-found-s","errorCode":null,"errorMessage":"scheduler job not found: %s","messagePattern":"scheduler job not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":3275,"sourceCode":"\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(candidates) == 0 {\n\t\tcandidates, err = s.catalogSchedulerJobNameCandidates(xuguCatalogSchedulerJobNameQuery(name, true))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\tfor _, candidate := range candidates {\n\t\tif candidate == name {\n\t\t\treturn candidate, nil\n\t\t}\n\t}\n\tif len(candidates) == 1 {\n\t\treturn candidates[0], nil\n\t}\n\tif len(candidates) == 0 {\n\t\treturn \"\", fmt.Errorf(\"scheduler job not found: %s\", name)\n\t}\n\treturn \"\", fmt.Errorf(\"scheduler job name is ambiguous: %s; specify the catalog's exact case\", name)\n}\n\nfunc xuguCatalogSchedulerJobNameQuery(name string, caseInsensitive bool) string {\n\texpr := quoteStringLiteral(name)\n\tif caseInsensitive {\n\t\texpr = quoteStringLiteral(strings.ToUpper(name))\n\t\treturn xuguCatalogSchedulerJobNameSelectSQL + \"\\n  AND UPPER(JOB_NAME) = \" + expr\n\t}\n\treturn xuguCatalogSchedulerJobNameSelectSQL + \"\\n  AND JOB_NAME = \" + expr\n}\n\nfunc (s *server) catalogSchedulerJobNameCandidates(query string) ([]string, error) {\n\trows, err := s.queryRows(strings.TrimSpace(query), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":3257,"sourceCodeEnd":3293,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L3257-L3293","documentation":"The scheduler-job resolver matches a job name against catalog candidates case-insensitively. When no candidate matches, it returns 'scheduler job not found: <name>'. Xugu jobs are database-scoped (not schema objects), so lookup is purely by name within the current database.","triggerScenarios":"Calling a scheduler-job RPC (e.g. resolve job name / get source) with a job name that does not exist in the current database — wrong spelling, wrong case under a case-sensitive match, or the job lives in another database.","commonSituations":"Job dropped or renamed since the client cached its name; connected to a different database than where the job lives; typo or case mismatch.","solutions":["List the actual scheduler jobs in the current database and use an exact existing name.","Verify you are connected to the database that owns the job.","Check the name's spelling and case against the catalog and retry with exact case.","Recreate the job if it was dropped unintentionally."],"exampleFix":"// before\ngetSchedulerJobSource(\"Nightly_Etl\") // not found\n// after\njobs := listSchedulerJobs() // shows \"NIGHTLY_ETL\"\ngetSchedulerJobSource(jobs[0])","handlingStrategy":"validation","validationCode":"// verify job name against the catalog before RPC\njobs := listSchedulerJobs()\nif !contains(jobs, name) {\n  return fmt.Errorf(\"job %q not in catalog; existing: %v\", name, jobs)\n}","typeGuard":null,"tryCatchPattern":"if err := getJobSource(name); err != nil {\n  if strings.Contains(err.Error(), \"scheduler job not found\") {\n    name = pickExactNameFromListing(listSchedulerJobs())\n    getJobSource(name)\n  }\n}","preventionTips":["List jobs before resolving by name.","Always connect to the database that owns the job.","Store job names with exact catalog casing.","Refresh caches after job DDL changes."],"tags":["scheduler","not-found","naming","xugu"],"backgroundTag":"object-not-found","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}