Autodesk-Forge / forge-viewhubs-desktop

Autodesk design file explorer for desktop: Demonstrates a desktop application that shows BIM 360 Team, BIM 360 Docs and Fusion Team hubs, which respective Projects, Folders, Items and Versions
MIT License
38 stars 30 forks source link

Error #5

Closed talebi closed 5 years ago

talebi commented 5 years ago

Hi, I have followed the readme to get this working but I get an error: An exception of type 'System.Exception' occurred in mscorlib.dll but was not handled in user code Additional information: Cannot call /api/forge/session/isvalid

Looking at response I can see below details: "{\"Message\":\"An error has occurred.\",\"ExceptionMessage\":\"Index was outside the bounds of the array.\",\"ExceptionType\":\"System.IndexOutOfRangeException\",\"StackTrace\":\" at MongoDB.Bson.ObjectId.FromByteArray(Byte[] bytes, Int32 offset, Int32& a, Int32& b, Int32& c)\\r\\n at MongoDB.Bson.ObjectId..ctor(String value)\\r\\n at FPD.Sample.Cloud.OAuthDB.<IsSessionIdValid>d__7.MoveNext() in C:\\\\dev\\\\data.management-csharp-desktop.sample\\\\data.management-csharp-desktop.sample\\\\cloud\\\\App_Code\\\\Database.cs:line 63\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at FPD.Sample.Cloud.Controllers.OAuthController.d1.MoveNext() in C:\\dev\\data.management-csharp-desktop.sample\\data.management-csharp-desktop.sample\\cloud\\Controllers\\OAuthController.cs:line 51\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d11.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()\"}"

talebi commented 5 years ago

Upon further investigation I can see the same issue as reported before by AgustinoJ: https://github.com/Autodesk-Forge/data.management-csharp-desktop.sample/issues/1#issuecomment-411522010

sessionId is valid but then unencrypting it results as empty string. I dont see any entry in my mongodb so not sure what is going on

talebi commented 5 years ago

seems like the issue is due to error communicating with mLabs Mongodb as I can see there's an exception in line 49 of Database.cs file.

(I'm closing this but wish this sample was a bit easier to get started and running; without having to go through mLabs and mongodb setup)