{"record":{"id":"356585b2d60cd7ea","repo":"vitessio/vitess","slug":"no-symbol-found-with-name-s","errorCode":null,"errorMessage":"no symbol found with name %s","messagePattern":"no symbol found with name (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctldclient/codegen/main.go","lineNumber":327,"sourceCode":"\t\tfor _, e := range pkg.Errors {\n\t\t\tswitch err {\n\t\t\tcase nil:\n\t\t\t\terr = fmt.Errorf(\"errors loading package %s: %s\", source, e.Error())\n\t\t\tdefault:\n\t\t\t\terr = fmt.Errorf(\"%w; %s\", err, e.Error())\n\t\t\t}\n\t\t}\n\n\t\treturn nil, err\n\t}\n\n\treturn pkg, nil\n}\n\nfunc extractSourceInterface(pkg *packages.Package, name string) (*types.Interface, error) {\n\tobj := pkg.Types.Scope().Lookup(name)\n\tif obj == nil {\n\t\treturn nil, fmt.Errorf(\"no symbol found with name %s\", name)\n\t}\n\n\tswitch t := obj.Type().(type) {\n\tcase *types.Named:\n\t\tiface, ok := t.Underlying().(*types.Interface)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"symbol %s was not an interface but %T\", name, t.Underlying())\n\t\t}\n\n\t\treturn iface, nil\n\tcase *types.Interface:\n\t\treturn t, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"symbol %s was not an interface but %T\", name, obj.Type())\n}\n\nvar vitessProtoRegexp = regexp.MustCompile(`^vitess\\.io.*/proto/.*`)","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctldclient/codegen/main.go#L309-L345","documentation":"extractSourceInterface looks up the interface name given on the codegen command line in the loaded package's type scope. This error means no top-level symbol with that exact name exists in the package, so the generator cannot find the source interface to mirror.","triggerScenarios":"Passing a name (e.g. 'VtctldServer' or a service interface name) that is misspelled, or that does not exist as a package-level identifier in the package loaded by loadPackage.","commonSituations":"Renaming/refactoring the interface and forgetting to update the codegen invocation; passing a method name instead of the interface name; passing a lowercase (unexported or local) symbol that the scope lookup cannot resolve as expected; running codegen against the wrong package path.","solutions":["Check the name argument for typos and correct casing — Go scope lookup is case-sensitive","Confirm the interface is declared at package level in the package passed to loadPackage","Use grep/IDE to find the exact identifier in the target package","Update the codegen script/Makefile target to the current interface name after a rename"],"exampleFix":"// before\n$ codegen --source-interface VtctldServ\n// no symbol found with name VtctldServ\n// after\n$ codegen --source-interface VtctldServer\n","handlingStrategy":"validation","validationCode":"// Verify the interface exists before invoking codegen\nif !strings.Contains(source, \"type \"+ifaceName+\" interface {\") {\n    return fmt.Errorf(\"interface %s not declared in package\", ifaceName)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the interface name exactly, case-sensitive, from the source file","Use the Makefile/script target rather than hand-typed arguments","After renames, grep for the old name in codegen scripts"],"tags":["go","codegen","symbol-lookup","reflection"],"backgroundTag":"symbol-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}