{"record":{"id":"a7bd104ebd32c22d","repo":"pot-app/pot-desktop","slug":"can-not-find-file-id-json-stringify-result","errorCode":null,"errorMessage":"Can not find file_id: ${JSON.stringify(result)}","messagePattern":"Can not find file_id: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/window/Config/pages/Backup/utils/aliyun.jsx","lineNumber":231,"sourceCode":"    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/openFile/create', {\n        method: 'POST',\n        headers: {\n            Authorization: `Bearer ${token}`,\n        },\n        body: Body.json({\n            drive_id,\n            parent_file_id: 'root',\n            name: 'pot-app',\n            type: 'folder',\n            check_name_mode: 'refuse',\n        }),\n    });\n    if (res.ok) {\n        const result = res.data;\n        if (result['file_id']) {\n            return result['file_id'];\n        } else {\n            throw new Error(`Can not find file_id: ${JSON.stringify(result)}`);\n        }\n    } else {\n        const result = res.data;\n        if (result['message']) {\n            throw new Error(result['message']);\n        } else {\n            throw new Error(`Get accessToken Error: ${JSON.stringify(result)}`);\n        }\n    }\n}\n\nasync function createFile(token, drive_id, dir_id, name) {\n    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/openFile/create', {\n        method: 'POST',\n        headers: {\n            Authorization: `Bearer ${token}`,\n        },\n        body: Body.json({","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/pot-app/pot-desktop/blob/594d32ede96acd106b0256deaa8bb440ffcdff40/src/window/Config/pages/Backup/utils/aliyun.jsx#L213-L249","documentation":"createDir() POSTed an openFile/create request to alipan to create the 'pot-app' folder; the response was HTTP-ok but its JSON body lacked a file_id field. Since check_name_mode is 'refuse', this commonly happens when a folder with that name already exists and the API returns an error/existing-file payload instead of a new file_id, or when the request failed logically despite the 200 status.","triggerScenarios":"Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the JSON.stringify(result) in the message to identify the API error code (e.g. name conflict) and handle that specific code","If the folder already exists, list or search for the existing 'pot-app' folder and reuse its file_id","Verify the access token and drive_id are valid before calling create","Catch the error in dir_id and retry with check_name_mode 'auto_rename' or a lookup-then-create flow"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"594d32ede96acd106b0256deaa8bb440ffcdff40","analyzedAt":"2026-09-02T18:12:21.811Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}