Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error cleaning target folder when is the root folder #11

Open
mrampazo opened this issue Jul 11, 2023 · 1 comment
Open

Error cleaning target folder when is the root folder #11

mrampazo opened this issue Jul 11, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mrampazo
Copy link

I'm getting this error when target folder is the SPO Library root and set cleanTargetFolder to true:

Cleaning target folder '/'. { Error: Resource not found for the segment 'root:'. at new GraphError (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphError.js:34:28) ##[debug]task result: Failed at Function.GraphErrorHandler.constructErrorFromResponse (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:62:22) at Function.<anonymous> (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:89:48) at step (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/tslib/tslib.js:144:27) ##[error]Resource not found for the segment 'root:'. ##[debug]Processed: ##vso[task.issue type=error;]Resource not found for the segment 'root:'. at Object.next (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/tslib/tslib.js:125:57) at /home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/tslib/tslib.js:118:75 at new Promise (<anonymous>) at Object.__awaiter (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/tslib/tslib.js:114:16) at Function.GraphErrorHandler.getError (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:85:24) at GraphRequest.<anonymous> (/home/vsts/work/_tasks/az-pipelines-2-sharepoint_1ed28650-ea93-45a3-8f29-d0400ad51ce9/0.3.4/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:315:84) statusCode: 400, code: 'BadRequest', requestId: 'caffd295-fb0c-47d0-bc75-e917b5ddf8a4', date: 2023-07-10T23:04:17.000Z, body: '{"code":"BadRequest","message":"Resource not found for the segment \'root:\'.","innerError":{"date":"2023-07-10T23:04:17","request-id":"caffd295-fb0c-47d0-bc75-e917b5ddf8a4","client-request-id":"56294ca7-e792-bb61-5824-666825b9ed1e"}}' } ##[debug]Processed: ##vso[task.complete result=Failed;]Resource not found for the segment 'root:'.

I was able to reproduce the error in Graph Explorer when the path-based address is malformed /root:/:/children
and to work i have to change to /root://:/children

Maybe this function constructFileUrl needs a condition when receiving the root of a library or drive ("/") as target folder.

@halliba
Copy link
Owner

halliba commented Jul 11, 2023

Hi,

thank you, I will check that and fix it if possible.

@halliba halliba self-assigned this Jul 11, 2023
@halliba halliba added the bug Something isn't working label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants