bcgov / issuer-kit

Verifiable Credential Issuer Starter Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

agent_1 node does not start properly

docmanni opened this issue · comments

I have always received this error message when trying to start the issuer-kit (with a clean slate von-network, local install):
agent_1 | Shutting down
agent_1 | 2021-02-03 23:08:43,767 aries_cloudagent.commands.start ERROR Exception during startup:
agent_1 | Traceback (most recent call last):
agent_1 | File "/home/indy/.pyenv/versions/3.6.9/lib/python3.6/site-packages/aries_cloudagent/commands/start.py", line 77, in init
agent_1 | await startup
agent_1 | File "/home/indy/.pyenv/versions/3.6.9/lib/python3.6/site-packages/aries_cloudagent/commands/start.py", line 26, in start_app
agent_1 | await conductor.setup()
agent_1 | File "/home/indy/.pyenv/versions/3.6.9/lib/python3.6/site-packages/aries_cloudagent/core/conductor.py", line 91, in setup
agent_1 | public_did = await wallet_config(context)
agent_1 | File "/home/indy/.pyenv/versions/3.6.9/lib/python3.6/site-packages/aries_cloudagent/config/wallet.py", line 46, in wallet_config
agent_1 | + f" public did {public_did}"
agent_1 | aries_cloudagent.config.base.ConfigError: New seed provided which doesn't match the registered public did Y7RSq4v4L35qwV2fmSffK6

The solution was to include the switch "--replace-public-did" with the aca-py command in the docker/docker-compose.yml script, around line 215ff. After that, I have rebuilt the docker containers and started them again. Now the issuer-kit starts up.

Can somebody verify this solution? Have I included a huge security risk? (At the moment, I'm trying to find my way around the whole system, so it's not a production solution!)

Thanks in advance!

Sorry for the late reply. That error usually happens when the agent's wallet and the ledger are out of sync for one of the following reasons:

  • if you deleted all of the volumes in von-network (e.g.: using ./manage rm), but kept the existing volumes for issuer-kit: the agent will have a stored did/verkey pair in its wallet, but the matching public info will not be on the ledger.
  • if you deleted all of the volumes for issuer-kit, but did not delete the volumes for von-network the public info on the ledger will not match the newly-generated private keys in the agent's wallet.
  • there's a chance this will also happen if you run the demo mode multiple times or switch to the local mode after running the demo, without removing the volumes (same reason as above, mismatching public/private info).

My recommendations would be:

  • ensure you have performed a ./manage rm in both von-network and issuer-kit if you are starting from scratch, or if you are switching from demo mode to local or vice-versa
  • use ./manage stop if you are using local mode and want to restart things without removing the data

Please let me know if this helps!

Thanks for your help! I still haven't got it running on "bare metal", though, as I'm currently fighting a few other problems, one of them being that I already have a PostgreSQL server running and needed to change ports in docker/manage. Couldn't say that it went smoothly to change WALLET_PORT. (Create storage failed: IOError("IO error during storage operation: IO error")). It also seems that the PostgreSQL server is always running on port 5432 in the docker container, is that right? So is the mapping ${WALLET_PORT}:${WALLET_PORT} correct or should it be ${WALLET_PORT}:5432? Anyway, the above error appears in both cases and agent_1 is not starting. Still need to investigate this issue further.

However, I've got the whole thing running in a freshly setup virtual machine. So, I think I'll take it from there.

I would not recommend running it on "bare metal", there are lots of networking settings that rely on the internal docker network and service name resolution that you would have to tweak/update/fix to run everything natively: just use the services running in docker, they should work fine as they were prepared with that intention.

The PostgreSQL container will expose port 5432 as that is the default port for PostgreSQL. If you are having conflicts with something running on your local machine, the docker-compose mapping should be updated to look like 5438:${WALLET_PORT}: the WALLET_PORT environment variable is used by the agent to know which port to send requests to on the internal docker network (not using the interface exposed on the host machine). This way your wallet will be accessible on the host machine on port 5438 (this is an example, use whichever port you prefer) and on the internal docker network it will use the default port.

I would suggest you perform a ./manage rm in both von-network and issuer-kit and try again, starting von-network first of course. I assume you are running ./manage start for both projects, and ./manage build has been successfully completed before attempting to start the projects. This was tested extensively and we have not encountered errors, but something specific to your machine (running services with conflicting ports, etc.) could be the issue - in which case I agree you'll have to do more digging 🙂

Closing this as it appears to be something specific to the op's environment. Please feel free to reopen if that is not the case.