Open bitgoAaron opened 2 years ago
@bitgoAaron I was running into the same issues and managed to get it working on node 16 slim. I also installed build-essential
using apt-get
. The final image size didn't end up being that much larger.
Spent 3 days trying to understand why my project worked locally but when i deploy to kubernetes cluster it doesn't even start.
Thanks @corymsmith
I’m glad you managed to get it sorted because I spent a ton of time starting out what was going on.
On Thu, Jun 1, 2023 at 3:56 PM Umar Mash @.***> wrote:
Spent 3 days trying to understand why my project worked locally but when i deploy to kubernetes cluster it doesn't even start.
Thanks @corymsmith https://github.com/corymsmith
— Reply to this email directly, view it on GitHub https://github.com/stellar/js-stellar-sdk/issues/798#issuecomment-1572840340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABZE5KRB65OT3MKQL64BTXJEFYDANCNFSM6AAAAAARZ5WSQE . You are receiving this because you were mentioned.Message ID: @.***>
-- Thanks,
Cory
Thanks for bringing this thread out from the depths, guys, and documenting the solution @corymsmith :pray:
I imagine this is because sodium-native
fails to compile, which you can (probably) work around by not installing optional dependencies (npm i --omit optional stellar-sdk
).
I am applying to this issue via OnlyDust platform.
I have a solid background in JavaScript and TypeScript, with experience in developing and debugging applications using various Node.js environments. My familiarity with the Stellar SDK and my understanding of containerization using Docker make me well-equipped to analyze and resolve issues related to the Keypair fromSecret function in Alpine Linux. I’ve previously tackled segmentation faults in other libraries and am comfortable using debugging tools to identify and fix underlying problems.
Reproduce the Issue: Use the provided Docker command to replicate the segmentation fault.
Debug: Employ tools like gdb to gather stack traces and identify the root cause.
Analyze Dependencies: Check for compatibility issues with native modules in Alpine's musl libc.
Propose a Fix: Suggest code changes or document findings for the maintainers.
Test: Implement tests to ensure functionality across various Node.js environments.
@gregemax thanks for taking this on! Please make sure that you use the latest version of the library and alpine; it's entirely possible that this is no longer reproducible.
hi @Shaptic Could you clarify the specific challenges you're facing with the Keypair.fromSecret function in stellar-sdk when running in Alpine Linux? Also, are there any recommended workarounds or solutions for this issue? Additionally, could you point me to the relevant file where I should look for integration details, and are there any important best practices or compatibility considerations with Alpine that I should be aware of before I start working with the SDK
I haven't tried to reproduce this bug - everything you need should be described in the issue description. There are multiple workarounds described above.
The relevant code is in signing.js, since there are two different crypto libraries you can use in the SDK. It sounds like this is only related to one of them.
Describe the bug Trying to use stellar-sdk's Keypair fromSecret function does not work in alpine flavors of linux.
What version are you on?
To Reproduce
npm init -y && npm i stellar-sdk@latest
edit package.json :
Create an index.js file:
docker run -it -v $(pwd):/srv -w /srv node:16-alpine npm run test
Error Output:
Expected behavior
Additional context