Skip to content

Commit 338851c

Browse files
swcurranWadeBarnes
authored andcommitted
Add troubleshooting document, include initial examples - ledger connection, out-of-sync RevReg
Signed-off-by: Stephen Curran <swcurran@gmail.com>
1 parent 5d1988f commit 338851c

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

DevReadMe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ See the [README](README.md) for details about this repository and information ab
1818
- [Developing](#developing)
1919
- [Prerequisites](#prerequisites)
2020
- [Running Locally](#running-locally)
21+
- [Logging](#logging)
2122
- [Running Tests](#running-tests)
2223
- [Running Aries Agent Test Harness Tests](#running-aries-agent-test-harness-tests)
2324
- [Development Workflow](#development-workflow)

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ An ACA-Py instance puts together an OpenAPI-documented REST interface based on t
7878

7979
Technical note: the administrative API exposed by the agent for the controller to use must be protected with an API key (using the --admin-api-key command line arg) or deliberately left unsecured using the --admin-insecure-mode command line arg. The latter should not be used other than in development if the API is not otherwise secured.
8080

81+
## Troubleshooting
82+
83+
There are a number of resources for getting help with ACA-Py and troubleshooting
84+
any problems you might run into. The [Troubleshooting](Troubleshooting.md)
85+
document contains some guidance about issues that have been experienced in the
86+
past. Feel free to submit PRs to supplement the troubleshooting document!
87+
Searching the [ACA-Py GitHub
88+
issues](https://github.com/hyperledger/aries-cloudagent-python/issues) will
89+
often uncover challenges that others have experienced, often with answers to
90+
solving those challenges. As well, there is the "aries-cloudagent-python"
91+
channel on the Hyperledger Discord chat server ([invitation
92+
here](https://discord.gg/hyperledger)).
93+
8194
## Credit
8295

8396
The initial implementation of ACA-Py was developed by the Government of British Columbia’s Digital Trust Team in Canada. To learn more about what’s happening with decentralized identity and digital trust in British Columbia, a new website will be launching and the link will be made available here.

Troubleshooting.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Troubleshooting Aries Cloud Agent Python <!-- omit in toc -->
2+
3+
## Table of Contents <!-- omit in toc -->
4+
5+
- [Unable to Connect to Ledger](#unable-to-connect-to-ledger)
6+
- [Local ledger running?](#local-ledger-running)
7+
- [Any Firewalls](#any-firewalls)
8+
- [Damaged, Unpublishable Revocation Registry](#damaged-unpublishable-revocation-registry)
9+
10+
## Unable to Connect to Ledger
11+
12+
The most common issue hit by first time users is getting an error on startup "unable to connect to ledger". Here are a list of things to check when you see that error.
13+
14+
### Local ledger running?
15+
16+
Unless you specify via startup parameters or environment variables that you are using a public Hyperledger Indy ledger, ACA-Py assumes that you are running a local ledger -- an instance of [von-network](https://github.com/bcgov/von-network).
17+
If that is the cause -- have you started your local ledger, and did it startup properly. Things to check:
18+
19+
- Any errors in the startup of von-network?
20+
- Is the von-network webserver (usually at `https:/localhost:9000`) accessible? If so, can you click on and see the Genesis File?
21+
- Do you even need a local ledger? If not, you can use a public sandbox ledger,
22+
such as the [Dev Greenlight ledger](), likely by just prefacing your ACA-Py
23+
command with `LEDGER_URL=http://dev.greenlight.bcovrin.vonx.io`. For example,
24+
when running the Alice-Faber demo in the [demo](demo) folder, you can run (for
25+
example), the Faber agent using the command:
26+
`LEDGER_URL=http://dev.greenlight.bcovrin.vonx.io ./run_demo faber`
27+
28+
### Any Firewalls
29+
30+
Do you have any firewalls in play that might be blocking the ports that are used by the ledger, notably 9701-9708? To access a ledger
31+
the ACA-Py instance must be able to get to those ports of the ledger, regardless if the ledger is local or remote.
32+
33+
## Damaged, Unpublishable Revocation Registry
34+
35+
We have discovered that in the ACA-Py AnonCreds implementation, it is possible
36+
to get into a state where the publishing of updates to a Revocation Registry
37+
(RevReg) is impossible. This can happen where ACA-Py starts to publish an update
38+
to the RevReg, but the write transaction to the Hyperledger Indy ledger fails
39+
for some reason. When a credential revocation is published, aca-py (via indy-sdk
40+
or askar/credx) updates the revocation state in the wallet as well as on the
41+
ledger. The revocation state is dependant on whatever the previous revocation
42+
state is/was, so if the ledger and wallet are mis-matched the publish will fail.
43+
(Andrew/s PR # 1804 (merged) should mitigate but probably won't completely
44+
eliminate this from happening).
45+
46+
For example, in case we've seen, the write RevRegEntry transaction failed at the
47+
ledger because there was a problem with accepting the TAA (Transaction Author
48+
Agreement). Once the error occurred, the RevReg state held by the ACA-Py agent,
49+
and the RevReg state on the ledger were different. Even after the ability to
50+
write to the ledger was restored, the RevReg could still not be published
51+
because of the differences in the RevReg state. Such a situation can now be
52+
corrected, as follows:
53+
54+
To address this issue, some new endpoints were added to ACA-Py in Release 0.7.4,
55+
as follows:
56+
57+
- GET /revocation/registry/<id>/issued - counts of the number of issued/revoked
58+
within a registry
59+
- GET /revocation/registry/<id>/issued/details - details of all credentials
60+
issued/revoked within a registry
61+
- GET /revocation/registry/<id>/issued/indy_recs - calculated rev_reg_delta from
62+
the ledger
63+
- This is used to compare ledger revoked vs wallet revoked credentials, which
64+
is essentially the state of the RevReg on the ledger and in ACA-Py. Where
65+
there is a difference, we have an error.
66+
- PUT /revocation/registry/<id>/fix-revocation-entry-state - publish an update
67+
to the RevReg state on the ledger to bring it into alignment with what is in
68+
the ACA-Py instance.
69+
- There is a boolean parameter (`apply_ledger_update`) to control whether the
70+
ledger entry actually gets published so, if you are so inclined, you can
71+
call the endpoint to see what the transaction would be, before you actually
72+
try to do a ledger update. This will return:
73+
- `rev_reg_delta` - same as the ".../indy_recs" endpoint
74+
- `accum_calculated` - transaction to write to ledger
75+
- `accum_fixed` - If `apply_ledger_update`, the transaction actually written
76+
to the ledger
77+
78+
Note that there is (currently) a backlog item to prevent the wallet and ledger
79+
from getting out of sync (e.g. don't update the ACA-Py RevReg state if the
80+
ledger write fails), but even after that change is made, having this ability
81+
will be retained for use if needed.
82+
83+
We originally ran into this due to the TAA acceptance getting lost when
84+
switching to multi-ledger (as described
85+
[here](https://github.com/hyperledger/aries-cloudagent-python/blob/main/Multiledger.md#a-special-warning-for-taa-acceptance).
86+
Note that this is one reason how this "out of sync" scenario can occur, but
87+
there may be others.
88+
89+
We add an integration test that demonstrates/tests this issue [here](https://github.com/hyperledger/aries-cloudagent-python/blob/main/demo/features/taa-txn-author-acceptance.feature#L67).
90+
91+
To run the scenario either manually or using the integration tests, you can do the following:
92+
93+
- Start von-network in TAA mode:
94+
- `./manage start --taa-sample --logs`
95+
- Start the tails server as usual:
96+
- `./manage start --logs`
97+
- To run the scenario manually, start faber and let the agent know it needs to TAA-accept before doing any ledger writes:
98+
- `./run_demo faber --revocation --taa-accept`, and then you can run through all the transactions using the Swagger page.
99+
- To run the scenario via an integration test, run:
100+
- `./run_bdd -t @taa_required`

0 commit comments

Comments
 (0)