Can't ls OneDrive Business shared folder not in root of drive

What is the problem you are having with rclone?

If someone in OneDrive for Business shares with me a folder that is not in the root of their drive, rclone can't ls it. (Didn't try other operations, since I can't ls it at all).

Looking at the output of --dump bodies, the reason is that rclone tries to access the parent directories of the path provided, but OneDrive returns a 404 for those. (Trying it in the MS Graph Explorer, I can get the folder if I go to it directly, but I get a 404 for any of the parent directories of the path.)

What is your rclone version (output from rclone version)

rclone v1.53.1
- os/arch: linux/amd64
- go version: go1.15.2

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux 5.8.12.a-1-hardened x86_64

Which cloud storage system are you using? (eg Google Drive)

OneDrive for Business

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsl <remote>:<path to folder>

The rclone config contents with secrets removed.

[<remote>]
type = onedrive
token = {"access_token": <snip>, "expiry": <snip>}
drive_id = <snip>
drive_type = business

A log from the command with the -vv flag

~ $ rclone -vv lsl <remote>:<path to folder>
2020/10/05 02:45:38 DEBUG : rclone: Version "v1.53.1" starting with parameters ["rclone" "-vv" "lsl" "<remote>:<path to folder>"]
2020/10/05 02:45:38 DEBUG : Using config file from "/home/angelsl/.config/rclone/rclone.conf"
2020/10/05 02:45:38 DEBUG : Creating backend with remote "<remote>:<path to folder>"
2020/10/05 02:45:38 ERROR : : error listing: directory not found
2020/10/05 02:45:38 DEBUG : 5 go routines active
2020/10/05 02:45:38 Failed to lsl with 2 errors: last error was: directory not found

The <> are not meant to actually be used as they are standard documentation for showing it's a parameter.

You'd want to just nuke that remote and make it a normal name like onedrive and use

rclone ls onedrive:

The remote name is "onedrive:" and <path to folder" means you actually type in the directory you want to list and not the actual words.

Oh I didn't literally use <remote>, of course, it's a placeholder for the actual remote name and path..

(that command wouldn't even work as-is since the angle brackets would get parsed as redirection operators)

You'd need to share the actual commands and actual output (literally) so we can help.

I think I gave enough information, honestly, but it's OK.

I'll dig through the source and see if there is a workaround to avoid rclone trying to traverse the parent directories of the shared folder I'm trying to access.

Perspective I guess as I don't think it's enough which is why I asked. No need to argue though. Good luck!

If you give rclone a path, it needs to traverse the path to find the ID of the directory to list.

It sounds like you want to set up a onedrive remote using the search option in the rclone config wizard. I haven't tried this, but that is how you add random stuff from MS graph

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.