Page 1 of 2

4063 issue.. wipes out Cumulus.ini

Posted: Wed 04 Dec 2024 7:07 pm
by saratogaWX
I installed the 4063 file as usual by overwrite of the c:\CumulusMX directory with the .zip content.

On running it, the following appeared in the CMD window:
Cumulus MX v.4.3.0 build 4063
Working Dir: C:\CumulusMX\
System.IO.IOException: The supplied user buffer is not valid for the requested operation. : 'C:\CumulusMX\Cumulus.ini'
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path)
at CumulusMX.IniFile.Flush()
at CumulusMX.Cumulus.WriteIniFile()
at CumulusMX.Cumulus.ReadIniFile()
at CumulusMX.Cumulus.Initialise(Int32 HTTPport, Boolean DebugEnabled, String startParms)
at CumulusMX.Program.RunAsAConsole(Int32 port, Boolean debug)
at CumulusMX.Program.Main(String[] args)
at CumulusMX.Program.<Main>(String[] args)
**** An error has occurred - please zip up the MXdiags folder and post it in the forum ****
Press Enter to terminate
and the Cumulus.ini file was set to 'null' (zero bytes).
Restored the Cumulus.ini file from backup, and tried again.. same display.

I've temporarily reverted to my prior version of CUMX 4.2.1 [b4043] - 2024-10-19

Help???

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Wed 04 Dec 2024 7:34 pm
by mcrossley
Oh dear, could you send me your Cumulus.ini file from 4.2.1?
All the sensitive stuff should be encrypted, and I will not be able to read those entries, but hopefully it will read enough to reproduce the error. I hope it is not Linux specific!

It sounds like the write operation is running out of buffer space, that will in the INI file code that Steve got from a third party, I'll delve into that to start with...

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Wed 04 Dec 2024 9:29 pm
by saratogaWX
Sure, thanks for looking Mark

[attachment deleted after download]

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Wed 04 Dec 2024 10:53 pm
by mcrossley
And of course it works perfectly in my test environment with your file! :bash:

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Wed 04 Dec 2024 11:24 pm
by mcrossley
I've run out of time this evening; I'll pick this up again tomorrow.

Q: What state was the Cumulus.ini file in after the error? Did it exist? If so, was it zero length, or contain all the content?

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 2:06 am
by saratogaWX
After the error, the Cumulus.ini file had zero bytes. Before the error, it was as I'd posted above.

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 10:42 am
by mcrossley
Thanks, v4.3.0 moves some settings to a different section. To do this is reads the ini file, resets the ini file on disk to zero length, then writes it again. The write is the standard write it uses all the time. That is what has failed in your case. The code that does all that has been around for a while which is why this is puzzling.

Some searching shows that the error originates in the OS filesystem with a Windows error 1784. Unfortunately, I cannot find anything helpful in pinning down the cause or fixes. As the write that failed is the same function that MX uses all the time for saving the Cumulus.ini file, maybe it was something transitory on your system.

Perhaps you could have a look in the System event log for that time and see if there is a 1784 error in there, and if that or any surrounding errors give clue?

Have you tried the upgrade multiple times, or just the once?

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 2:53 pm
by saratogaWX
Hi Mark,
Yes, I'd tried the update multiple times, restoring the prior Cumulus.ini before starting the .exe file.
It failed with the same errors each time. (tried 3 times.. insanity, I guess).

I restored the prior version (and the Cumulus.ini) and it started and ran normally (still running).

I'll dive into the event viewer and see what I can find around the times I tried yesterday...

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 3:42 pm
by saratogaWX
Arrrgh.. file this in the Journal of Irreproducable Results. Tried this morning.
1) shutdown Old CumulusMX
2) made copy of Cumulus.ini for safety
3) extracted 4063 over existing CumulusMX directory.
4) had event viewer open to diagnose
5) crossed fingers and started 4063

result:
Cumulus MX v.4.3.0 build 4063
Working Dir: C:\CumulusMX\

Cumulus running at: http://localhost:8998/
http://192.168.1.104:8998/
http://192.168.111.1:8998/
http://192.168.226.1:8998/

Open the admin interface by entering one of the above URLs into a web browser.

Opening station type 0 - Davis Vantage Pro
Last update: 2024-12-05T07:30:00
Connected to station
12/5/2024 7:35:01 AM
Type Ctrl-C to terminate

Downloading Archive Data
- processed 100%
Downloading Archive Data
- processed 100%
Connecting real time FTP
Normal running
6) problem? Problem? I don't got to show you no stinkin' problem...

7) Sigh, thanks for the assistance and sorry to have troubled you, Mark.

:oops:

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 7:43 pm
by mcrossley
Ok, but I don't like not knowing what was going wrong :bash:

Is the disk formatted NTFS?

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 8:24 pm
by saratogaWX
Yes, NTFS on C:\ 2TB SSD with 833GB free.

Edition Windows 11 Home
Version 23H2
Installed on ‎6/‎29/‎2024
OS build 22631.4460
Experience Windows Feature Experience Pack 1000.22700.1047.0

2024-11 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5046633)
2024-11 Cumulative Update for .NET Framework 3.5 and 4.8.1 for Windows 11, version 23H2 for x64 (KB5045935)
2024-11 .NET 8.0.11 Update for x64 Client (KB5047489)
2024-11 .NET 6.0.36 Update for x64 Client (KB5047486)

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Thu 05 Dec 2024 8:51 pm
by mcrossley
Most of the issues I managed to find around this error are permissions, file locked, corrupt file system, etc etc.

I did wonder if it was a race condition between the file truncation and writing the new content, but they are synchronous operations performed on the same thread.

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Fri 06 Dec 2024 10:00 am
by SamiS
Since .ini is historically special filetype for windows, I wonder if some antivirus product could be involved in this.

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Fri 06 Dec 2024 3:19 pm
by saratogaWX
Possibly... The system is using Microsoft Defender Antivirus and Acronis True Image (backup and basic virus protection).

No events were flagged as I'd had the issues by either antivirus products.
Since it started normally yesterday, I'm at a loss to explain what had happened, but 4063 is working fine now.

Re: 4063 issue.. wipes out Cumulus.ini

Posted: Fri 06 Dec 2024 4:54 pm
by PaulMy
and the Cumulus.ini file was set to 'null' (zero bytes).
That would scare me.
Restored the Cumulus.ini file from backup.
Good thing that CMX saves the Cumulus.ini in the daily backup as well as at a restart.

Enjoy,
Paul