{"record":{"id":"629e00cfb51640cf","repo":"temporalio/temporal","slug":"detected-no-advertised-hostname-key-or-empty-value","errorCode":null,"errorMessage":"detected no advertised-hostname key or empty value for translator plugin options","messagePattern":"detected no advertised-hostname key or empty value for translator plugin options","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/persistence/nosql/nosqlplugin/cassandra/translator/fixed_address_translator.go","lineNumber":65,"sourceCode":"// and it will always return same fixed ip based on what advertised-hostname is resolved to. That IP address,\n// from client's perspective, might be, for example, an IP address of a load balancer which is reachable from client.\n// As the IP address of all nodes are some, the difference between the nodes can be achieved by running them on\n// a different port for each node.\n// see also https://github.com/gocql/gocql/pull/1635\nfunc (plugin *FixedAddressTranslatorPlugin) GetTranslator(cfg *config.Cassandra) (gocql.AddressTranslator, error) {\n\tif cfg.AddressTranslator == nil {\n\t\treturn nil, errors.New(\"there is no addressTranslator configuration in cassandra configuration\")\n\t}\n\n\topts := cfg.AddressTranslator.Options\n\tif opts == nil {\n\t\treturn nil, errors.New(\"there are no options for translator plugin\")\n\t}\n\n\tadvertisedHostname, found := opts[advertisedHostnameKey]\n\n\tif !found || len(advertisedHostname) == 0 {\n\t\treturn nil, errors.New(\"detected no advertised-hostname key or empty value for translator plugin options\")\n\t}\n\n\tvar resolvedIp net.IP = nil\n\tips, _ := net.LookupIP(advertisedHostname)\n\tfor _, ip := range ips {\n\t\tif ipv4 := ip.To4(); ipv4 != nil {\n\t\t\tresolvedIp = ipv4\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif resolvedIp == nil {\n\t\treturn nil, fmt.Errorf(\"no resolved IP for advertised hostname %q\", advertisedHostname)\n\t}\n\n\treturn gocql.AddressTranslatorFunc(func(addr net.IP, port int) (net.IP, int) {\n\t\treturn resolvedIp, port\n\t}), nil","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/persistence/nosql/nosqlplugin/cassandra/translator/fixed_address_translator.go#L47-L83","documentation":"The fixed address translator distinguishes Cassandra nodes by port, so it needs each node's advertised hostname. GetTranslator looks up key advertised-hostname in AddressTranslator.Options; if the key is absent or its value is an empty string, it returns this error.","triggerScenarios":"Calling GetTranslator with Options non-nil but missing the advertised-hostname key, or with options: {advertised-hostname: \"\"}.","commonSituations":"Typo in the key name (e.g. advertisedHostname or advertised_host); leaving the value empty in templated config because a node env var was unset; copying config from docs that used a different plugin's option names.","solutions":["Set options.advertised-hostname to a non-empty hostname or IP per Cassandra node","Fix the exact key spelling: advertised-hostname","Ensure the templating source (env var, helm value) that feeds advertised-hostname is actually populated"],"exampleFix":"// before\naddressTranslator:\n  options:\n    server-address: \"127.0.0.1\"\n// after\naddressTranslator:\n  options:\n    server-address: \"127.0.0.1\"\n    advertised-hostname: \"cassandra-0\"\n","handlingStrategy":"validation","validationCode":"opts := cfg.AddressTranslator.Options\nv, ok := opts[\"advertised-hostname\"]\nif !ok || len(v) == 0 {\n    return errors.New(\"advertised-hostname must be set and non-empty\")\n}\nif _, err := net.LookupIP(v); err != nil {\n    return fmt.Errorf(\"advertised-hostname %q not resolvable: %w\", v, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact key spelling advertised-hostname (hyphenated, lowercase)","Ensure templating always populates the value; fail deploys on empty node hostnames","Spot-check resolution of the hostname from the client's network"],"tags":["cassandra","address-translator","configuration"],"backgroundTag":"missing-config-key","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}