VirgilSecurity/virgil-e3kit-kotlin

com.virgilsecurity.keyknox.exception.KeyknoxServiceException: `Virgil-Keyknox-Previous-Hash` header is invalid.

Closed this issue · 1 comments

Describe the bug
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1
Process: io.getstream.thestream, PID: 2087
com.virgilsecurity.keyknox.exception.KeyknoxServiceException: Virgil-Keyknox-Previous-Hash header is invalid.
at com.virgilsecurity.keyknox.client.HttpClient.send(HttpClient.kt:101)
at com.virgilsecurity.keyknox.client.KeyknoxClient.pushValue(KeyknoxClient.kt:126)
at com.virgilsecurity.keyknox.KeyknoxManager$pushValue$operation$1.invoke(KeyknoxManager.kt:84)
at com.virgilsecurity.keyknox.KeyknoxManager$pushValue$operation$1.invoke(KeyknoxManager.kt:53)
at com.virgilsecurity.keyknox.KeyknoxManager.run(KeyknoxManager.kt:167)
at com.virgilsecurity.keyknox.KeyknoxManager.pushValue(KeyknoxManager.kt:95)
at com.virgilsecurity.android.common.storage.cloud.CloudTicketStorage.store$ethree_common_release(CloudTicketStorage.kt:83)
at com.virgilsecurity.android.common.manager.GroupManager.store$ethree_common_release(GroupManager.kt:70)
at com.virgilsecurity.android.common.worker.GroupWorker$createGroup$1.get(GroupWorker.kt:71)
at com.virgilsecurity.android.common.worker.GroupWorker$createGroup$1.get(GroupWorker.kt:59)
at io.getstream.thestream.services.VirgilService.init(VirgilService.kt:41)
at io.getstream.thestream.MainActivity$onCreate$1$1.invokeSuspend(MainActivity.kt:33)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

To Reproduce
The last line of this function throws this error:


    fun init(context: Context, user: String) {
        val params = EThreeParams(user, BackendService::getVirgilToken, context)
        eThree = EThree(params)

        try {
            if(!eThree.hasLocalPrivateKey()) {
                eThree.register().execute()
            }
        } catch (e: EThreeException) {
            if (e.description != EThreeException.Description.USER_IS_ALREADY_REGISTERED) {
                // if user is already registered, we can safely ignore, otherwise rethrow
                throw e
            }
        }

        val otherUsers = BackendService.getUsers()
        userCards =
            if (otherUsers.isEmpty()) {
                FindUsersResult()
            } else eThree.findUsers(
                otherUsers,
                forceReload = true,
                checkResult = false
            ).get()
        userTimelineGroup = eThree.createGroup("feed-group-${user}", userCards).get()
    }

Platform (please complete the following information):

  • Device: All devices
  • OS: Android API R
  • E3Kit Version com.virgilsecurity:ethree:2.0.4

Just checking if someone has had a chance to look at this. This is a blocker for me and curious if there's at least aw ork around.

Thanks!