Page 1 of 1

Sharing Violation?

Posted: Fri 20 May 2016 8:44 am
by Wychall
I have CumulusMX running on a Pi, which also acts as a webserver using Apache. I noticed this morning that the website was not updating although up to date info was uploading to WU and PocketPWS also had correct info. The MXDiags entry for the failure is as below. Can anyone decipher what is likely to be my sharing violation please? It's all double dutch to me!

2016-05-20 00:00:03.241 System.IO.IOException: Sharing violation on path /home/pi/CumulusMX/web/tempdata.json
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
at . () [0x00000] in <filename unknown>:0
at CumulusMX.Cumulus.DoHTMLFiles () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
2016-05-20 00:05:01.079 WU Response: OK: success

Re: Sharing Violation?

Posted: Fri 20 May 2016 10:14 am
by steve
The exception that gets thrown doesn't contain enough information to determine what else was accessing the tempdata.json file at the same time that MX was trying to write to it. It could be another thread in MX - you may have something configured for that file which interferes with MX trying to write to it (e.g. you are trying to ftp or copy it at the realtime interval, which will clash with the creation of the file) - or it could be something external to MX.

Some information about your setup and configuration would help in trying to suggest a possible cause.

Re: Sharing Violation?

Posted: Fri 20 May 2016 11:04 am
by Wychall
Thanks Steve, that has clarified things sufficiently to get me thinking. I have a Raspberry Pi B which hosts both CumulusMX and Apache. MX is ftp'ing data to a Godaddy host site which I intend to switch off shortly. It also copies files using the extra web file page to the Apache directory. I have all files set to copy in real time.

From your reply above, I guess my problem is with the real time copying. Is there a list as to which files need real time and which don't? And would disconnecting the Godaddy ftp action help?

Sorry if I appear thick, I prefer playing with rusty nuts and bolts :oops:

Re: Sharing Violation?

Posted: Fri 20 May 2016 11:23 am
by steve
None of them need realtime, except that is normal to have the realtimegauges.txt file updated at the realtime interval.

Basically, you can't do anything at the realtime interval with any files which Cumulus is configured to update at the non-realtime interval, e.g. the json graph data files or the standard web pages. It's pointless doing anything with any of these files at the realtime interval anyway, as they don't get updated that frequently.