KoenZomers/KeePassOneDriveSync

Trouble getting plugin to work with "OneDrive for Business"

AaronKelley opened this issue · 3 comments

I've been using this plugin with my database stored on my "OneDrive for Business" account for some time without any problems. I noticed today that my database is not syncing between my PC and my OneDrive account. It broke on December 12 (almost two weeks ago) — that is the last reported sync according to the OneDriveSync Options page.

Symptoms...
If I try to initiate a sync, it just says that the remote path is not valid.

I tried resetting the configuration and realized that it must be trying to use my OneDrive personal account and not my business account. When am at "Choose cloud platform" and I choose one of the options on the first tab ("Any browser" or "Built-in browser"), it proceeds to open KeePass and ask me where I want to save my database on the OneDrive side. It is presenting the folders that correspond to my personal account (I want to use my business account). It did not ask me for credentials, it seems to have automatically logged in somehow and I can't find any way to switch accounts.

Going back to "Choose cloud platform", if I pick the "Other" tab and then select "OneDrive for Business", it does ask me for credentials, but throws this exception after I sign in with my business account.

Ideas?

`See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at KoenZomers.OneDrive.Api.OneDriveForBusinessO365Api.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at KoenZomers.OneDrive.Api.OneDriveForBusinessO365Api.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at KoenZomers.OneDrive.Api.OneDriveApi.d__49.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at KoenZomersKeePassOneDriveSync.OneDriveAuthenticateForm.<WebBrowser_Navigated>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4075.0 built by: NET48REL1LAST
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

KeePass
Assembly Version: 2.43.0.18739
Win32 Version: 2.43.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/KeePass%20Password%20Safe%202/KeePass.exe

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4075.0 built by: NET48REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

HotKeyEnabler
Assembly Version: 2.2.0.27977
Win32 Version: 2.2.0.0
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/Xoe7yjQO1744PqP5ITwg/HotKeyEnabler.dll

KeeAutoExec
Assembly Version: 1.8.0.27977
Win32 Version: 1.8.0.0
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/ovcBuDiWI9c7o4qje5yj/KeeAutoExec.dll

KoenZomersKeePassOneDriveSync
Assembly Version: 2.1.0.0
Win32 Version: 2.1.0.0
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/H1GbOR84qygrAJRqdmfe/KoenZomersKeePassOneDriveSync.dll

Newtonsoft.Json
Assembly Version: 8.0.0.0
Win32 Version: 8.0.1.19229
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/H1GbOR84qygrAJRqdmfe/Newtonsoft.Json.DLL

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3825.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll

System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll

System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

KeeOtp
Assembly Version: 1.3.9.0
Win32 Version: 1.3.9
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/91M1JFO42xmakFgF3Zjb/KeeOtp.dll

KeePassHttp
Assembly Version: 2.34.0.0
Win32 Version: 1.8.4.2
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/M1JTxdT8OvhPaA4kz9RN/KeePassHttp.dll

WinKee
Assembly Version: 2.39.0.27980
Win32 Version: 2.39.1.0
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/iW9tje1Jy9UfsjhnMdPj/WinKee.dll

System.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll

KeePass.XmlSerializers
Assembly Version: 2.43.0.18739
Win32 Version: 2.43.0.18739
CodeBase: file:///C:/Program%20Files%20(x86)/KeePass%20Password%20Safe%202/KeePass.XmlSerializers.DLL

OtpSharp
Assembly Version: 1.0.5.0
Win32 Version: 1.0.5.0
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/91M1JFO42xmakFgF3Zjb/OtpSharp.DLL

KoenZomers.OneDrive.Api
Assembly Version: 2.3.0.3
Win32 Version: 2.3.0.3
CodeBase: file:///C:/Users/aaron/AppData/Local/KeePass/PluginCache/H1GbOR84qygrAJRqdmfe/KoenZomers.OneDrive.Api.DLL

Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll

System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4075.0 built by: NET48REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll

System.Net.Http
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.`

The OneDrive for Business API has been retired last month, so that explains the last error you're mentioning.

You should go for the Graph API and then "Any browser". Use an in private browser session to ensure you are logging on to your OneDrive for Business account. That way it must work and really should not be able to mix up with other accounts you may be using on your system.

Thank you for your quick reply; using "any browser" did the trick. (I really though that I tried that yesterday, but I must have actually tried the "built-in browser" option twice.) I have no idea how things got out of whack, it was working fine and then it wasn't — I didn't try to set up a new file or reconnect it or anything within the past few weeks. I only noticed when I tried to access a new set of credentials from a different device and they were missing from the file.

I'll close the issue but I do suggest that you remove the broken OneDrive for Business option on the "other" tab in the next release.

I have removed the option in version 2.1.1.0