hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
403 stars 510 forks source link

Exception during startup: Exceeded maximum fetch attempts #2107

Closed seyhdervis closed 1 year ago

seyhdervis commented 1 year ago

Description

Hi guys,

don't know where the issue is when I'm trying to start ACA-py. It seems to be that there is a problem when trying to connect the ledger. I registered my DID via http://test.bcovrin.vonx.io/ and took a example wallet-seed. The genesis-url is working but fetching the genesis transaction fails after 20 attempts.

Can someone help me out of here?

❯ PORTS="8000:8000 8001:8001" ./scripts/run_docker start --label 'My Org' --inbound-transport http 0.0.0.0 8000 --outbound-transport http --admin 0.0.0.0 8001 --admin-insecure-mode --endpoint http://192.168.0.169:8000 --genesis-url http://test.bcovrin.vonx.io/genesis  --wallet-type indy --wallet-name 'myWallet' --wallet-key 'myKey' --auto-provision --auto-accept-invites --auto-accept-requests --seed '01234567891912345678912345678912'
[+] Building 1.0s (16/16) FINISHED
 => [internal] load build definition from Dockerfile.run                                                                                                                                                                         0.0s
 => => transferring dockerfile: 41B                                                                                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                0.0s
 => => transferring context: 34B                                                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/bcgovimages/von-image:py36-1.15-1                                                                                                                                                     0.8s
 => [ 1/11] FROM docker.io/bcgovimages/von-image:py36-1.15-1@sha256:7ba9452bbda1b5d03f117451ba6504f30cfe5598e74ff78f3e6e4ce29a206c65                                                                                             0.0s
 => [internal] load build context                                                                                                                                                                                                0.1s
 => => transferring context: 117.28kB                                                                                                                                                                                            0.1s
 => CACHED [ 2/11] ADD requirements*.txt ./                                                                                                                                                                                      0.0s
 => CACHED [ 3/11] RUN pip3 install --no-cache-dir     -r requirements.txt     -r requirements.askar.txt     -r requirements.bbs.txt     -r requirements.dev.txt                                                                 0.0s
 => CACHED [ 4/11] RUN mkdir aries_cloudagent && touch aries_cloudagent/__init__.py                                                                                                                                              0.0s
 => CACHED [ 5/11] ADD aries_cloudagent/version.py aries_cloudagent/version.py                                                                                                                                                   0.0s
 => CACHED [ 6/11] ADD bin ./bin                                                                                                                                                                                                 0.0s
 => CACHED [ 7/11] ADD README.md ./                                                                                                                                                                                              0.0s
 => CACHED [ 8/11] ADD setup.py ./                                                                                                                                                                                               0.0s
 => CACHED [ 9/11] RUN pip3 install --no-cache-dir -e .                                                                                                                                                                          0.0s
 => CACHED [10/11] RUN mkdir logs && chown -R indy:indy logs && chmod -R ug+rw logs                                                                                                                                              0.0s
 => CACHED [11/11] ADD aries_cloudagent ./aries_cloudagent                                                                                                                                                                       0.0s
 => exporting to image                                                                                                                                                                                                           0.0s
 => => exporting layers                                                                                                                                                                                                          0.0s
 => => writing image sha256:d90b24d71d980e45594b3cb766c16d5146feb602a74c456606cf4b86eb144a05                                                                                                                                     0.0s
 => => naming to docker.io/library/aries-cloudagent-run                                                                                                                                                                          0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

Container name: aries-cloudagent-runner_nKBgtzzhCbpovMIR
No Docker network specified.

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
2023-02-01 13:54:52,996 aries_cloudagent.commands.start ERROR Exception during startup:
Traceback (most recent call last):
  File "/home/indy/aries_cloudagent/utils/http.py", line 120, in fetch
    f"Bad response from server: {response.status} - "
aiohttp.client_exceptions.ClientError: Bad response from server: 404 - Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/indy/aries_cloudagent/config/ledger.py", line 36, in fetch_genesis_transactions
    return await fetch(genesis_url, headers=headers, max_attempts=20)
  File "/home/indy/aries_cloudagent/utils/http.py", line 126, in fetch
    raise FetchError("Exceeded maximum fetch attempts") from e
aries_cloudagent.utils.http.FetchError: Exceeded maximum fetch attempts

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/indy/aries_cloudagent/commands/start.py", line 72, in init
    await startup
  File "/home/indy/aries_cloudagent/commands/start.py", line 28, in start_app
    await conductor.setup()
  File "/home/indy/aries_cloudagent/core/conductor.py", line 122, in setup
    await get_genesis_transactions(context.settings)
  File "/home/indy/aries_cloudagent/config/ledger.py", line 47, in get_genesis_transactions
    txns = await fetch_genesis_transactions(settings["ledger.genesis_url"])
  File "/home/indy/aries_cloudagent/config/ledger.py", line 38, in fetch_genesis_transactions
    raise ConfigError("Error retrieving ledger genesis transactions") from e
aries_cloudagent.config.base.ConfigError: Error retrieving ledger genesis transactions

System

docker-version: v.4.16.2 macOS: Ventura 13.1 (22C65) Chip: Apple M1 Pro

ianco commented 1 year ago

The ledger nodes are running on IP 138.197.138.255 at ports 9702, 9704, 9706 and 9708, so make sure those IP's/ports are visible to you (e.g. they may be blocked by a corporate firewall)

swcurran commented 1 year ago

Closing — likely a setup issue.

swcurran commented 1 year ago

Updates to the documentation welcome!