Author Topic: Random ("strange") issues when processing OneDrive files  (Read 210 times)

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Random ("strange") issues when processing OneDrive files
« on: September 26, 2022, 04:01:29 pm »
Does anyone have any suggestions why I would be having random issues with OneDrive? Just doing random stuff such as using FileDigest. Error 1800.

Decided to switch to using CertUtil and that has the same random issues. Unable to find file.

ChuckC

  • Sr. Member
  • ****
  • Posts: 405
Re: Random ("strange") issues when processing OneDrive files
« Reply #1 on: September 27, 2022, 06:31:57 am »
Are you able to open the files with something like notepad.exe or the "TYPE" command in a CMD.exe console window?

Microsoft implements support for presenting content from OneDrive as folders & files on a local drive via the use of mini-filter drivers and reparse points.  Depending on how it is configured, there is the possibility that you may be seeing only a "stub" for the file in question and getting an error when trying to open it if OneDrive isn't able to immediately retrieve the body of the file from cloud storage and replicate it locally.

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #2 on: September 27, 2022, 05:48:18 pm »
Sorry. Should have made it more clear. Am iterating through 100,000 files in 2,000 folders and subfolders. All files have been retrieved and stored locally. Just looked at the log and seems like I'm having an error rate of 5%. Just will not open the file. Of course, then I use notepad, excel, word or whatever ... no problem.

Just rapidly hitting the files seems to be causing errors. And running through for a second time will maybe result in a 1% change. But it will usually be the same files.

I find it odd.

Also, using 32bit compiled WB scripts.

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #3 on: September 28, 2022, 04:33:25 am »
Just a follow up because I have no idea what the issue is.

I decided to trap the filedigest command. On error, I can fileget the file without issue. I can also filecopy the file. So why filedigest fails is beyond me. So my workaroud is to filecopy the file and use that value.

Stupid!

td

  • Tech Support
  • *****
  • Posts: 4184
    • WinBatch
Re: Random ("strange") issues when processing OneDrive files
« Reply #4 on: September 28, 2022, 06:34:54 am »
FileDigest and FileGet use exactly the same Windows APIs to open a file and the problem is most likely a Window bug (there are several relating to the NTFS in Windows 10 and newer system.) FileDigest does provide the system error number as additional error information. That information would be useful to know.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #5 on: September 28, 2022, 12:00:55 pm »
Thanks Tony.

The error is:

1800: Error opening file

Clicking on "More Error Info"

CreateFile error: 3

td

  • Tech Support
  • *****
  • Posts: 4184
    • WinBatch
Re: Random ("strange") issues when processing OneDrive files
« Reply #6 on: September 28, 2022, 01:18:01 pm »
I think it is very likely a Windows bug. Error 3 is "The system cannot find the path specified." I have seen cases on Windows 10/11 where error 3 is generated when a file is copied (but not moved) to two different locations. It is as if the file system locks the source file even though the first copy is complete. That is not exactly the problem you are having but it does suggest a broader issue with the Windows file system.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #7 on: September 28, 2022, 04:42:48 pm »
Thanks for the replies. Does not surprise me in the least that this is a Microsoft issue.

ChuckC

  • Sr. Member
  • ****
  • Posts: 405
Re: Random ("strange") issues when processing OneDrive files
« Reply #8 on: October 01, 2022, 06:57:05 am »
Quote
I decided to trap the filedigest command. On error, I can fileget the file without issue. I can also filecopy the file. So why filedigest fails is beyond me. So my workaroud is to filecopy the file and use that value.


Just out of curiosity, have you tried using an altered form of your script where FileGet() is used in place of FileDigest() in the main loop you have for processing the files?

I'm curious as to whether FileGet() fails in the same percentage of the time as FileDigest() when it is the function used for the initial access for each file.

I am still quite suspicious of OneDrive's mini-filter driver not retrieving the files as fast as you're trying to access them, and for any file for which it cannot retrieve the content from the backend cloud storage, it results in system error code 3 being returned.

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #9 on: October 01, 2022, 08:28:28 pm »
Just out of curiosity, have you tried using an altered form of your script where FileGet() is used in place of FileDigest() in the main loop you have for processing the files?

I'm curious as to whether FileGet() fails in the same percentage of the time as FileDigest() when it is the function used for the initial access for each file.

I am still quite suspicious of OneDrive's mini-filter driver not retrieving the files as fast as you're trying to access them, and for any file for which it cannot retrieve the content from the backend cloud storage, it results in system error code 3 being returned.

No. But will run a test for you! It is frustrating having random errors crop up like this. Just seems to be the era of IT we live in.

bottomleypotts

  • Jr. Member
  • **
  • Posts: 71
Re: Random ("strange") issues when processing OneDrive files
« Reply #10 on: October 01, 2022, 10:52:03 pm »
Just iterated through 250,000 files. Had no issues with fileget.

td

  • Tech Support
  • *****
  • Posts: 4184
    • WinBatch
Re: Random ("strange") issues when processing OneDrive files
« Reply #11 on: October 02, 2022, 10:51:28 pm »
As mentioned previously, both functions use exactly the same Win32 APIs to open and read a file. The only difference is that FileDiget does more processing of the contents of the file once they are in memory. It can, therefore, take a bit more time between files depending on the hash algorithm selected.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade