openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
276 stars 202 forks source link

Dynamic Linking Error - Askar Wallet #1771

Closed sudddy closed 9 months ago

sudddy commented 9 months ago
INFO: Creating agent with config {
  "agentConfig": {
    "label": "Testdemoongoing",
    "walletConfig": {
      "id": "Testdemoongoing",
      "key": "[*****]",
      "storage": {}
    },
    "autoUpdateStorageOnStartup": true,
    "logger": 1,
    "agentDependencies": true
  }
}
DEBUG: Listening for routing key created events in tenant agent context provider
INFO: Initializing wallet 'Testdemoongoing' {
  "id": "Testdemoongoing",
  "key": "[*****]",
  "storage": {}
}
{"level":"error","message":"Error initializing Agent Error opening wallet Testdemoongoing: Dynamic Linking Error: Error relocating /app/node_modules/@hyperledger/aries-askar-nodejs/native/libaries_askar.so: __isnan: symbol not found","stack":"WalletError: Error opening wallet Testdemoongoing: Dynamic Linking Error: Error relocating /app/node_modules/@hyperledger/aries-askar-nodejs/native/libaries_askar.so: __isnan: symbol not found\n    at AskarWallet._open (/app/node_modules/@credo-ts/askar/build/wallet/AskarWallet.js:183:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async AskarWallet.open (/app/node_modules/@credo-ts/askar/build/wallet/AskarWallet.js:120:9)\n    at async WalletApi.open (/app/node_modules/@credo-ts/core/build/wallet/WalletApi.js:73:9)\n    at async WalletApi.initialize (/app/node_modules/@credo-ts/core/build/wallet/WalletApi.js:47:13)\n    at async Agent.initialize (/app/node_modules/@credo-ts/core/build/agent/BaseAgent.js:92:13)\n    at async Agent.initialize (/app/node_modules/@credo-ts/core/build/agent/Agent.js:120:9)"}

Is it due to the versions?

I'm currently using


        "@credo-ts/anoncreds": "^0.5.0-alpha.127",
        "@credo-ts/askar": "^0.5.0-alpha.127",
        "@credo-ts/cheqd": "^0.5.0-alpha.127",
        "@credo-ts/core": "^0.5.0-alpha.127",
        "@credo-ts/indy-vdr": "^0.5.0-alpha.127",
        "@credo-ts/node": "^0.5.0-alpha.127",
        "@credo-ts/openid4vc": "^0.5.0-alpha.115",
        "@credo-ts/question-answer": "^0.5.0-alpha.127",
        "@credo-ts/tenants": "^0.5.0-alpha.127",
        "@hyperledger/anoncreds-nodejs": "^0.2.0",
        "@hyperledger/aries-askar-nodejs": "^0.2.0",
        "@hyperledger/aries-askar-shared": "^0.2.0",
        "@hyperledger/indy-vdr-nodejs": "^0.2.0-dev.6"
}```
berendsliedrecht commented 9 months ago

What environment are you running it in? Any chance it uses musl for libc?

sudddy commented 9 months ago

I was using node-20-alpine version and installed other dependencies for others manually to reduce the image size. Guess something went wrong over there.

Using node-20 version doesn't throw errors.

Didn't investigate much on it. @berendsliedrecht

berendsliedrecht commented 9 months ago

Alpine uses musl which we did not account for. Not sure what a quick fix would be, but we should also release libraries for musl for the shared components.

berendsliedrecht commented 9 months ago

Temporarily you could add RUN apk add --no-cache gcompat libstdc++ to your docker file. Depending on your opinion on musl, this might be a good solution. If you really want to keep the image size as small as possible, you could manually build askar for x86_64-unknown-linux-musl and use that via the LIB_ARIES_ASKAR_PATH env var.

sudddy commented 9 months ago

Thanks @berendsliedrecht Yes, I will have to try those. 🙏