pot-app/pot-desktop · error · Error

Can not find file_id: ${JSON.stringify(result)}

Error message

Can not find file_id: ${JSON.stringify(result)}

What it means

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.

Source

Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:231

    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/openFile/create', {
        method: 'POST',
        headers: {
            Authorization: `Bearer ${token}`,
        },
        body: Body.json({
            drive_id,
            parent_file_id: 'root',
            name: 'pot-app',
            type: 'folder',
            check_name_mode: 'refuse',
        }),
    });
    if (res.ok) {
        const result = res.data;
        if (result['file_id']) {
            return result['file_id'];
        } else {
            throw new Error(`Can not find file_id: ${JSON.stringify(result)}`);
        }
    } else {
        const result = res.data;
        if (result['message']) {
            throw new Error(result['message']);
        } else {
            throw new Error(`Get accessToken Error: ${JSON.stringify(result)}`);
        }
    }
}

async function createFile(token, drive_id, dir_id, name) {
    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/openFile/create', {
        method: 'POST',
        headers: {
            Authorization: `Bearer ${token}`,
        },
        body: Body.json({

View on GitHub (pinned to 594d32ede9)

Solutions

  1. Read the JSON.stringify(result) in the message to identify the API error code (e.g. name conflict) and handle that specific code
  2. If the folder already exists, list or search for the existing 'pot-app' folder and reuse its file_id
  3. Verify the access token and drive_id are valid before calling create
  4. Catch the error in dir_id and retry with check_name_mode 'auto_rename' or a lookup-then-create flow
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:231 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pot-app/pot-desktop@594d32ede9 (2026-09-02). Data as JSON: /api/errors/a7bd104ebd32c22d. Report an issue: GitHub.