Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

CTD on no write access #45

Closed
Spu00Key opened this issue Dec 13, 2016 · 4 comments
Closed

CTD on no write access #45

Spu00Key opened this issue Dec 13, 2016 · 4 comments
Assignees
Labels
bug Crash or glitch or unexpected behavior that causes a problem within the app.
Milestone

Comments

@Spu00Key
Copy link

When scanning / adding a bridge, it gets to the part to save the information, it will throw an exception on close if it does not have write access.

My Documents is under Ransom Protection. When it threw the exception Bit Defender notified me it blah blah blah. Added WinHue to the trusted apps. No issue next time.

Other than a graceful (write access denied) message, not sure there is anything else to do.

2016-12-13 08:03:06,147 [1] DEBUG WinHue3.BridgeDetectionPairingView [Hue_OnIpScanProgressReport:434] ==> Hue IP scan progress report : 253 2016-12-13 08:03:06,212 [1] DEBUG WinHue3.BridgeDetectionPairingView [set_ProgressBarValue:128] ==> ProgressBarValue : 254 2016-12-13 08:03:06,212 [1] DEBUG WinHue3.BridgeDetectionPairingView [Hue_OnIpScanProgressReport:434] ==> Hue IP scan progress report : 254 2016-12-13 08:03:06,278 [1] DEBUG WinHue3.BridgeDetectionPairingView [set_UserMessage:176] ==> UserMessage : Scanning complete. 2016-12-13 08:03:06,279 [1] DEBUG WinHue3.BridgeDetectionPairingView [set_ScanButtonText:209] ==> ScanButtonText : Scan 2016-12-13 08:03:06,280 [1] INFO WinHue3.BridgeDetectionPairingView [Hue_OnIpScanComplete:446] ==> Scan for bridge completed. 2016-12-13 08:03:07,648 [1] DEBUG WinHue3.BridgeDetectionPairingView [set_SelectedBridge:139] ==> SelectedBridge : ipaddress : 192.168.1.17, IsDefault : True, SwVersion : 01035934, Mac : 00:17:88:18:55:c4, ApiVersion : 1.15.0, ApiKey : dY764p-oVqIAlxWBfWXpYMq5H6VT-ftR3zcz8-vk, BridgeUrl : http://192.168.1.17/api/dY764p-oVqIAlxWBfWXpYMq5H6VT-ftR3zcz8-vk 2016-12-13 08:03:07,653 [1] DEBUG WinHue3.BridgeDetectionPairingView [set_CanPair:164] ==> CanPair : False 2016-12-13 08:03:09,628 [1] DEBUG WinHue3.WinHueSettings [Save:32] ==> Saving settings : {"BridgeInfo":{"00:17:88:18:55:c4":{"ip":"192.168.1.17","apikey":"dY764p-oVqIAlxWBfWXpYMq5H6VT-ftR3zcz8-vk","apiversion":"1.15.0","swversion":"01035934","name":"The Hue Hub"}},"DefaultBridge":"00:17:88:18:55:c4","ShowHiddenScenes":false,"Language":"en-US","DetectProxy":false,"EnableDebug":true,"LiveSliders":false,"UpnpTimeout":5000,"DelayLiveSliders":25,"StartWithWindows":false,"StartMode":0,"listHotKeys":[]} 2016-12-13 08:03:09,629 [1] ERROR WinHue3.WinHueSettings [Save:48] ==> Error while saving the settings. System.UnauthorizedAccessException: Access to the path 'C:\Users\Brent\OneDrive\Documents\WinHue\WinHueSettings.set' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at System.IO.File.WriteAllText(String path, String contents) at WinHue3.WinHueSettings.Save() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Utils\WinHueSettings.cs:line 41 2016-12-13 08:03:25,049 [1] ERROR WinHue3.Form_BridgeDetectionPairing [btnDone_Click:46] ==> Error while saving settings. 2016-12-13 08:03:26,346 [1] DEBUG WinHue3.WinHueSettings [Save:32] ==> Saving settings : {"BridgeInfo":{"00:17:88:18:55:c4":{"ip":"192.168.1.17","apikey":"dY764p-oVqIAlxWBfWXpYMq5H6VT-ftR3zcz8-vk","apiversion":"1.15.0","swversion":"01035934","name":"The Hue Hub"}},"DefaultBridge":"00:17:88:18:55:c4","ShowHiddenScenes":false,"Language":"en-US","DetectProxy":false,"EnableDebug":true,"LiveSliders":false,"UpnpTimeout":5000,"DelayLiveSliders":25,"StartWithWindows":false,"StartMode":0,"listHotKeys":[]} 2016-12-13 08:03:26,350 [1] INFO WinHue3.MainFormView [LoadBridge:667] ==> Loading bridge... 2016-12-13 08:03:26,350 [1] DEBUG WinHue3.MainFormView [AssociateBridgeWithApiKey:653] ==> Associating bridge 192.168.1.17 with APIkey dY764p-oVqIAlxWBfWXpYMq5H6VT-ftR3zcz8-vk 2016-12-13 08:03:33,061 [1] FATAL WinHue3.App [CurrentDomain_UnhandledException:74] ==> Unexpected Exception : System.NullReferenceException: Object reference not set to an instance of an object. at WinHue3.MainFormView.MessageAdded(Object sender, EventArgs e) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 728 at HueLib2.Bridge.set_lastMessages(MessageCollection value) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\HueLib2\Bridge\Bridge.cs:line 118 at HueLib2.Bridge.GetBridgeSettings() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\HueLib2\Bridge\Bridge_Settings.cs:line 68 at WinHue3.HueObjectHelper.IsAuthorized(Bridge bridge) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Utils\HueObjectHelper.cs:line 730 at WinHue3.MainFormView.AssociateBridgeWithApiKey(ObservableCollection1 bridge) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 655
at WinHue3.MainFormView.LoadBridge() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 668
at WinHue3.MainFormView.DoBridgePairing() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 878
at WinHue3.MainFormView.Temp_BridgeNotResponding(Object sender, EventArgs e) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 722
at HueLib2.Bridge.GetBridgeDataStore() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\HueLib2\Bridge\Bridge.cs:line 194
at WinHue3.HueObjectHelper.GetBridgeDataStore(Bridge bridge) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Utils\HueObjectHelper.cs:line 639
at WinHue3.MainFormView.RefreshView() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 1051
at WinHue3.MainFormView.set_SelectedBridge(Bridge value) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 537
at WinHue3.MainFormView.LoadBridge() in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 702
at WinHue3.MainFormView..ctor(Form_EventLog fel) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\Views\MainFormView.cs:line 81
at WinHue3.MainWindow.Window_ContentRendered(Object sender, EventArgs e) in D:\Documents\Visual Studio 2012\Projects\WinHue3_1\WinHue3\MainWindow.xaml.cs:line 81
at System.Windows.Window.OnContentRendered(EventArgs e)
at System.Windows.Window.b__198_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at WinHue3.App.Main()`

@Hyrules
Copy link
Owner

Hyrules commented Dec 13, 2016

Noted I will add a message.

@Hyrules Hyrules self-assigned this Dec 13, 2016
@Hyrules Hyrules added the enhancement An enhancement is an improvement to something that already exists in the app. label Dec 13, 2016
@Hyrules Hyrules added this to the beta_24 milestone Dec 13, 2016
@Hyrules
Copy link
Owner

Hyrules commented Dec 14, 2016

This exception is caused by something else. There is already a catch inside the function that saves the file. The messageadded event for some reason is not associated so I cannot trigger the event. I will have to review the whole application startup sequence.

@Hyrules Hyrules added bug Crash or glitch or unexpected behavior that causes a problem within the app. and removed enhancement An enhancement is an improvement to something that already exists in the app. labels Dec 14, 2016
@Hyrules
Copy link
Owner

Hyrules commented Dec 16, 2016

if you want to try the beta in issue #46 I have moved the save file to the %AppData%\roaming folder so you might not have that problem anymore. Otherwise I will add a function to select where to save the file.

@Hyrules Hyrules modified the milestones: beta_25, beta_24 Dec 17, 2016
@Hyrules
Copy link
Owner

Hyrules commented Jan 25, 2017

This should be fixed in the next version. I will release a new version soon.

@Hyrules Hyrules closed this as completed Jan 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Crash or glitch or unexpected behavior that causes a problem within the app.
Projects
None yet
Development

No branches or pull requests

2 participants