{"record":{"id":"64ee23babea4a9a0","repo":"AlistGo/alist","slug":"can-t-load-user-state-user-id-s","errorCode":null,"errorMessage":"can't load user state, user_id: %s","messagePattern":"can't load user state, user_id: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/aliyundrive/util.go","lineNumber":21,"sourceCode":"import (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\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","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/aliyundrive/util.go#L3-L39","documentation":"Error \"can't load user state, user_id: %s\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/aliyundrive/util.go:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), 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-15T17:31:12.345Z"}