{"record":{"id":"4ba6555a196450cd","repo":"AlistGo/alist","slug":"failed-to-create-credential-w","errorCode":null,"errorMessage":"failed to create credential: %w","messagePattern":"failed to create credential: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/azure_blob/driver.go","lineNumber":50,"sourceCode":"\treturn d.config\n}\n\n// GetAddition returns additional settings specific to Azure Blob Storage.\nfunc (d *AzureBlob) GetAddition() driver.Additional {\n\treturn &d.Addition\n}\n\n// Init initializes the Azure Blob Storage client using shared key authentication.\nfunc (d *AzureBlob) Init(ctx context.Context) error {\n\t// Validate the endpoint URL\n\taccountName := extractAccountName(d.Addition.Endpoint)\n\tif !regexp.MustCompile(`^[a-z0-9]+$`).MatchString(accountName) {\n\t\treturn fmt.Errorf(\"invalid storage account name: must be chars of lowercase letters or numbers only\")\n\t}\n\n\tcredential, err := azblob.NewSharedKeyCredential(accountName, d.Addition.AccessKey)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create credential: %w\", err)\n\t}\n\n\t// Check if Endpoint is just account name\n\tendpoint := d.Addition.Endpoint\n\tif accountName == endpoint {\n\t\tendpoint = fmt.Sprintf(\"https://%s.blob.core.windows.net/\", accountName)\n\t}\n\t// Initialize Azure Blob client with retry policy\n\tclient, err := azblob.NewClientWithSharedKeyCredential(endpoint, credential,\n\t\t&azblob.ClientOptions{ClientOptions: azcore.ClientOptions{\n\t\t\tRetry: policy.RetryOptions{\n\t\t\t\tMaxRetries: MaxRetries,\n\t\t\t\tRetryDelay: RetryDelay,\n\t\t\t},\n\t\t}})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create client: %w\", err)\n\t}","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/azure_blob/driver.go#L32-L68","documentation":"Error \"failed to create credential: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/azure_blob/driver.go:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the account credentials in the storage configuration and correct them, then save and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}