Getting randomly -> Error I/O 32

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Massimo
Newbie
Posts: 15
Joined: Sat Dec 28, 2019 5:16 pm

Getting randomly -> Error I/O 32

Post by Massimo » Mon Nov 06, 2023 5:30 pm

Hello,
I'm getting I/O Error 32 during the execution of my Macro.
I began to get this error under Windows 11 Op Sys.
With the same macro on Windows 10 I do not have this error.
The only I/O that I do is to keep track of what I'm doing in Log files.
I user the standard library SUB: DateStamp.

I have settled the Error handling, but this does not capture the error.
The Macro, that is quite big, is randomly stopped with a Message Box without any details where the error did occur. This makes me a problem to identify any possible issue.

Does anyone have any recommendation how to handle this problem?

Thank you
Massimo

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Getting randomly -> Error I/O 32

Post by Dorian (MJT support) » Mon Nov 06, 2023 6:19 pm

That's a sharing violation. It could be in use or locked by another application. We've seen Onedrive/Dropbox cause this occasionally.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Massimo
Newbie
Posts: 15
Joined: Sat Dec 28, 2019 5:16 pm

Re: Getting randomly -> Error I/O 32

Post by Massimo » Tue Nov 07, 2023 8:12 am

Thanks Dorian.
However my problem is that I cannot see where the program stops due to this error.

Can you recommend any action to capture Error I/O 32?
The feature: Let>ONERROR=GoErrHandler does not work and the program stops with a Message Box giving no details where the script stops.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Getting randomly -> Error I/O 32

Post by Dorian (MJT support) » Tue Nov 07, 2023 8:20 am

Ah I see. You could always turn on logging in the Logging tab, using a non-Onedrive location just in case.

standard library SUB: DateStamp
I assume you mean you're using DateStamp in a Subroutine. Am I assuming correctly?
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Massimo
Newbie
Posts: 15
Joined: Sat Dec 28, 2019 5:16 pm

Re: Getting randomly -> Error I/O 32

Post by Massimo » Tue Nov 07, 2023 9:55 am

Yes you are assuming correctly.

I have created a SUB to make Logging; in this SUB I use only the standard feature DateStamp that is perfect for my need. In fact I do not write to a OneDrive Location. I map DateStamp to write to a File Server.
I do not have any parallel processing. My main macro calls the developed routine sequentially.

My problem is that I get randomly the error I/O 32 in a Message Box and Macro Scheduler does not capture it in Error Handler.
This stops execution and in addition I do not have any information about the line in code were the problem occurred.

Any method to capture Error I/On 32 within Macro Scheduler?

Hereunder a chunk of code to show how I use this:
===========================================
GoSub>FileLogger,LogStri,LOG_GLOB_FILE,ERROR_LOG_FILE

SRT>FileLogger
DateStamp>TRACE_PGM_FLOW,%bgLpsInfo%: %gblFileName% - Entered in FileLogger
Let>LOCALVARS=1
Let>LogInfo=FILELOGGER_VAR_1
Let>LogFileGlob=FILELOGGER_VAR_2
Let>LogFile1=FILELOGGER_VAR_3
Let>LogFile2=FILELOGGER_VAR_4

DateStamp>LogFileGlob,LogInfo
DateStamp>LogFile1,LogInfo
Assigned>LogFile2,LogFile2IsAssigned
If>LogFile2IsAssigned=TRUE
DateStamp>LogFile2,LogInfo
Endif
DateStamp>TRACE_PGM_FLOW,%bgLpsInfo%: %gblFileName% - Exited FileLogger
END>FileLogger

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1354
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Getting randomly -> Error I/O 32

Post by Dorian (MJT support) » Tue Nov 07, 2023 10:41 am

It's my understanding that Macro Scheduler can catch/report Macro Scheduler errors, but not Windows errors.

Turning on logging in the Logging tab will at least tell you where the script stopped, so that's likely to be your starting point.

Once you know that you can include variables in your log file with Let>_DUMP_VARS=1.

This dumps all variables for each line executed and will also slow any script down, so it may be a good idea to enable it just where you're trying to debug. E.G enable it just before wherever your script stopped, and disable is just after.

And of course once the issue is resolved, turn _DUMP_VARS off completely.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Massimo
Newbie
Posts: 15
Joined: Sat Dec 28, 2019 5:16 pm

Re: Getting randomly -> Error I/O 32

Post by Massimo » Tue Nov 07, 2023 4:09 pm

Ok, I will apply the recommendations.
I need to make experience with it :D

Thank you for your support
massimo

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts