Barbarur / NovaPoint

Open source application to help managing SharePoint Online
MIT License
29 stars 4 forks source link

error processing file - Version deletion #13

Closed TheRealStriff closed 5 months ago

TheRealStriff commented 6 months ago

Firstly, thanks for this. Found a bug most likely. When it errors, it quits out.

Erroring only on xlsm files. although it has also successfully removed versions on other xlsm files.

Here is part of the log (Edited any company specific info) The file it's erroring on has 2027 file versions

Update: Tried another location (same site) Errored on another xlsm file, that had 1453 versions, similar issue as below

2024/05/21 00:48:08 - [AppInfo] - Access Token expiration time: 21/05/2024 12:53:33 AM +00:00 2024/05/21 00:48:13 - [NPLogger] - Error processing Item '/sites/XXXXX/SharedDocs/Set Up New Item in J/BSF & TCRC/NEW GROUP DRAFT IMRF Template V2-04 PER.xlsm' 2024/05/21 00:48:13 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/05/21 00:48:13 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.AddRecord(String siteUrl, List oList, ListItem oItem, String versionsDeletedCount, String versionsDeletedMB, String remarks) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RemoveFileVersions(String siteUrl, List oList, ListItem oItem) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.ProcessItems(String siteUrl, List oList, ProgressTracker parentProgress) 2024/05/21 00:48:13 - [NPLogger] - Error processing DocumentLibrary '/sites/XXXXX/SharedDocs/Forms/AllItems.aspx' 2024/05/21 00:48:13 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/05/21 00:48:13 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.AddRecord(String siteUrl, List oList, ListItem oItem, String versionsDeletedCount, String versionsDeletedMB, String remarks) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.ProcessItems(String siteUrl, List oList, ProgressTracker parentProgress) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.ProcessItems(String siteUrl, List oList, ProgressTracker parentProgress) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RunScriptAsync() 2024/05/21 00:48:13 - [SPOSiteCollectionAdminCSOM] - Processing 'https://o365company.sharepoint.com/sites/XXXXX' setting 'XXXXXg@o365company.onmicrosoft.com' IsSiteAdmin 'False' 2024/05/21 00:48:13 - [AppInfo] - Getting Access Token for root site https://o36company-admin.sharepoint.com 2024/05/21 00:48:13 - [AppInfo] - Adding cached token 2024/05/21 00:48:13 - [AppInfo] - Finish aquiring new Access Token with Refresh Token. 2024/05/21 00:48:13 - [AppInfo] - Access Token expiration time: 21/05/2024 12:54:06 AM +00:00 2024/05/21 00:48:14 - [NPLogger] - COMPLETED: Solution has finished correctly!

Barbarur commented 5 months ago

Issue fixed on new version 0.7.0