Closed TheRealStriff closed 4 months ago
Hi @TheRealStriff ,
Do you get any error while running the solution? Did you check the logs from the txt file?
The access token las 60-90 min and it manage squiring a new token by itself. Not sure if you have any configuration on your environment for the the access token to last 90min.
Number of items is base on the information from the library, which includes folders (if I remember well). But deletions of versions only apply to files and folders are ignored.
You can try running the solution for a subfolder to check if versions are deleted. Based on your description, I'm not sure if the solution is not able to catch the files, not able to delete the versions or a different issue.
There were a lot of errors, for individual files, below are some examples
I also tired on smaller libraries and works great. It seems to just not down some folder structures. Will configure it to target this and report back.
_2024/06/07 03:33:14 - [AppInfo] - Got access token from memory 2024/06/07 03:33:14 - [AppInfo] - Access Token expiration time: 7/06/2024 4:30:39 AM +00:00 2024/06/07 03:33:14 - [NPLogger] - Error processing Item '/sites/Lake/Shared Documents/Technical/Drill and Blast/Archive/Design/02_North Pit/NO21_VM/NO21_VM_B01-02Upthrust/Media/GP014797.MP4' 2024/06/07 03:33:14 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/06/07 03:33:14 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAutoRecord.AddFileDetails(ListItem oItem, String versionsDeletedCount, String versionsDeletedMB)
2024/06/07 03:47:16 - [NPLogger] - Error processing Item '/sites/Lake/Shared Documents/Safety/Work Controls/Audits, Review and Inspections/2023/LV Water Trucks Quantitative Watering Application Review/Quantitative data.xlsx' 2024/06/07 03:47:16 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/06/07 03:47:16 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAutoRecord.AddFileDetails(ListItem oItem, String versionsDeletedCount, String versionsDeletedMB) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RemoveFileVersions(SPOTenantItemRecord resultItem) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RunScriptAsync()
2024/06/09 21:32:25 - [NPLogger] - Error processing Item '/sites/Lake/Shared Documents/Technical/Mine Planning/Design/01. WEEKLY PLAN/Archive/2021/2021_Archive/Week 12/Lake Vermont Weekly Mine Plan 210317.pptx' 2024/06/09 21:32:25 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/06/09 21:32:25 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAutoRecord.AddFileDetails(ListItem oItem, String versionsDeletedCount, String versionsDeletedMB) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RemoveFileVersions(SPOTenantItemRecord resultItem) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RunScriptAsync()
2024/06/09 21:32:56 - [NPLogger] - Error processing Item '/sites/Lake/Shared Documents/People/Training/Administration/Training Specialists Folder/AB Crew/Carly D&I/Carly D&I Wall Posters.pptx' 2024/06/09 21:32:56 - [NPLogger] - Exception: Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.Client.FieldLookupValue'. 2024/06/09 21:32:56 - [NPLogger] - Trace: at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAutoRecord.AddFileDetails(ListItem oItem, String versionsDeletedCount, String versionsDeletedMB) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RemoveFileVersions(SPOTenantItemRecord resultItem) at NovaPointLibrary.Solutions.Automation.RemoveFileVersionAuto.RunScriptAsync()
Hi @TheRealStriff ,
The error seems the same as the one you reported previously. The issue doesn't occurs while deleting the version, but when adding the information to the CSV file. This is due some properties from the old files not comming through correctly from the server. Still you should be able to see file /sites/Lake/Shared Documents/Technical/Drill and Blast/Archive/Design/02_North Pit/NO21_VM/NO21_VM_B01-02_Upthrust/Media/GP014797.MP4 and the other you posted in the CSV report with the notification of the error. Do you?
For the file versions that are not deleted, do you see those in the .txt logs?
Ignore anything I said about the versions not being deleted. I had unknowingly click Report only!
Implemented new Report Mode form for more clarity from release 0.7.2
Thanks for this tool, ran it on an old site with two libraries. set to delete all but 90 versions The library I targeted as reported by NovaPoint 756576 items. (9 years old)
Runing the tool, it would prompt for re-authentication, as our access tokens last for 7 hours. At times it would ask for re-authentication more than this, but it seem to carry on.
I'm not sure during this time (Authentication expires, and waiting for me to sign back in), it resumes where it stopped.
Only because when it finished, it collected just over 520000 items, short of the 756576 reported. And from the logs no versions deleted.
I check a random file, and had over 190 versions. Checked the log and the whole directory is not listed as being scanned.
Tried another file and same, over 90 versions, but checking the log, not scanned.
(Going to run a script I have, and modified, can target file types, but seems to get throttled when it starts deleting the versions, plus gets when access token expires it dies., but good test to see if it picks up the missing files (targeting excel files)