1

I am running robo tests on a variety of devices in the Firebase Test Lab (e.g. Pixel 3, Api Level 28). The test devices cannot load data from the Firebase real-time database, because of an invalid app check token.

Relevant logs include:

09-17 21:33:30.327: D/WebSocket(1870): ws_0 - websocket opened

09-17 21:33:30.327: D/WebSocket(1870): ws_0 - Reset keepAlive

09-17 21:33:30.327: D/WebSocket(1870): ws_0 - ws message: {"t":"c","d":{"t":"s","d":"Invalid appcheck token"}}

09-17 21:33:30.328: D/WebSocket(1870): ws_0 - Reset keepAlive. Remaining: 44999

09-17 21:33:30.328: D/WebSocket(1870): ws_0 - HandleNewFrameCount: 1

09-17 21:33:30.328: D/WebSocket(1870): ws_0 - handleIncomingFrame complete frame: {t=c, d={t=s, d=Invalid appcheck token}}

09-17 21:33:30.328: D/Connection(1870): conn_0 - Got control message: {t=s, d=Invalid appcheck token}

09-17 21:33:30.328: D/Connection(1870): conn_0 - Connection shutdown command received. Shutting down...

09-17 21:33:30.328: W/PersistentConnection(1870): pc_0 - Firebase Database connection was forcefully killed by the server. Will not attempt reconnect. Reason: Invalid appcheck token

09-17 21:33:30.328: D/PersistentConnection(1870): pc_0 - Connection interrupted for: server_kill

09-17 21:33:30.329: D/Connection(1870): conn_0 - closing realtime connection

09-17 21:33:30.329: D/WebSocket(1870): ws_0 - websocket is being closed

09-17 21:33:30.329: D/PersistentConnection(1870): pc_0 - Got on disconnect due to OTHER

The same build runs on my phone (Pixel 3) and loads all data successfully.

I wondered if I needed to do something similar to what is described in "Use the debug provider for unit testing in a CI environment" (https://firebase.google.com/docs/app-check/android/debug-provider), but that doesn't make sense to me-- these are physical devices, right? (Furthermore, it's completely unclear to me how I'd go about following those steps from the Firebase console).

I'd greatly appreciate any hints or advice! Thank you.

  • Did you ever solve this? – PLPeeters Apr 27 '22 at 06:03
  • Hi, sorry for the delay in responding! No, I didn't. Between this and my other sad unanswered question (https://stackoverflow.com/questions/69217769/how-to-get-valid-firebase-appcheck-token-after-reconnecting-to-network), I gave up on using app check for now. Fortunately, my security requirements weren't very intense, but I really wanted to follow best practices. Maybe I'll revisit one day and the product will be more mature/user friendly by then. – mathAndCats May 23 '22 at 02:32
  • @mathAndCats interesting because I'm also trying to find a solution for this: https://stackoverflow.com/questions/75187483/firebase-what-signatures-should-be-present-in-settings/75204064#75204064. Funny thing is that I'm able to get appcheck to run in API 12 but not in API 9. Right now I don't have a device that uses 10, 11 so I can't say for those two. Were you able to find anything out since then? – enchance Jan 30 '23 at 10:04

0 Answers0