-
Notifications
You must be signed in to change notification settings - Fork 1
armv7 binaries are broken: random number generator:RAND_DRBG_instantiate:error retrieving entropy #6
Comments
I added a test stage to the Dockerfile so we can confirm the builds in the future. FYI, I kept everything in separate stages so we can easily build to a targeted stage and then tinker. The armv7 build fails
|
Potentially related issue: Error retrieving entropy since OpenSSL 1.1.1d |
Here is a stacktrace on a real RPi3: Show
And a summarized version: Show
And here is Show
|
Just sharing some inconclusive but relevant findings...
~ # apk add openssl
(1/1) Installing openssl (1.1.1k-r0)
Executing busybox-1.33.1-r2.trigger
OK: 5 MiB in 16 packages
~ # openssl version
OpenSSL 1.1.1k 25 Mar 2021
~ # openssl rand -hex 8
2063532f7e69961e Alpine v3.8 (2 years old) shipped with openssl v1.0.2, while Alpine v3.9 updated openssl to v1.1.1. We could try compiling Node.js with Alpine v3.8, but I don't know that this would actually affect the version of openssl used / imported by Node.js. It might be a
|
Node has a copy of quictls/openssl in its repository. See: https://github.com/nodejs/node/blob/master/doc/guides/maintaining-openssl.md I will try to compile and test openssl on alpine armv7. I'll report back in a few hours 😅 |
I tried something on a whim. |
Great find! 👍 |
A web search includes results of related issues:
For future reference, if anyone cares to investigate further. :-) |
Crypto functionality is broken in the static armv7 node binaries (tested Node v12, v14 and v16 from this repo's releases). Example:
Compare with the expected output of a dynamically compiled Node.js executable:
Replacing
debian:10
withalpine:3.11.3
oralpine:3.14.0
in thedocker run
command line above does not make a difference. I also do not believe that it is related to the version of the Alpine base image (e.g. 3.14.0 vs 3.11.3) in this repo's Dockerfile.Maybe some crypto library, say openssl, was missing during the compilation of Node.js, although it would be strange that it only applies to armv7 and not arm64. We should dig in the compilation messages for any hints. The fix might be as simple as an adding some package to the
apk add
command line. Or we may find the issue is really hard to solve and we cannot use Alpine -- I hope it's not the case.Note that crypto is not just for "cryptography apps" (whatever that means!). For example,
caxa
itself uses it, in fact that's how I first came across the error: https://github.com/leafac/caxa/blob/v2.1.0/src/index.ts#L43The text was updated successfully, but these errors were encountered: