Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Alice Faber Demo locally on Ubuntu 18.04, FAILING! #171

Closed
adityaishan opened this issue Sep 5, 2019 · 9 comments
Closed

Running Alice Faber Demo locally on Ubuntu 18.04, FAILING! #171

adityaishan opened this issue Sep 5, 2019 · 9 comments

Comments

@adityaishan
Copy link

adityaishan commented Sep 5, 2019

I am following instructions from this read.md https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/README.md#running-locally.

Von network is running locally. ✔️
output:

(venv) adityaishan@atmecsadmin-Latitude-E5450:~/hyperledger/von-network$ GENESIS_FILE=/path/to/local-genesis.txt PORT=9000 REGISTER_NEW_DIDS=true python -m server.server
INFO:main:REGISTER_NEW_DIDS is set to True
INFO:main:LEDGER_INSTANCE_NAME is set to "Ledger Browser"
INFO:main:Web analytics are DISABLED
INFO:main:Running webserver...
INFO:main:Creating trust anchor...
INFO:server.anchor:Ledger cache will be stored in :memory:
======== Running on http://0.0.0.0:9000 ========
(Press CTRL+C to quit)
INFO:server.anchor:Initializing transaction database
ERROR:server.anchor:Initialization error:
Traceback (most recent call last):
File "/home/adityaishan/hyperledger/von-network/server/anchor.py", line 352, in open
await self._open_pool()
File "/home/adityaishan/hyperledger/von-network/server/anchor.py", line 192, in _open_pool
pool_name, json.dumps({"genesis_txn": await resolve_genesis_file()})
File "/home/adityaishan/hyperledger/von-network/server/anchor.py", line 120, in resolve_genesis_file
raise AnchorException("No genesis file or URL defined")
server.anchor.AnchorException: No genesis file or URL defined
INFO:main:--- Trust anchor initialized ---
INFO:aiohttp.access:127.0.0.1 [05/Sep/2019:11:59:34 +0000] "POST /register HTTP/1.1" 503 197 "-" "Python/3.6 aiohttp/3.5.4"

Alice agent is running and waiting for invite details. ✔️
output:

(venv) adityaishan@atmecsadmin-Latitude-E5450:~/hyperledger/aries-cloudagent-python/demo$ GENESIS_FILE=/path/to/local-genesis.txt DEFAULT_POSTGRES=true python3 -m runners.alice --port 8030

#7 Provision an agent and wallet, get back configuration details
Startup duration: 9.07s
Admin url is at: http://127.0.0.1:8031
Endpoint url is at: http://localhost:8030

#9 Input faber.py invitation details
Invite details:

Faber agent is failing ❌
output:

(venv) adityaishan@atmecsadmin-Latitude-E5450:~/hyperledger/aries-cloudagent-python/demo$ GENESIS_FILE=/path/to/local-genesis.txt DEFAULT_POSTGRES=true python3 -m runners.faber --port 8020

#1 Provision an agent and wallet, get back configuration details
Faber | Registering Faber Agent with seed d_000000000000000000000000994455

http://localhost:9000

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/adityaishan/hyperledger/aries-cloudagent-python/demo/runners/faber.py", line 293, in
asyncio.get_event_loop().run_until_complete(main(args.port, args.timing))
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/home/adityaishan/hyperledger/aries-cloudagent-python/demo/runners/faber.py", line 132, in main
await agent.register_did()
File "/home/adityaishan/hyperledger/aries-cloudagent-python/demo/runners/support/agent.py", line 221, in register_did
raise Exception(f"Error registering DID, response code {resp.status}")
Exception: Error registering DID, response code 503
(venv) adityaishan@atmecsadmin-Latitude-E5450:~/hyperledger/aries-cloudagent-python/demo$

Any help from here would be grateful.

@adityaishan
Copy link
Author

I got it working....

@swcurran
Copy link
Contributor

Awesome. Sorry for the lack of response. It was tough to figure out what was happening from the info.

Any info on what you changed to make it work?

@Sarangc1203
Copy link

Just putting this out here for others who face a similar issue.
@swcurran Seems like the error was with configuring the ledger. Somehow location of the genesis file was incorrect and hence server.anchor.AnchorException: No genesis file or URL defined error in the VON's log. I haven't personally tried running it locally, but I faced a similar issue when I used their docker script to run the demo. But the error was that I hadn't copied the genesis file into the docker container. Also, there was some error in specifying the location to the genesis file (I had used a relative path initially) as the pwd changed when the container starts.

@swcurran
Copy link
Contributor

I'll give a try on mine again. It's worked in the past but haven't run it in awhile. I'm Ubuntu 18.04 as well so hopefully will see consistency.

@rodolfoleal
Copy link

rodolfoleal commented Oct 18, 2020

Had the same issue while following the tutorials.

https://github.com/hyperledger/aries-cloudagent-python/tree/master/demo#running-in-docker

I ran the command under the running in docker section, and received the error

Tried to run the same command of "Running in a browser" section and everything worked.

LEDGER_URL=http://dev.greenlight.bcovrin.vonx.io ./run_demo faber

Hope that can help others.

@mohitrakhade20
Copy link

Thank You @rodolfoleal

@dnaicker86
Copy link

The exact cause is that the seed is not registered to the localhost ledger which by default the demo searches for localhost.

To overcome this issue:

  1. Navigate to http://localhost:9000 if that is where your indy ledger is
  2. Add the following details to the ledger depending on the data on the console log displayed, the agent seed in this thread was 'd_000000000000000000000000994455', it will be different for you, mine was
image

You could try using indy-cli to add a DID to the ledger as well although I have not tried.

Thereafter the demo will be able to ./run_demo faber

@swcurran
Copy link
Contributor

swcurran commented Jul 3, 2023

That’s not right @dnaicker86. There is a DID that has a well known seed written on the ledger, and that DID is used to create the other objects, so no new seed/DID is needed. You can add them and specify the seed/DID is the one you want to use, but you don’t have to. The same well known seed is used for all sandbox Indy networks.

@dnaicker86
Copy link

It worked for me and resolved the issue. I think the documentation and tutorials need to be clarified as these errors still persist and developers need to try and make sense of them instead of them being told it is not right when they have to resolve on their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants