{"record":{"id":"e407ada467893936","repo":"hashicorp/nomad","slug":"error-getting-client-config-v","errorCode":null,"errorMessage":"error getting client config: %v","messagePattern":"error getting client config: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/meta.go","lineNumber":625,"sourceCode":"\t\treturn hint\n\t}\n\n\treturn fmt.Sprintf(\"%[1]s%[2]s%[3]s%[4]s%[5]s %[6]s%[7]s%[8]s\",\n\t\tbold,\n\t\tmagenta,\n\t\tuiHintDelimiter[1:], // \"==> \"\n\t\tdescription,\n\t\tresetter,\n\t\tblue,\n\t\turl,\n\t\tresetter,\n\t)\n}\n\nfunc (m *Meta) buildUIPath(route UIRoute, params map[string]string) (string, error) {\n\tclient, err := m.Client()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error getting client config: %v\", err)\n\t}\n\n\tpath := route.Path\n\tfor k, v := range params {\n\t\tpath = strings.ReplaceAll(path, fmt.Sprintf(\":%s\", k), v)\n\t}\n\n\treturn fmt.Sprintf(\"%s/ui%s\", client.Address(), path), nil\n}\n\nfunc (m *Meta) showUIPath(ctx UIHintContext) (string, error) {\n\troute, exists := CommandUIRoutes[ctx.Command]\n\tif !exists {\n\t\treturn \"\", nil\n\t}\n\n\turl, err := m.buildUIPath(route, ctx.PathParams)\n\tif err != nil {","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/meta.go#L607-L643","documentation":"Returned by Meta.buildUIPath when m.Client() fails to construct a Nomad API client while generating a Nomad UI deep-link URL (e.g. for `nomad job inspect -open-ui` style flows). It wraps the client-construction error, which almost always stems from missing/invalid address or TLS/credential configuration rather than cluster state.","triggerScenarios":"Any command path that builds a UI route where the Meta's Client() call errors: NOMAD_ADDR unset or malformed (bad URL scheme), invalid NOMAD_CACERT/NOMAD_CLIENT_CERT paths, unparsable TLS config, or bad secret ID format in NOMAD_TOKEN.","commonSituations":"Running the CLI outside a scheduled environment where NOMAD_ADDR was never exported; typo'd https:// address or missing port; cert files removed or unreadable; mixing env vars from different clusters in CI.","solutions":["Check the wrapped %v cause for the exact config problem (bad address, missing cert file, etc.).","Set/verify NOMAD_ADDR, e.g. export NOMAD_ADDR=https://nomad.example.com:4646.","Validate TLS env vars (NOMAD_CACERT, NOMAD_CLIENT_CERT, NOMAD_CLIENT_KEY) point to readable files.","Confirm NOMAD_TOKEN is set and well-formed if ACLs are enabled.","Run `nomad node status` to confirm the client config works for other commands."],"exampleFix":"// before\nnomad job status -json webapp   # fails: NOMAD_ADDR unset\n// after\nexport NOMAD_ADDR=https://nomad.service.consul:4646\nnomad job status -json webapp","handlingStrategy":"validation","validationCode":": \"${NOMAD_ADDR:?NOMAD_ADDR must be set, e.g. https://nomad.example.com:4646}\"\n[ -z \"$NOMAD_CACERT\" ] || [ -r \"$NOMAD_CACERT\" ] || { echo \"NOMAD_CACERT not readable: $NOMAD_CACERT\"; exit 1; }","typeGuard":null,"tryCatchPattern":"url, err := meta.BuildUIPath(route, params)\nif err != nil && strings.Contains(err.Error(), \"error getting client config\") {\n    // surface config guidance rather than retrying\n    return fmt.Errorf(\"fix NOMAD_ADDR/TLS config: %w\", err)\n}","preventionTips":["Export NOMAD_ADDR (and TLS vars) in shell profiles and CI before any nomad command.","Validate config once with a cheap command like `nomad node status`.","Keep cert/key files present and readable on the machine.","Avoid mixing env vars from different clusters in shared environments."],"tags":["nomad-cli","client-config","tls","environment"],"backgroundTag":"missing-env-var","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}