Problem
An error occurred while stubbing a Microsoft SharePoint Online item.
Error Message
Error URL stubbing item with server relative URL '<server-relative-url>'
Cause
During the stubbing process, errors can occur for the following reasons:
1. Network error during SharePoint Online API call.
2. SharePoint Online API throttling.
3. SharePoint Online API failure.
4. Incompatible SharePoint Online settings for item stubbing.
5. Policies applied on SharePoint File, List, Site are incompatible with item stubbing.
Solution
Errors can occur at any stage of the stubbing process. The stubbing process tries to recover from errors and keep the original file intact as much as possible. However, if the file remains in an inconsistent state, the user needs to act based on the type of error to revert the file to its original state.
Sr. |
File state |
Action Needed |
1. |
Error renaming file. The original file remained intact. |
No action required. |
2. |
|
Rename the file back to the original file name using a PnP PowerShell command: Sample command: Move-PnPFile "Shared Documents/Document1.docx.stub.url" -TargetUrl " Shared Documents/Document1.docx" |
3. |
|
If the file is not renamed in SharePoint, no action is required. Otherwise, depending on additional error messages, take appropriate action as indicated by the error message. |
4. |
|
No action is required. File renaming failed because a stub file with the same stub name exists for another file. |
5. |
|
No action is required. |
6. |
|
If versioning is enabled in the document library,
|
7. |
|
If versioning is enabled in the document library,
If versioning is not enabled in the document library,
|
8. |
|
If versioning is enabled in the document library:
|
9. |
|
No action required. |
10. |
Error overwriting file with stub. The stub property update failed. The file is renamed back; however, it remains in an inconsistent state because it could not revert its stub content. |
If versioning is enabled in the document library:
|
11. |
|
If versioning is enabled in the document library,
|
12. |
|
If versioning is enabled in the document library,
If versioning is not enabled in the document library:
|
13. |
|
The file is stubbed. Contact Veritas Technical Support to delete the older version of the file to save space on SPO site.
|
14 | ASP skips backing up the item/item versions with stubbed content and logs the following informational message: Though these affected items/item versions are eligible for stubbing, stubbing will not occur until the affected versions (stub content versions) are removed. |
|
Stubbing failure due to invalid retention policy or grace eDiscovery hold:
If the site has an invalid retention policy, or a grace eDiscovery hold, removing an older version(s) of an item will fail with an error message as below.
“A non retryable error occurred.
”
ServerErrorCode: -2130575223, ServerErrorTypeName: Microsoft.SharePoint.SPException.
Versions of this item cannot be deleted because it is on hold or retention policy.
Microsoft reference link: An invalid policy blocks a SharePoint site deletion - SharePoint | Microsoft Learn
PnP PowerShell command to rename the stub back to its original name:
Connect-PnPOnline -Url <SiteUrl>
Move-PnPFile <list-name/file-name.ext.stub.url> -TargetUrl <list-name/file-name.ext>
Example:
Connect-PnPOnline -Url https://mytenant.sharepoint.com/sites/mysite
Move-PnPFile "Shared Documents/Document1.docx.stub.url" -TargetUrl "Shared Documents/ Document1.docx"