{"record":{"id":"dafafa1f7c1159e1","repo":"owasp-amass/amass","slug":"libpostal-is-not-available-dafafa","errorCode":null,"errorMessage":"libpostal is not available","messagePattern":"libpostal is not available","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/libpostal/cgo_specific.go","lineNumber":50,"sourceCode":"\tif bool(C.libpostal_setup()) && bool(C.libpostal_setup_parser()) {\n\t\tpostalLibAvailable = true\n\t}\n}\n\nfunc getDefaultParserOptions() ParserOptions {\n\treturn ParserOptions{\n\t\tLanguage: \"\",\n\t\tCountry:  \"\",\n\t}\n}\n\nfunc ParseAddress(ctx context.Context, address string) ([]ParsedComponent, error) {\n\treturn ParseAddressOptions(ctx, address, parserDefaultOptions)\n}\n\nfunc ParseAddressOptions(ctx context.Context, address string, options ParserOptions) ([]ParsedComponent, error) {\n\tif !postalLibAvailable {\n\t\treturn nil, errors.New(ErrPostalLibNotAvailable)\n\t}\n\n\tif !utf8.ValidString(address) {\n\t\treturn nil, errors.New(\"address is not a valid UTF-8 string\")\n\t}\n\n\tpostalLock.Lock()\n\tdefer postalLock.Unlock()\n\n\tcAddress := C.CString(address)\n\tdefer C.free(unsafe.Pointer(cAddress))\n\n\tcOptions := C.libpostal_get_address_parser_default_options()\n\tif options.Language != \"\" {\n\t\tcLanguage := C.CString(options.Language)\n\t\tdefer C.free(unsafe.Pointer(cLanguage))\n\n\t\tcOptions.language = cLanguage","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/internal/libpostal/cgo_specific.go#L32-L68","documentation":"ParseAddressOptions was called while the libpostal C library failed to initialize (libpostal_setup/libpostal_setup_parser returned false at process start), so postalLibAvailable is false. This is a sentinel guard (ErrPostalLibNotAvailable): the CGO bindings are compiled in but the native library/data files are unusable or were never set up.","triggerScenarios":"Thrown at internal/libpostal/cgo_specific.go:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify libpostal and its data files are installed (libpostal_data download-all / make install) and reachable by the linker/runtime","Run the setup routines once in an init path you control and log the failure before any ParseAddress call","Disable the libpostal-backed features or build tag them out when the environment cannot provide the library"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}