Skip to content

ipfs.files.mv(from, to, { parents: true }), failing when parent directories don’t exist #353

@matthewjosephtaylor

Description

@matthewjosephtaylor

Using v6.0.2 of kubo-rpc-client and 0.38.1 of the kubo docker container.

NOTE: the 'mv' command which works if I pre-create the directories ahead of time.

Error

file does not exist
HTTPError: Internal Server Error

the POST URL the library is calling

http://<host>:5001/api/v0/files/mv?parents=true&arg=%2Ftest%2Fhello.txt&arg=%2Ftrash%2Ftest%2Fhello.txt 500 (Internal Server Error)

Possible fix

Perhaps need to update docs to reflect that 'parents:true' is not respected by Kubo node backend?

Workaround

    const trashDir = dirname(trashPath);
    await ipfs.files.mkdir(trashDir, { parents: true });
    return ipfs.files.mv(path, trashPath); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions