-
Notifications
You must be signed in to change notification settings - Fork 285
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
ODAP-Hermes (SATP) package stopped working #2984
Comments
Adding another log for another ODAP-related bug. In this instance, the CBDC app was run using The error:
|
@AndreAugusto11 This error can be solved by going one level higher when looking for knex in file const configFile = require("../../../../knex/knexfile.ts")[
process.env.ENVIRONMENT || "development"
]; to const configFile = require("../../../../../knex/knexfile.ts")[
process.env.ENVIRONMENT || "development"
]; Caught this issue some time ago but did not have time to do follow up work on it, sorry :/ In general importing local files like this is very error prone (as we can see), so I'd replace it with env variable. It's possible it used to work before changing module resolution to |
@RafaelAPB Yeah, |
Hi @outSH, thanks for the help! It's probably because we should account for the file being run inside the module.exports = {
development: {
client: "sqlite3",
connection: {
filename: path.resolve(__dirname, ".dev-" + uuidv4() + ".sqlite3"),
},
migrations: {
directory: path.resolve(__dirname, "migrations"),
},
useNullAsDefault: true,
},
}; |
@outSH thanks a lot. We will try to fix this ourselves. If you have some more details, please share them with us (for example, can you point us to this other dependencies where a CJS self-release was done). |
@AndreAugusto11 Sorry for late answer. I think that the DB file and migrations dir should be configurable in some way (either from envvar or through plugin constructor / setup), if we do that then this file is no longer dynamic and could be included in the source of the file. If for some reason this can't be done, then I think you can add a postbuild script that will copy all the needed files to dist (example from another package - https://github.com/hyperledger/cacti/blob/main/packages/cactus-plugin-ledger-connector-ethereum/package.json#L55) |
@RafaelAPB Details are in this PR (see peter additional changes part): https://github.com/hyperledger/cacti/pull/2829 |
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
* implement the repository design pattern to make storage technology agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a sqlite database * add post build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
*implement the repository design pattern to make storage technology-agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a SQLite database * add post-build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 depends on hyperledger-cacti#3006 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
*implement the repository design pattern to make storage technology-agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a SQLite database * add post-build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 depends on hyperledger-cacti#3006 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
*implement the repository design pattern to make storage technology-agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a SQLite database * add post-build instruction to copy knex files to dist/ closes hyperledger-cacti#2984 depends on hyperledger-cacti#3006 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
*implement the repository design pattern to make storage technology-agnostic * due to the deprecation of the ipfs package, this allows one to choose another storage * refactoring of the tests and the CBDC example that is based on the SATP * implement the remote log storage as a SQLite database * add post-build instruction to copy knex files to dist/ closes #2984 depends on #3006 Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
Describe the bug
All the tests of the ODAP-Hermes business logic plugin were passing flawlessly. @AndreAugusto11 try to execute them in different environments and failed.
To Reproduce
Execute one of the integration tests. For example, client-crash-after-delete-asset.test.ts:
npx jest packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-delete-asset.test.ts
.Expected behavior
Test passes
Logs/Stack traces
Test emits seg. fault in l. 160, where we are importing kuboRpcModule:
``const kuboRpcModule = await import("kubo-rpc-client") .
Was there any project-level configuration change that made invalid such import?
Logs provided by @AndreAugusto11 (same result for me): https://gist.github.com/AndreAugusto11/3ec7cc17087edd4d17b0646cc2bdd3ba
Operating system name, version, build:
Node: v16.20.2
Npm: v8.19.4
Commit: 1fb2551 (latest)
"(uname -srm)\n$(cat /etc/os-release)\n"
bash: Linux 5.15.0-1048-gcp x86_64\nNAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal\n: No such file or directory
Also tested with node v18.19 and npm v10.2.3.
The text was updated successfully, but these errors were encountered: