{"record":{"id":"eda46f6e47e2e2d8","repo":"getsops/sops","slug":"running-vault-with-a-prefixed-url-is-not-supported","errorCode":null,"errorMessage":"running Vault with a prefixed URL is not supported! (Format has to be like https://vault.example.com:8200/v1/transit/keys/keyName)","messagePattern":"running Vault with a prefixed URL is not supported! \\(Format has to be like https://vault\\.example\\.com:8200/v1/transit/keys/keyName\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hcvault/keysource.go","lineNumber":468,"sourceCode":"\t}\n\tdefer f.Close()\n\n\tbuf := bytes.NewBuffer(nil)\n\tif _, err := io.Copy(buf, f); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(buf.String()), nil\n}\n\n// engineAndKeyFromPath returns the engine path and key name from the full\n// path, or an error.\nfunc engineAndKeyFromPath(fullPath string) (enginePath, keyName string, err error) {\n\t// Running vault behind a reverse proxy with longer URLs seems not to be\n\t// supported by the Vault client API. Check for this here.\n\t// TODO(hidde): this may no longer be necessary with newer Vault versions,\n\t//  but needs to be confirmed.\n\tif re := regexp.MustCompile(`/[^/]+/v[\\d]+/[^/]+/[^/]+/[^/]+`); re.Match([]byte(fullPath)) {\n\t\terr = fmt.Errorf(\"running Vault with a prefixed URL is not supported! (Format has to be like \" +\n\t\t\t\"https://vault.example.com:8200/v1/transit/keys/keyName)\")\n\t\treturn\n\t} else if re := regexp.MustCompile(`/v[\\d]+/[^/]+/[^/]+/[^/]+`); !re.Match([]byte(fullPath)) {\n\t\terr = fmt.Errorf(\"vault path does not seem to be formatted correctly: (eg. \" +\n\t\t\t\"https://vault.example.com:8200/v1/transit/keys/keyName)\")\n\t\treturn\n\t}\n\n\tfullPath = strings.Trim(fullPath, \"/\")\n\tdirs := strings.Split(fullPath, \"/\")\n\n\tkeyName = dirs[len(dirs)-1]\n\tenginePath = path.Join(dirs[1 : len(dirs)-2]...)\n\treturn\n}\n","sourceCodeStart":450,"sourceCodeEnd":484,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/hcvault/keysource.go#L450-L484","documentation":"Error \"running Vault with a prefixed URL is not supported! (Format has to be like https://vault.example.com:8200/v1/transit/keys/keyName)\" thrown in getsops/sops.","triggerScenarios":"Thrown at hcvault/keysource.go:468 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}