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
Error auto updating storage for an agent using the default storage config #1763
Comments
It looks like a problem on the |
Thanks for the quick response @genaris - I've upgraded to the following in my
However, I'm still seeing the same type of error, though the undefined function has a slightly different name:
Full error
|
I think you may have multiple versions of askar shared installed. Could you check your yarn.lock? Or add a dependency on the shared package in your package.json directly to pin the version. |
@TimoGlastra In my The only other shared modules in there are Adding I'll try to dig into the modules themselves to figure out how the default storage is set up, but are there any other ideas? |
Can you see if the value of this.store is defined? Are you able to reproduce the issue in Node.JS? (Or in react native otherwise?) then i could also dive into it a bit more. Hard to tell right now what the issue is |
Yes, it's defined as:
I haven't tried this yet, I can give that a go if it would help to debug
Yes, this happens consistently when the agent attempts to auto update its storage, on both iOS and Android. The only thing that's changed in terms of agent config that's Askar related is the change in namespace for each imported module (to Agent configimport {
ConsoleLogger,
LogLevel,
Agent,
... // more imports
} from '@credo-ts/core'
import { agentDependencies } from '@credo-ts/react-native'
import { ariesAskar } from '@hyperledger/aries-askar-react-native'
...
const config = {
logger: new ConsoleLogger(LogLevel.info),
label: `some label`,
walletConfig: {
id: `some id`,
key: `some key`
},
autoUpdateStorageOnStartup: true
}
const agent = new Agent({
config,
dependencies: agentDependencies,
modules: {
askar: new AskarModule({
ariesAskar
}),
... // more modules
}
}) On my side, I've managed to get as far as identifying that something is wrong with the The keys on the object assigned as a global variable in the JS runtime (on this line) are the following: ariesAskar native object keys[
"version",
"storeOpen",
"storeGenerateRawKey",
"storeProvision",
"storeClose",
"storeCreateProfile",
"storeGetProfileName",
"storeRekey",
"storeRemove",
"storeRemoveProfile",
"sessionClose",
"sessionCount",
"sessionFetch",
"sessionFetchAll",
"sessionFetchAllKeys",
"sessionFetchKey",
"sessionInsertKey",
"sessionRemoveAll",
"sessionRemoveKey",
"sessionStart",
"sessionUpdate",
"sessionUpdateKey",
"entryListGetName",
"entryListGetValue",
"entryListGetCategory",
"entryListGetTags",
"entryListCount",
"entryListFree",
"scanFree",
"scanNext",
"scanStart",
"keyFromJwk",
"keyFromKeyExchange",
"keyFromPublicBytes",
"keyFromSecretBytes",
"keyFromSeed",
"keyGenerate",
"keyGetAlgorithm",
"keyGetEphemeral",
"keyGetJwkPublic",
"keyGetJwkSecret",
"keyGetJwkThumbprint",
"keyGetPublicBytes",
"keyGetSecretBytes",
"keySignMessage",
"keyUnwrapKey",
"keyVerifySignature",
"keyWrapKey",
"keyConvert",
"keyFree",
"keyCryptoBox",
"keyCryptoBoxOpen",
"keyCryptoBoxRandomNonce",
"keyCryptoBoxSeal",
"keyCryptoBoxSealOpen",
"keyDeriveEcdh1pu",
"keyDeriveEcdhEs",
"keyAeadDecrypt",
"keyAeadEncrypt",
"keyAeadGetPadding",
"keyAeadGetParams",
"keyAeadRandomNonce",
"keyEntryListCount",
"keyEntryListFree",
"keyEntryListGetAlgorithm",
"keyEntryListGetMetadata",
"keyEntryListGetName",
"keyEntryListGetTags",
"keyEntryListLoadLocal",
"migrateIndySdk",
"getCurrentError",
"setDefaultLogger"
]
|
What seems weird to me is that this.store.copyTo is undefined. This is a JS method that eventually calls the native methods. But it seems that also the JS side of copyTo is not present -- as otherwise it'd fail at a different level I think. Can you look into the js bundle of shared and see if copyTo is present on Store class? And maybe add some logs at different levels to see where it hangs up? Also can you make sure your node_modules at different levels only contain a single shared install, and that the package.json contains 0.2.0? Sorry with reproduce I meant whether you're able to provide me with a reproduction repo that i can run |
@TimoGlastra a reproduction repo would be difficult to setup quickly, I'll need to find some time to look into getting one ready without any info identifying the project I'm working on. It does appear that The method is called as expected, but the As mentioned in my other comment, the global object's keys do not include With regards to different levels of node_modules, yes it does look like everything is in order there - the overall project's modules are shared by all, and the Since the issue appears to be in the native module, it might be worth noting that this is all on react-native 0.72.6 |
Without a repro, it's quite hard for me to debug this issue further ... You can also send me something privately that reproduce the issue. The
|
Closing as it seems it could be a set-up issue with an earlier 0.5.0-alpha. Should be work fine with current released version (0.5.3). Feel free to re-open if it's still not working for you! |
I'm in the process of migrating a number of agents from
@aries-framework
0.4.x
to@credo-ts
0.5.x-alpha.y
- I've commented on #1569 regarding an issue backing uppostgres
backends but this is a separate issue, as the default storage config usessqlite
.2 of these agents, both of which are part of react-native applications, run into an error when automatically updating their storage, during the backup step. Both agents use the default storage config (i.e
walletConfig.storage
isundefined
).The short version of the error is:
And here is the full error:
Full error + stack (wallet label & app ID redacted)
I assume that the default storage backend should work with the auto update assistant, but this is not the case. Is this because I'm trying to adopt v0.5.x a bit early, or is it a sign of an issue that needs addressing?
The text was updated successfully, but these errors were encountered: