bluebubbles-app icon indicating copy to clipboard operation
bluebubbles-app copied to clipboard

Unable to authenticate with server: Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>'

Open Daniel-Valentine opened this issue 2 years ago • 5 comments

I've deployed a BlueBubbles server on my iMac (assume IP address 192.168.1.20, port 1234) and I'm trying to connect my Debian 11 laptop to it, to ensure basic communication between a client and server before setting up TLS and port forwarding on my router, but I'm unable to get past the stage of configuring my client to use the server because of a problem during the setup process. The Mac is running BlueBubbles v1.3.0, and the Debian 11 machine is running the BlueBubbles client obtained by flatpak just about half an hour before the writing of this post.

$ flatpak info app.bluebubbles.BlueBubbles 

BlueBubbles - BlueBubbles client for Linux

          ID: app.bluebubbles.BlueBubbles
         Ref: app/app.bluebubbles.BlueBubbles/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.9.7.0
     License: Apache-2.0
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 54.8 MB
     Runtime: org.gnome.Platform/x86_64/42
         Sdk: org.gnome.Sdk/x86_64/42

      Commit: aa4c9b506d5f5a342c8879c27a727d2e235e4b3feb14d34763bbf1577d365f1d
      Parent: 28c57b0134a458ea822687f36bd88b7222b2f98c93618b74f33364e88b8e5b88
     Subject: Switch filesystem access to home (0a954b3e)
        Date: 2022-07-13 08:45:28 +0000

At the Server Connection page of the client setup wizard, a button appears for me to input the login credentials. Click that button causes text fields for the URL and the password to appear. When I input them and click "Connect ->", I am taken back to the Server Connection page.

My terminal reveals this block of text each time I press "Connect ->":

flutter: [BlueBubblesApp][2022-09-04 22:32:54.005742][INFO] (REQUEST[GET]) -> PATH: http://192.168.1.20:1234/api/v1/fcm/client
flutter: [BlueBubblesApp][2022-09-04 22:32:54.018999][INFO] (RESPONSE[200]) -> PATH: http://192.168.1.20:1234/api/v1/fcm/client
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>'
#0      _QRScanState.connect.<anonymous closure> (package:bluebubbles/layouts/setup/qr_scan/qr_scan.dart:573)
<asynchronous suspension>

Performing packet sniffing on the connection reveals a successful GET by the client as evidenced by the 200 and the JSON in the body, but my guess is that there is something missing in the JSON that the client is expecting.

GET /api/v1/fcm/client?guid=[snip] HTTP/1.1
user-agent: Dart/2.17 (dart:io)
accept-encoding: gzip
host: 192.168.1.20:1234

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,HEAD,PUT,POST,DELETE
Content-Type: application/json; charset=utf-8
Content-Length: 34
Date: Mon, 05 Sep 2022 04:22:29 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"status":200,"message":"Success"}

I have neither set up Google FCM nor disabled SIP, though I was hoping that neither were prerequisites for getting the basic server up and running. I will try both, the latter first, and then report back.

Daniel-Valentine avatar Sep 05 '22 04:09 Daniel-Valentine

This is due to not having the fcm setup completed. Technically you shouldn't need it. And this is a bug so I will keep this ticket open. However, it seems like at this point that you may need to set it up to continue until we fix the bug.

@tneotia i know you messed around with making the app run without fcm. Was this issue something u messed with or mostly just the android native side/crash

zlshames avatar Sep 05 '22 13:09 zlshames

This bug is fixed internally but since there isn't a 1.10 desktop build yet, it won't work . The webapp does not require FCM as of this time, but it won't work with a local IP unfortunately.

tneotia avatar Sep 05 '22 13:09 tneotia

OK thanks. Once we get a new desktop build it should work. But I think for web, you'll need to use HTTPS for the server. So local IP connections won't work on web only. You can try a workaround, but no guarantees. The workaround is this:

  1. Open the server url in a browser tab.
  2. When you get the insecure warning, type thisisunsafe into the page, anywhere.
  3. Once typed, you should be redirected to the landing page.
  4. Now in the Bluebubbles web tab, try reconnecting/syncing

zlshames avatar Sep 05 '22 13:09 zlshames

@zlshames, @tneotia

Thank you very much for your prompt responses. My issue appears to be a duplicate of #1791, but I can keep this open for your tracking if you would prefer.

I am having issues building the web app, but I'll open a separate issue re that.

Daniel-Valentine avatar Sep 08 '22 02:09 Daniel-Valentine

I am having issues building the web app, but I'll open a separate issue re that.

Make sure you follow the build instructions at https://docs.bluebubbles.app/client

tneotia avatar Sep 08 '22 12:09 tneotia

@zlshames, @tneotia

Thank you very much for your prompt responses. My issue appears to be a duplicate of #1791, but I can keep this open for your tracking if you would prefer.

I am having issues building the web app, but I'll open a separate issue re that.

Is this solved now? I can close it if so

zlshames avatar Nov 22 '22 13:11 zlshames