openwallet-foundation / acapy

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
412 stars 512 forks source link

wallet-type: only "indy" creates DB and tables; "askar" missing #2617

Closed darrellodonnell closed 10 months ago

darrellodonnell commented 10 months ago

using version 0.10.4 we noticed that new Agents are force into in-memory wallets, not postgres.

Leaving out wallet-type: in our config.yml results in an in-memory wallet, not the postgres wallet that we need.

setting wallet-type: indy gives us our storage but then dumps out a deprecation note:

2023-11-20 16:42:14 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2023-11-20 16:42:14 ::                             ⚠ DEPRECATION NOTICE: ⚠                              ::
2023-11-20 16:42:14 :: -------------------------------------------------------------------------------- ::
2023-11-20 16:42:14 :: The Indy wallet type is deprecated, use Askar instead; see: https://aca-         ::
2023-11-20 16:42:14 :: py.org/main/deploying/IndySDKtoAskarMigration/                                   ::
2023-11-20 16:42:14 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

At one point there was a wallet-type: askar option but that has vanished it seems. Only basic (default) and indy are supported as options from what I can see:

--wallet-type <wallet-type>
                        Specifies the type of Indy wallet provider to use. Supported internal storage types are 'basic' (memory) and 'indy'. The default (if not specified)
                        is 'basic'. [env var: ACAPY_WALLET_TYPE]
darrellodonnell commented 10 months ago

is it possible that the wallet-storage-type: basic has been confused with wallet-type: askar somehow?

dbluhm commented 10 months ago

--wallet-type askar will work; the help text is just out of date. I'll submit a quick update for that.

dbluhm commented 10 months ago

If you've attempted to use the askar wallet type and are seeing errors, feel free to post them here. A common issue I've seen is that the postgres version is older than askar requires so I'd keep an eye out for that.

darrellodonnell commented 10 months ago

@dbluhm i thought that we had tried wallet-type: askar and saw immediate failures but a clean start shows that was incorrect. I have an agent running with Askar now. Many thanks!

We had definitely seen the older postgres issues (I somehow ended up with postgres v10 on one machine???). I think the cause of our issues was re-using the wallet-name value. More here...

For those that are interested, if you create a wallet of type indy and then use the same wallet-name: but flip to wallet-type: askar things fail out immediately:

2023-11-21 06:23:33 2023-11-21 14:23:33,653 aries_cloudagent.commands.start ERROR Exception during startup: 2023-11-21 06:23:33 Traceback (most recent call last): 2023-11-21 06:23:33 File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/askar/store.py", line 157, in open_store 2023-11-21 06:23:33 store = await Store.open( 2023-11-21 06:23:33 File "/home/indy/.local/lib/python3.9/site-packages/aries_askar/store.py", line 326, in open 2023-11-21 06:23:33 return Store(await bindings.store_open(uri, key_method, pass_key, profile), uri) 2023-11-21 06:23:33 File "/home/indy/.local/lib/python3.9/site-packages/aries_askar/bindings/init.py", line 83, in store_open 2023-11-21 06:23:33 return await invoke_async( 2023-11-21 06:23:33 File "/home/indy/.local/lib/python3.9/site-packages/aries_askar/bindings/lib.py", line 358, in invoke_async 2023-11-21 06:23:33 return await self.loaded.invoke_async( 2023-11-21 06:23:33 File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in await 2023-11-21 06:23:33 yield self # This tells Task to wait for completion. 2023-11-21 06:23:33 File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup 2023-11-21 06:23:33 future.result() 2023-11-21 06:23:33 File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result 2023-11-21 06:23:33 raise self._exception 2023-11-21 06:23:33 aries_askar.error.AskarError: Backend error 2023-11-21 06:23:33 Caused by: error returned from database: relation "config" does not exist

WadeBarnes commented 10 months ago

To add to @darrellodonnell 's comment. Switching from indy to askar requires a migration. Scripts can be found here; https://github.com/hyperledger/aries-acapy-tools