Creating Sharepoint v2 backup generates startIndex cannot be larger than length of string. (Parameter 'startIndex')

Hi all!

I’m on 2.2.0.0, and admittedly, I’m playing with a test to get Sharepoint v2 backup working before deploying to several use-cases.

It was absolutely BUTT-BACKWARDS to work out the Sharepoint stuff (no fault of Duplicati’s, but I would strongly suggest adding more info under the (i) bubbles and in the Doc page on this; happy to contribute if you’d like my input on it) like getting the site ID, but got there in the end and ended up with the below error:

startIndex cannot be larger than length of string. (Parameter ‘startIndex’)

To be honest - no idea what to do here. I don’t currently have a source set up but I figured I could set up and test the site connection successfully without having any sources or backups already configured in Dupli - might be wrong there and happy to take the ruler across my knuckles for putting the ‘ass’ in U and ME on that one. Otherwise…. Help! Thank you in advance!

Great suggestion! I am not a Sharepoint user myself, so I have a hard time suggesting specifics, but if you have any changes, feel free to report them and we can add it.

If you want, you can submit PRs agains the documentation from here:

And for reporting things that should be fixed in the UI:

For the “startIndex” issue, that is not so easy to debug, as it seems to happen after authentication, so it requires an active SharePoint server. It may also depend on certain responses from the particular instance.

Can you see in the Duplicati server logs, if you can get a stack trace of the error? That would help pinpoint the place where it fails. Looking the source, I would guess this is related to getting the Drive info from SharePoint.

Thank you for your reply! I’ll take some time to send through what feedback I can when this process is all done, for sure - happy to contribute!

I can definitely help with logs if you can help me with how! Also happy to help troubleshoot the issue so that Sharepoint backup can work for everyone. Sorry - I’m fairly out of my depth when we go into the back end of things so I’ll need a hand, but I can definitely get us what we need!

Adding to my reply; on trying again today I’m now getting the below:

Forbidden: Forbidden error from request https://graph.microsoft.com/v1.0/sites/0a0a[REMOVED]fedcfed844ae/drive/root:/[SITE]com.s… Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/sites/0a0a8[REMOVED]44ae/drive/root:/[SITE]com.s…, Version: 1.1, Content: , Headers: { User-Agent: Duplicati/2.2.0.1 Authorization: Bearer ABC…XYZ traceparent: 00-c396e8d37e887833d5571bc06015cba8-8d063e44a04d9c86-00 } StatusCode: 403, ReasonPhrase: ‘Forbidden’, Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Cache-Control: no-store, no-cache Transfer-Encoding: chunked Strict-Transport-Security: max-age=31536000 request-id: f46e84fb-2884-4266-9a09-b0579fb31b69 client-request-id: f46e84fb-2884-4266-9a09-b0579fb31b69 x-ms-ags-diagnostic: {“ServerInfo”:{“DataCenter”:“Australia Southeast”,“Slice”:“E”,“Ring”:“3”,“ScaleUnit”:“002”,“RoleInstance”:“ML1PEPF000214DB”}} SPLogId: fad4d8a1-7009-6000-17d7-cce6f643c612 Date: Thu, 13 Nov 2025 02:54:27 GMT Content-Type: application/json; charset=utf-8 } { “error”: { “code”: “accessDenied”, “message”: “Access denied” } }

I have revealed but blocked out a portion of the auth ID to show it’s actually filled it in. Again - honestly not clear to me why it’s changed or what’s wrong now, but hoping we can get there together. Thank you.

At least this part seems pretty clear: Access denied.

Since you get “Unauthorized” earlier, I think this new message means you are authenticated, but do not have permissions to the folder.

Can you try some variations of the path and check the permissions of the target Sharepoint folder?

I can see the code tries to handle the case where the “Path on server” has the https:// prefix, so it should work, but can you try without it?

Okay, i’ve started over - new site, new backup, in the correct enviro now (rather than testing on my device.)

We’re back to the StartIndex issue. Would you be able to help me with the process for logs and stack tracing? I’m no tech fool but unfortunately hopeless when it comes to code and program functionality - sorry! :grin:

FWIW - I’ve tried to find these logs, but I’m out of my depth entirely once we get into .schemas and SQLite and all that. Some noob guidance around this would be much appreciated! :grin:

Hiya all! Any chance I could get a bit of a hand on this one when possible? Thanks Duplicati team and community!