{"record":{"id":"dfe0fa2b84341816","repo":"owasp-amass/amass","slug":"unexpected-meta-type-t","errorCode":null,"errorMessage":"unexpected Meta type: %T","messagePattern":"unexpected Meta type: %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/api/hunterio.go","lineNumber":158,"sourceCode":"\n\tvar result responseJSON\n\tresp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: h.emailVerifierurl + email.Address + \"&api_key=\" + api})\n\tif err != nil {\n\t\te.Session.Log().Error(fmt.Sprintf(\"Failed to make Verify request: %v\", err),\n\t\t\tslog.Group(\"plugin\", \"name\", h.name, \"handler\", h.name+\"-Email-Verification-Handler\"))\n\t\treturn nil\n\t}\n\n\tif err := json.NewDecoder(strings.NewReader(resp.Body)).Decode(&result); err != nil {\n\t\te.Session.Log().Error(fmt.Sprintf(\"Failed to decode JSON: %v\", err),\n\t\t\tslog.Group(\"plugin\", \"name\", h.name, \"handler\", h.name+\"-Email-Verification-Handler\"))\n\t\treturn nil\n\t}\n\n\teventMeta, ok := e.Meta.(*et.EmailMeta)\n\tif !ok {\n\t\tif e.Meta != nil {\n\t\t\treturn fmt.Errorf(\"unexpected Meta type: %T\", e.Meta)\n\t\t}\n\t\treturn nil\n\t}\n\teventMeta.VerifyAttempted = true\n\n\tif result.Data.Status != \"unknown\" && result.Data.Status != \"invalid\" &&\n\t\tresult.Data.Status != \"disposable\" && result.Data.Status != \"accept_all\" {\n\t\teventMeta.Verified = true\n\t}\n\treturn nil\n}\n\nfunc (h *hunterIO) account_type(e *et.Event) (string, error) {\n\tapi, err := support.GetAPI(h.name, e)\n\tif err != nil || api == \"\" {\n\t\treturn \"\", err\n\t}\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/api/hunterio.go#L140-L176","documentation":"This hunter.io plugin handler expects the event's Meta field to be a *et.EmailMeta pointer. If the type assertion fails and Meta is non-nil, the actual email-verification result cannot be applied to the event, so it returns this error naming the concrete unexpected Go type via %T. It is a defensive invariant check against events of the wrong type reaching this handler.","triggerScenarios":"An event is delivered to this handler with Meta set to a concrete type other than *et.EmailMeta (e.g., *et.DNSResponse, *et.FQDN, or another service record), typically from a misconfigured event stream/subscription or a plugin emitting wrongly-typed metadata.","commonSituations":"Pipeline wiring changes where the hunterio handler is subscribed to event types it does not support; a plugin refactor changes the Meta payload type; shared callback registered for multiple event types without discriminating on Meta.","solutions":["Check which event type is routed to this handler and ensure only events carrying *et.EmailMeta reach it.","Fix the event subscription/filter so the handler only receives email-related events.","Update the handler to accept and branch on the new Meta type if the pipeline intentionally delivers it.","Audit the emitting plugin to confirm it sets Meta to *et.EmailMeta for these events."],"exampleFix":"// before\neventMeta, ok := e.Meta.(*et.EmailMeta)\nif !ok {\n\tif e.Meta != nil {\n\t\treturn fmt.Errorf(\"unexpected Meta type: %T\", e.Meta)\n\t}\n\treturn nil\n}\n// after\neventMeta, ok := e.Meta.(*et.EmailMeta)\nif !ok {\n\tif e.Meta != nil {\n\t\treturn fmt.Errorf(\"hunterio: unexpected Meta type %T; expected *et.EmailMeta\", e.Meta)\n\t}\n\treturn nil\n}","handlingStrategy":"type-guard","validationCode":"if e.Meta == nil {\n\treturn nil // nothing to verify\n}","typeGuard":"eventMeta, ok := e.Meta.(*et.EmailMeta)\nif !ok {\n\t// not an email-meta event: skip or log %T\n}","tryCatchPattern":"if err := handler(e); err != nil {\n\tif strings.Contains(err.Error(), \"unexpected Meta type\") {\n\t\t// mis-routed event: fix subscription, log and continue\n\t}\n}","preventionTips":["Subscribe handlers only to event types they support","Always nil-check Meta before type assertion","Include %T in assertion errors for fast diagnosis","Add tests covering wrong-typed Meta events"],"tags":["go","type-assertion","events","pipeline"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}