Quintor / StudyBits

Apache License 2.0
6 stars 5 forks source link

Anoncreds.issuerCreateClaimOffer throws Exception #83

Closed PJUllrich closed 6 years ago

PJUllrich commented 6 years ago

Due to the incompetent way in which Sovrin packages their Ubuntu packages, the Claim functionality is now broken without any influence from my side.

When the Issuer.createClaimOffer method is called, the following Exception is raised in the function Anoncreds.issuerCreateClaimOffer

org.hyperledger.indy.sdk.wallet.WalletValueNotFoundException: No value with the specified key exists in the wallet from which it was requested.
    at org.hyperledger.indy.sdk.IndyException.fromSdkError(IndyException.java:80)
    at org.hyperledger.indy.sdk.IndyJava$API.checkCallback(IndyJava.java:90)
    at org.hyperledger.indy.sdk.anoncreds.Anoncreds.access$500(Anoncreds.java:21)
    at org.hyperledger.indy.sdk.anoncreds.Anoncreds$3.callback(Anoncreds.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)

I used our Docker image of the pool, but still this functionality fails. This blocks my work of adding TranscriptProofs and ExchangePositions in general.

PJUllrich commented 6 years ago

Update: I cloned the StudyBits Master branch and ran the tests. Same issue arrises. Even though we pinned ALL possible versions of libindy etc. Sovrin still manages to insert breaking changes into their software.

PJUllrich commented 6 years ago

Clarification: The tests were run with the pinned version of Indy-Pool AND with the docker image from the Quintor registry and in both cases the error above occurred.

I ran the ClaimIT tests once more with the log level of University set to DEBUG and RUST_LOG set to info. The full output can be found here.

pimotte commented 6 years ago

PR #84 closes this. I've also attempted to run the student branch with this merged, but that runs into a circular dependency issue on beans. I've started to resolve this at https://github.com/Quintor/StudyBits/tree/pim/student-fixed but this really digs into the code you wrote recently, so it's probably best if you look at it.

The issue is a circular dependency involving exchangePositionService, proofRequestController and userProofService. I've refactored it slightly, as a Service being dependent on a Controller is a code smell, but the underlying issue is that the ProofService now needs all ProofHandlers, one of which is the userProofService, which is dependent on the ProofService. A solution would be to extract the proofHandlers map to yet another, new service, but I'd like to talk it through before deciding on that.