{"record":{"id":"c32b2c296c04c53e","repo":"AlistGo/alist","slug":"createsession-failed-after-three-retries","errorCode":null,"errorMessage":"createSession failed after three retries","messagePattern":"createSession failed after three retries","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/aliyundrive/util.go","lineNumber":27,"sourceCode":"\n\t\"github.com/alist-org/alist/v3/drivers/base\"\n\t\"github.com/alist-org/alist/v3/internal/op\"\n\t\"github.com/alist-org/alist/v3/pkg/utils\"\n\t\"github.com/dustinxie/ecc\"\n\t\"github.com/go-resty/resty/v2\"\n\t\"github.com/google/uuid\"\n)\n\nfunc (d *AliDrive) createSession() error {\n\tstate, ok := global.Load(d.UserID)\n\tif !ok {\n\t\treturn fmt.Errorf(\"can't load user state, user_id: %s\", d.UserID)\n\t}\n\td.sign()\n\tstate.retry++\n\tif state.retry > 3 {\n\t\tstate.retry = 0\n\t\treturn fmt.Errorf(\"createSession failed after three retries\")\n\t}\n\t_, err, _ := d.request(\"https://api.alipan.com/users/v1/users/device/create_session\", http.MethodPost, func(req *resty.Request) {\n\t\treq.SetBody(base.Json{\n\t\t\t\"deviceName\":   \"samsung\",\n\t\t\t\"modelName\":    \"SM-G9810\",\n\t\t\t\"nonce\":        0,\n\t\t\t\"pubKey\":       PublicKeyToHex(&state.privateKey.PublicKey),\n\t\t\t\"refreshToken\": d.RefreshToken,\n\t\t})\n\t}, nil)\n\tif err == nil{\n\t\tstate.retry = 0\n\t}\n\treturn err\n}\n\n// func (d *AliDrive) renewSession() error {\n// \t_, err, _ := d.request(\"https://api.alipan.com/users/v1/users/device/renew_session\", http.MethodPost, nil, nil)","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/aliyundrive/util.go#L9-L45","documentation":"Error \"createSession failed after three retries\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/aliyundrive/util.go:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation."],"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-15T17:31:12.345Z"}