{"record":{"id":"726f0a2aff7f50a9","repo":"kubernetes/kops","slug":"no-container-specified-in-q-expected-azureblob","errorCode":null,"errorMessage":"no container specified in %q; expected azureblob://<account>/<container>/<key>","messagePattern":"no container specified in %q; expected azureblob://<account>/<container>/<key>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/context.go","lineNumber":591,"sourceCode":"\n\tu, err := url.Parse(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse %q: %s\", p, err)\n\t}\n\n\tif u.Scheme != \"azureblob\" {\n\t\treturn nil, fmt.Errorf(\"invalid Azure Blob scheme: %q\", p)\n\t}\n\n\taccount := strings.TrimSuffix(u.Host, \"/\")\n\tif account == \"\" {\n\t\treturn nil, fmt.Errorf(\"no storage account specified in %q; expected azureblob://<account>/<container>/<key>\", p)\n\t}\n\n\trest := strings.TrimPrefix(u.Path, \"/\")\n\tcontainer, key, _ := strings.Cut(rest, \"/\")\n\tif container == \"\" {\n\t\treturn nil, fmt.Errorf(\"no container specified in %q; expected azureblob://<account>/<container>/<key>\", p)\n\t}\n\n\treturn NewAzureBlobPath(c, account, container, key), nil\n}\n\n// getAzureBlobClient returns the client for azure blob storage for the given\n// storage account, caching it for future reuse.\nfunc (c *VFSContext) getAzureBlobClient(ctx context.Context, account string) (*azblob.Client, error) {\n\tif account == \"\" {\n\t\treturn nil, fmt.Errorf(\"Azure storage account is required\")\n\t}\n\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\tif client, ok := c.azureClients[account]; ok {\n\t\treturn client, nil\n\t}","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/context.go#L573-L609","documentation":"buildAzureBlobPath requires azureblob://<account>/<container>/<key>. After extracting the account from the host, it splits the remaining path into container and key; this error is thrown when the container segment (the first path component) is empty or missing.","triggerScenarios":"Calling BuildVfsPath with \"azureblob://myaccount\", \"azureblob://myaccount/\", or \"azureblob://myaccount/key\" (no first path segment before the key).","commonSituations":"State store URLs missing the container because users copy the account-only connection pattern, or keys placed directly after the account without an intermediate container name.","solutions":["Add the container name as the first path segment: azureblob://<account>/<container>/<key>.","Ensure the key is not placed directly after the account; there must be exactly one container segment between account and key.","Verify the container exists in the storage account (kops will not create it implicitly here)."],"exampleFix":"// before\nBuildVfsPath(\"azureblob://myaccount/clusterstate\")\n// after\nBuildVfsPath(\"azureblob://myaccount/kops-container/clusterstate\")","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(stateStore)\nif u.Scheme == \"azureblob\" {\n    parts := strings.SplitN(strings.TrimPrefix(u.Path, \"/\"), \"/\", 2)\n    if len(parts) < 2 || parts[0] == \"\" {\n        return fmt.Errorf(\"azureblob state store %q is missing the container\", stateStore)\n    }\n}","typeGuard":"func hasAzureBlobContainer(p string) bool {\n    u, err := url.Parse(p)\n    if err != nil || u.Scheme != \"azureblob\" || u.Host == \"\" {\n        return false\n    }\n    container, _, _ := strings.Cut(strings.TrimPrefix(u.Path, \"/\"), \"/\")\n    return container != \"\"\n}","tryCatchPattern":null,"preventionTips":["Include the container as the first path segment after the account.","Never place the object key directly after the account name.","Document the expected URL shape where the state store is configured."],"tags":["azure","vfs","configuration","url-parsing"],"backgroundTag":"azureblob-url-missing-container","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}