owasp-amass/amass · error
libpostal is not available
Error message
libpostal is not available
What it means
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.
Source
Thrown at internal/libpostal/cgo_specific.go:50
if bool(C.libpostal_setup()) && bool(C.libpostal_setup_parser()) {
postalLibAvailable = true
}
}
func getDefaultParserOptions() ParserOptions {
return ParserOptions{
Language: "",
Country: "",
}
}
func ParseAddress(ctx context.Context, address string) ([]ParsedComponent, error) {
return ParseAddressOptions(ctx, address, parserDefaultOptions)
}
func ParseAddressOptions(ctx context.Context, address string, options ParserOptions) ([]ParsedComponent, error) {
if !postalLibAvailable {
return nil, errors.New(ErrPostalLibNotAvailable)
}
if !utf8.ValidString(address) {
return nil, errors.New("address is not a valid UTF-8 string")
}
postalLock.Lock()
defer postalLock.Unlock()
cAddress := C.CString(address)
defer C.free(unsafe.Pointer(cAddress))
cOptions := C.libpostal_get_address_parser_default_options()
if options.Language != "" {
cLanguage := C.CString(options.Language)
defer C.free(unsafe.Pointer(cLanguage))
cOptions.language = cLanguageView on GitHub (pinned to 79299dce87)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/libpostal/cgo_specific.go:50 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/dafafa1f7c1159e1.
Report an issue: GitHub.