mattrglobal / osma

An open source mobile agent for achieving SSI
Apache License 2.0
40 stars 28 forks source link

Connection status is stuck on "Negotiating" #41

Closed naman20sharma closed 4 years ago

naman20sharma commented 4 years ago

Describe the bug Connection status is stuck on "Negotiating" after scanning the QR code of web-agent created using aries-framework-dotnet demo (using docker-compose up command)

To Reproduce Steps to reproduce the behavior:

  1. Clone the repository mattrglobal/Osma and hyperledger/aries-framework-dotnet.
  2. run docker-compose up command in aries-framework-dotnet project using bash. visit the uri- http://localhost:7000 or http://localhost:8000, Go to connections tab and click 'Create invitation'. A QR code will be generated and displayed.
  3. Build and deploy 'Osma' Android Application to an android device. Open the application and tap on 'Create Wallet'. After the wallet is created, tap on 'connect' button on top right corner of the screen, which will start the QR code scanner.
  4. Scan the QR code from any of the above mentioned uri (step 2). After scanning Agent's name ("Naughty Meitner" in my case) will be displayed on your phone screen with the options to connect. Tap on 'connect'. A loader is displayed on the screen and takes some time.
  5. After the loader is done with the process under the 'Connections' Tab in Osma application Name of the new connected agent is displayed, but the Connection status (under the Name) is still in 'Negotiating' state and it remains like this.

Screenshot_20200312-121810

Expected behavior The connection status should have changed to 'Connected', the mobile (edge-agent) could issue and verify credentials.

Host Details (please complete the following information):

Additional context While debugging the following exception is Thrown in 'AcceptInviteViewModel' class, post QR code scanning:

ClassName: AcceptInviteViewModel Method: CreateConnection(context, connectionInviteMessage)

System.Threading.Tasks.TaskCanceledException

{System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.Net.Sockets.SocketException: Connection timed out
  at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x000c8] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:65 
   --- End of inner exception stack trace ---
  at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x00180] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:84 
  at System.Threading.Tasks.ValueTask`1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 
  at System.Net.Http.HttpConnectionPool.CreateConnectionAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ea] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:371 
  at System.Threading.Tasks.ValueTask`1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 
  at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync (System.Threading.Tasks.ValueTask`1[TResult] creationTask) [0x000a2] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:529 
  at System.Threading.Tasks.ValueTask`1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 
  at System.Net.Http.HttpConnectionPool.SendWithRetryAsync (System.Net.Http.HttpRequestMessage request, System.Boolean doRequestAuth, System.Threading.CancellationToken cancellationToken) [0x0003f] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:284 
  at System.Net.Http.RedirectHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00070] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:32 
  at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000a0] in <a1e13f54f7de43399f5ed249a523faff>:0 
  at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000be] in <a1e13f54f7de43399f5ed249a523faff>:0 
  at System.Net.Http.HttpClient.FinishSendAsyncBuffered (System.Threading.Tasks.Task`1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x0017e] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:506 
  at Hyperledger.Aries.Agents.HttpMessageDispatcher.DispatchAsync (System.Uri endpointUri, Hyperledger.Aries.Agents.PackedMessageContext message) [0x0008c] in D:\a\1\s\src\Hyperledger.Aries\Agents\Transport\HttpMessageDispatcher.cs:41 
  at Hyperledger.Aries.Agents.DefaultMessageService.SendReceiveAsync (Hyperledger.Indy.WalletApi.Wallet 
…
tmarkovski commented 4 years ago

By the looks of the exception System.Net.Sockets.SocketException it seems that the mobile can't access the IP/port of the WebAgent. Are they on the same WiFi? Are you using an Ngrok address? If this is iOS, are you using https instead http?

naman20sharma commented 4 years ago

Hi, @tmarkovski thanks for your inputs. The issue is now resolved, problem persisted in the Ngrok public address (which was not being created) and I am using an Android device.