bcgov / aries-vcr

Hyperledger Aries Verifiable Credential Registry (VCR) is a set of application level software components designed to accelerate the adoption of trustworthy entity to entity communications.
Apache License 2.0
78 stars 70 forks source link

Error on startup: Invalid library state #295

Closed Patrik-Stas closed 5 years ago

Patrik-Stas commented 5 years ago

Hi, I am trying to run demo. I've started VON Network locally by

./manage start

Everything seems fine there

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
55d993cf28b2        von-network-base    "bash -c ./scripts/s…"   10 minutes ago      Up 10 minutes       0.0.0.0:9000->8000/tcp             von_webserver_1
a2be9398a179        von-network-base    "bash -c './scripts/…"   10 minutes ago      Up 10 minutes       0.0.0.0:9705-9706->9705-9706/tcp   von_node3_1
36ce6536c55c        von-network-base    "bash -c './scripts/…"   10 minutes ago      Up 10 minutes       0.0.0.0:9701-9702->9701-9702/tcp   von_node1_1
65a3f64a8edf        von-network-base    "bash -c './scripts/…"   10 minutes ago      Up 10 minutes       0.0.0.0:9703-9704->9703-9704/tcp   von_node2_1
04946164db4e        von-network-base    "bash -c './scripts/…"   10 minutes ago      Up 10 minutes       0.0.0.0:9707-9708->9707-9708/tcp   von_node4_1

Then I created new pip environment and install requirements.txt from the both agent and agent/demo directory (by the way seems like requests package is missing in agent/demo/requirements.txt so I install that manually pip install requests)

When I run python faber-pg.py 8600

I see following output:

Registering My Test Company with seed d_000000000000000000000000893595
{'did': 'GWVdu4bc9vDDyirL3npQdQ', 'seed': 'd_000000000000000000000000893595', 'verkey': '9TFmf9VJYq6Y2S5NCdU1nR3JBJk3HjGvkFTFXT4XqHVK'}
Web hooks is running!
http://0.0.0.0:8600/
#1 Provision an agent and wallet, get back configuration details
Webhook url is at http://localhost:8600/webhooks
Admin url is at: http://127.0.0.1:8604
Endpoint url is at: http://127.0.0.1:8601
#3 Create a new schema on the ledger
got line: 2019-06-28 14:38:49,169 aiohttp.server ERROR Error handling request
got line: Traceback (most recent call last):
got line:   File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
got line:     resp = await task
got line:   File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
got line:     resp = await handler(request)
got line:   File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/messaging/schemas/routes.py", line 57, in schemas_send_schema
got line:     async with ledger:
got line:   File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 141, in __aenter__
got line:     await self._context_open()
got line:   File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 111, in _context_open
got line:     await self.open()
got line:   File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 94, in open
got line:     self.pool_handle = await indy.pool.open_pool_ledger(self.name, "{}")
got line:   File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/indy/pool.py", line 82, in open_pool_ledger
got line:     open_pool_ledger.cb)
got line: indy.error.IndyError: (<ErrorCode.CommonInvalidState: 112>, {'backtrace': '', 'message': 'Error: Invalid library state\n  Caused by: Ledger merkle tree is not acceptable for current tree.\n'})
500 Internal Server Error

Traceback (most recent call last):
  File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/messaging/schemas/routes.py", line 57, in schemas_send_schema
    async with ledger:
  File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 141, in __aenter__
    await self._context_open()
  File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 111, in _context_open
    await self.open()
  File "/Users/prague/dev/hyperledger/indy-catalyst/agent/indy_catalyst_agent/ledger/indy.py", line 94, in open
    self.pool_handle = await indy.pool.open_pool_ledger(self.name, "{}")
  File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/indy/pool.py", line 82, in open_pool_ledger
    open_pool_ledger.cb)
indy.error.IndyError: (<ErrorCode.CommonInvalidState: 112>, {'backtrace': '', 'message': 'Error: Invalid library state\n  Caused by: Ledger merkle tree is not acceptable for current tree.\n'})

Traceback (most recent call last):
  File "faber-pg.py", line 176, in main
    schema_response_body = schema_response.json()
  File "/Users/prague/VirtualEnvs/indycat/lib/python3.7/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)
== subprocess exited with rc = -15

Any idea where did I go wrong? I tried to delete wallets and restart VON Network but I am still hitting this issue. I am running it on my localhost, MacOS with all indysdk libraries compiled at 1.8.3.

Thanks.

ianco commented 5 years ago

If you are running the indy ledger in docker (i.e. von-network) you need to run the docker version of the demo:

https://github.com/ianco/indy-catalyst/tree/master/agent/demo#running-the-dockerized-demo

If you are running the demo locally, then you need an indy network that is available on localhost.

We recommend running everything using docker.

WadeBarnes commented 5 years ago

@Patrik-Stas, @ianco, This appears to be an indy-catalyst issue. Please confirm and I can transfer the issue to the correct repository.

ianco commented 5 years ago

@WadeBarnes correct

WadeBarnes commented 5 years ago

@Patrik-Stas, @ianco, The issue has been transferred to the bcgov/indy-catalyst repo.