{"record":{"id":"76ef4cc3bb3639ef","repo":"grpc-ecosystem/grpc-gateway","slug":"no-file-s-found","errorCode":null,"errorMessage":"no file %s found","messagePattern":"no file (.+?) found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/descriptor/registry.go","lineNumber":761,"sourceCode":"// SetProto3OptionalNullable set proto3OptionalNullable\nfunc (r *Registry) SetProto3OptionalNullable(proto3OptionalNullable bool) {\n\tr.proto3OptionalNullable = proto3OptionalNullable\n}\n\n// GetProto3OptionalNullable returns proto3OptionalNullable\nfunc (r *Registry) GetProto3OptionalNullable() bool {\n\treturn r.proto3OptionalNullable\n}\n\n// RegisterOpenAPIOptions registers OpenAPI options\nfunc (r *Registry) RegisterOpenAPIOptions(opts *openapiconfig.OpenAPIOptions) error {\n\tif opts == nil {\n\t\treturn nil\n\t}\n\n\tfor _, opt := range opts.File {\n\t\tif _, ok := r.files[opt.File]; !ok {\n\t\t\treturn fmt.Errorf(\"no file %s found\", opt.File)\n\t\t}\n\t\tr.fileOptions[opt.File] = opt.Option\n\t}\n\n\t// build map of all registered methods\n\tmethods := make(map[string]struct{})\n\tservices := make(map[string]struct{})\n\tfor _, f := range r.files {\n\t\tfor _, s := range f.Services {\n\t\t\tservices[s.FQSN()] = struct{}{}\n\t\t\tfor _, m := range s.Methods {\n\t\t\t\tmethods[m.FQMN()] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, opt := range opts.Method {\n\t\tqualifiedMethod := \".\" + opt.Method","sourceCodeStart":743,"sourceCodeEnd":779,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/descriptor/registry.go#L743-L779","documentation":"When applying per-file options (RegisterOptions/applyOptions), each entry in opts.File must correspond to a file already loaded into the registry. If r.files has no entry for the given file name, the registry cannot attach the option and fails fast with this error.","triggerScenarios":"Calling the options-registration API with opts.File containing a file name that was never loaded via loadFile/Registry.Load, or loaded under a different (fully-qualified, proto-import-path-relative) name.","commonSituations":"Passing an absolute path or OS path instead of the proto-relative name used at load time; typo in file name; options file referencing a proto that was removed from the compile set; running the plugin against a subset of protos while the options file covers all.","solutions":["Use the exact file name as passed to the registry load call (import-path-relative, e.g. 'path/to/file.proto')","Load the referenced .proto file before registering options","Remove stale entries from your options configuration for files no longer compiled","Print/log the keys of loaded files and diff against opts.File entries"],"exampleFix":"// before\nopts.File = append(opts.File, &FileOption{File: \"/abs/path/api.proto\", Option: ...})\n// after\nopts.File = append(opts.File, &FileOption{File: \"api.proto\", Option: ...})","handlingStrategy":"validation","validationCode":"loaded, err := reg.GetAllFQMNs() // or track loaded file names at load time\nfor _, opt := range opts.File {\n    if !loadedFiles[opt.File] {\n        return fmt.Errorf(\"file %q not loaded; use import-path-relative name\", opt.File)\n    }\n}\nerr = reg.RegisterOptions(opts)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use the exact file name the registry saw at load time (import-path-relative), never OS paths","Generate the options file entries from the same file list used for loading","Prune options entries when removing protos from the build"],"tags":["configuration","protobuf","options"],"backgroundTag":"unknown-file-reference","analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}