Skip to content
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

AWS CRT binary not present in any of the following locations #119

Closed
1 task done
markusl opened this issue Dec 19, 2020 · 28 comments
Closed
1 task done

AWS CRT binary not present in any of the following locations #119

markusl opened this issue Dec 19, 2020 · 28 comments
Assignees
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days.

Comments

@markusl
Copy link

markusl commented Dec 19, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug

Hi, I'm trying to use the AWS IoT SDK on Raspberry Pi Zero W but facing a problem when doing npm install aws-crt.

After installation, when starting the project, I'm getting the following error:

AWS CRT binary not present in any of the following locations:
        /home/pi/app/app/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
        /home/pi/app/app/node_modules/aws-crt/dist/bin/linux-arm/aws-crt-nodejs

SDK version number

    "aws-crt": "^1.3.4",
    "aws-iot-device-sdk-v2": "^1.3.3",

Platform/OS/Hardware/Device

Raspberry Pi Zero W

To Reproduce (observed behavior)
Steps to reproduce the behavior (please share code)

Expected behavior

I would expect the project to install the dependency as usual. Are there some additional steps I should take to get the SDK working on Raspberry Pi Zero W?

Best Regards,
Markus

@markusl markusl added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 19, 2020
@yitzchak-ben-ezra-ecoplant

I have the same issue.
The files are there - but require fails to load them!
If I change the code locally (in binding.js) - it works:
from this:
image

to this:
image

It works - But I can't do it on my pipeline :(

@yitzchak-ben-ezra-ecoplant

Ok, found MY issue, hope it can help you too.
require('file-name-without-extention') will first try to load .js, than .json, than .node (the file that is really there!)

I had the failure in jest unit tests, and it happened because I had explicitly overrided jest defaults (cursed copy-paste!)

"jest": {
    ...
    "moduleFileExtensions": [
      "js",
      "json",
      "ts" // MISSING .node HERE!
    ],
    ...
  }

Try to debug binding.js and try to see why require fails to find .node file!

@jmklix
Copy link
Member

jmklix commented Dec 21, 2020

Make sure to sure to take the following into account when installing from npm (found in samples readme)

If you are installing via npm instead of building from source, please make the following change to the package.json under each sample.

From:
    "dependencies": {
        "aws-iot-device-sdk-v2": "../../../",
        "yargs": "^14.0.0"
    }

To:
    "dependencies": {
        "aws-iot-device-sdk-v2":  "<latest released version eg: ^1.3.0>",
        "yargs": "^14.0.0"
    }

If this or the fix that @yitzchak-ben-ezra-ecoplant suggested don't work please reply with more info. What version on nodejs? You said after installation you are getting that error, what exactly are you trying to do? If trying to run the pubsub please include the command you are using with all parameters.

@jmklix jmklix self-assigned this Dec 21, 2020
@jmklix jmklix added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2020
@markusl
Copy link
Author

markusl commented Dec 22, 2020

@jmklix The code I'm trying to use is at https://github.com/markusl/ruuvitag-aws-iot-monitoring/blob/master/app-v2/package.json

When starting the app with npx ts-node main on Raspberry Pi Zero W, the error message appears:

AWS CRT binary not present in any of the following locations:
        /home/pi/app/app/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
        /home/pi/app/app/node_modules/aws-crt/dist/bin/linux-arm/aws-crt-nodejs

Do you need any more details about this?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Dec 22, 2020
@jmklix
Copy link
Member

jmklix commented Jan 5, 2021

I've replicated this on a raspberry pi 4 when using nodejs v15. By switching to nodejs v14 I was able to successfully install and run this. If this does not fix your issues please let us know.

@jmklix jmklix added the closing-soon This issue will automatically close in 5 days unless further comments are made. label Jan 5, 2021
@markusl
Copy link
Author

markusl commented Jan 6, 2021

@jmklix The problem for me exists on Raspberry Pi Zero W with NodeJs 14.15.2 armv6l version. Could you explain why this is happening?

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 5 days unless further comments are made. label Jan 6, 2021
@Rmannn
Copy link

Rmannn commented Jan 6, 2021

I have the same problem as @markusl
Cmake is not building the arm version.

@jmklix
Copy link
Member

jmklix commented Jan 6, 2021

How where you able to install Nodejs v14.15.2 armv6l on the raspberry pi zero w? I'm using node v10.21.0 on a raspberry pi and it runs into a missing file different from what you are getting.

npm ERR! path /home/pi/Documents/AWS/aws-iot-device-sdk-js-v2/samples/node/pub_sub/node_modules/.staging/ansi-58fafc0e
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/pi/Documents/AWS/aws-iot-device-sdk-js-v2/samples/node/pub_sub/node_modules/.staging/ansi-58fafc0e' -> '/home/pi/Documents/AWS/aws-iot-device-sdk-js-v2/node_modules/ansi'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-01-06T20_00_47_582Z-debug.log

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 6, 2021
@markusl
Copy link
Author

markusl commented Jan 7, 2021

The install script documented in numerous online sources is also attached to my repository: https://github.com/markusl/ruuvitag-aws-iot-monitoring/blob/master/app-v2/node-install.sh

NodeJs historically also supported armv6l officially. The current "unofficial" builds are from the same sources but there are no guarantees that the full NodeJs test suite passes. It would still be much better to use the LTS version than 10.x. Hope this answers your question @jmklix :)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 7, 2021
@jmklix
Copy link
Member

jmklix commented Jan 8, 2021

Thanks for that script. I was able to successfully build and run the pubsub sample on a raspberry pie zero w. These are the steps I followed

git clone https://github.com/aws/aws-iot-device-sdk-js-v2.git
cd aws-iot-device-sdk-js-v2
npm install
cd samples/node/pub_sub
npm install
node dist/index.js --endpoint <endpoint>-ats.iot.us-west-2.amazonaws.com --root-ca <PathToRootCA> --cert <PathToCert> --key <PathToKey>

Can you confirm that you are able to run the pub_sub example?

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 8, 2021
@Rmannn
Copy link

Rmannn commented Jan 13, 2021

I was not able to install this packages on Docker using node:12-alpine, aws-crt is also missing.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 13, 2021
@jmklix
Copy link
Member

jmklix commented Jan 13, 2021

@Rmannn we do not currently support Alpine Linux. There is an open feature request and I encourage you to upvote so we can prioritize based on community feedback.

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 13, 2021
@rodmaz
Copy link

rodmaz commented Jan 14, 2021

We are facing the same issue here, using Node 15.5.1 for Linux arm64.
@markusl Node does support official distributions for ARM64 for instance.

This is the error we get:

/snap/mysnap/x1/bin/app/node_modules/aws-crt/dist/native/binding.js:60
    throw new Error("AWS CRT binary not present in any of the following locations:\n\t" + search_paths.join('\n\t'));
    ^

Error: AWS CRT binary not present in any of the following locations:
        /snap/mysnap/x1/bin/app/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
        /snap/mysnap/x1/bin/app/node_modules/aws-crt/dist/bin/linux-arm64/aws-crt-nodejs
    at Object.<anonymous> (/snap/mysnap/x1/bin/app/node_modules/aws-crt/dist/native/binding.js:60:11)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/snap/mysnap/x1/bin/app/node_modules/aws-crt/dist/native/crt.js:22:35)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)

In fact there is no native or linux-arm64 inside the aws-crt module.

drwxr-xr-x 2 root root     42 Jan 14 17:17 darwin-x64
-rw-r--r-- 1 root root 472336 Oct 26  1985 elasticurl
drwxr-xr-x 2 root root     42 Jan 14 17:17 linux-x64
-rw-r--r-- 1 root root  94612 Oct 26  1985 sha256_profile
drwxr-xr-x 2 root root     42 Jan 14 17:17 win32-x64

Anyone has a clue what is going on?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 14, 2021
@rodmaz
Copy link

rodmaz commented Jan 14, 2021

It seems my issue is due to the fact that aws-crt-nodejs does not distribute with arm architectures. 🙄
See #111

@jmklix
Copy link
Member

jmklix commented Jan 14, 2021

@rodmaz Depending on what device you're using changing to node v14 might help. The even node versions are more stable and I was able to reproduce and then fix this error previously on the raspberry pi 4. If that doesn't work can you provide more info about the device you are using?

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 14, 2021
@rodmaz
Copy link

rodmaz commented Jan 14, 2021

@jmklix We are using Raspberry Pi 3B running Ubuntu Core 18 (arm64). But the issue seems related to aws-crt-nodejs not having bidings for arm64, isn't it?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 14, 2021
@jmklix
Copy link
Member

jmklix commented Jan 15, 2021

Please try using node v14 to at least confirm that it doesn't work on the raspberry pi 3b.

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 15, 2021
@rodmaz
Copy link

rodmaz commented Jan 15, 2021

@jmklix I took another route. Decided to deploy this node package (aws-iot-device-sdk-js-v2) in a clean Ubuntu 20 LTS (arm64) distribution running on Raspberry Pi 3B. Results are no good. 🥺
We are using:

  • Node 12.18.2
  • npm 6.14.8
  • cmake 3.16.3.

The package does install successfully, but towards the end the linking step fails.

> [email protected] install /home/ubuntu/cross-compiling/node_modules/aws-crt
> node ./scripts/install.js

info TOOL Using Unix Makefiles generator.
info TOOL Building only the install target, as specified from the command line.
info CMD CONFIGURE
info TOOL Building only the install target, as specified from the command line.
info RUN cmake "/home/ubuntu/cross-compiling/node_modules/aws-crt" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="6.1.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/ubuntu/cross-compiling/node_modules/aws-crt/build/Release" -DCMAKE_JS_INC="/home/ubuntu/.cmake-js/node-arm64/v12.18.2/include/node" -DCMAKE_JS_SRC="" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="12.18.2" -DNODE_ARCH="arm64" -DCMAKE_EXPORT_COMPILE_COMMANDS="true" -DCMAKE_JS_PLATFORM="linux" -DCMAKE_JS_ARCH="arm64" -DBUILD_TESTING="OFF"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 10.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Using submodule dependencies
-- CMake 3.16.3
-- Performing Test AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS
-- Performing Test AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS - Success
-- Performing Test AWS_HAVE_MSVC_MULX
-- Performing Test AWS_HAVE_MSVC_MULX - Failed
-- Performing Test AWS_ARCH_INTEL
-- Performing Test AWS_ARCH_INTEL - Failed
-- Performing Test AWS_ARCH_ARM64
-- Performing Test AWS_ARCH_ARM64 - Success
-- Performing Test AWS_ARCH_ARM32
-- Performing Test AWS_ARCH_ARM32 - Failed
-- Performing Test AWS_HAVE_GCC_INLINE_ASM
-- Performing Test AWS_HAVE_GCC_INLINE_ASM - Success
-- Performing Test AWS_HAVE_AUXV
-- Performing Test AWS_HAVE_AUXV - Success
-- Performing Test AWS_HAVE_EXECINFO
-- Performing Test AWS_HAVE_EXECINFO - Success
-- Performing Test HAVE_M_AVX2_FLAG
-- Performing Test HAVE_M_AVX2_FLAG - Failed
-- Performing Test HAVE_AVX2_INTRINSICS
-- Performing Test HAVE_AVX2_INTRINSICS - Failed
-- Performing Test HAVE_MM256_EXTRACT_EPI64
-- Performing Test HAVE_MM256_EXTRACT_EPI64 - Failed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Performing Test HAS_MOUTLINE_ATOMICS
-- Performing Test HAS_MOUTLINE_ATOMICS - Success
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Performing Test HAS_WGNU
-- Performing Test HAS_WGNU - Failed
-- Performing Test HAVE_SYSCONF
-- Performing Test HAVE_SYSCONF - Success
-- Performing Test HAS_SANITIZERS
-- Performing Test HAS_SANITIZERS - Failed
-- Packaging currently only supported on Fedora.
-- Found LibCrypto: /usr/lib/aarch64-linux-gnu/libcrypto.a  
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.a
-- Attempting to try_compile PQ ASM
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- PQ ASM try_compile failed - using generic C code for PQ crypto
-- Performing Test S2N_HAVE_EXECINFO
-- Performing Test S2N_HAVE_EXECINFO - Success
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.a
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.a
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib:  /usr/lib/aarch64-linux-gnu/libcrypto.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/cross-compiling/node_modules/aws-crt/build

Towards the very end, the linking step fails:

gmake[2]: Leaving directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
[ 94%] Built target aws-c-auth
gmake[2]: Entering directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
Scanning dependencies of target aws-crt-nodejs
gmake[2]: Leaving directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
gmake[2]: Entering directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
[ 94%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/auth.c.o
[ 95%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/class_binder.c.o
[ 95%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/crypto.c.o
[ 95%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/http_connection.c.o
[ 96%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/http_connection_manager.c.o
[ 96%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/http_headers.c.o
[ 96%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/http_message.c.o
[ 96%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/http_stream.c.o
[ 97%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/io.c.o
[ 97%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/logger.c.o
[ 97%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/module.c.o
[ 98%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/mqtt_client.c.o
[ 98%] Building C object CMakeFiles/aws-crt-nodejs.dir/source/mqtt_client_connection.c.o
[ 98%] Linking C shared library Release/aws-crt-nodejs.node
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
(.text+0x1240): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(chacha-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/aarch64-linux-gnu/libcrypto.a(chacha-armv8.o):(.text+0x20): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_ADR_PREL_LO21 against symbol `poly1305_blocks' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): in function `poly1305_init':
(.text+0x40): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_ADR_PREL_LO21 against symbol `poly1305_emit' which may bind externally can not be used when making a shared object; recompile with -fPIC
(.text+0x48): dangerous relocation: unsupported relocation
/usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): in function `poly1305_blocks_neon':
(.text+0x26c): relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `poly1305_blocks' defined in .text section in /usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o)
/usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): in function `poly1305_emit_neon':
(.text+0x904): relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `poly1305_emit' defined in .text section in /usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o)
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
(.text+0x9a0): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/aarch64-linux-gnu/libcrypto.a(sha256-armv8.o): in function `sha256_block_data_order':
(.text+0xf88): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/aarch64-linux-gnu/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order':
(.text+0x1108): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/aws-crt-nodejs.dir/build.make:274: Release/aws-crt-nodejs.node] Error 1
gmake[2]: Leaving directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
gmake[1]: *** [CMakeFiles/Makefile2:290: CMakeFiles/aws-crt-nodejs.dir/all] Error 2
gmake[1]: Leaving directory '/home/ubuntu/cross-compiling/node_modules/aws-crt/build'
gmake: *** [Makefile:130: all] Error 2
ERR! OMG Process terminated: 2
(node:39593) UnhandledPromiseRejectionWarning: Error: Process terminated: 2
    at ChildProcess.<anonymous> (/home/ubuntu/cross-compiling/node_modules/cmake-js/lib/processHelpers.js:29:32)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
(node:39593) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39593) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 15, 2021
@rodmaz
Copy link

rodmaz commented Jan 15, 2021

Figured out the reason. The problem is due to an issue on OpenSSL libs (1.1.1f), which is by default installed on Ubuntu 20 LTS.
See openssl/openssl#10842

In order to fix this, replace OpenSSL with its newer version (1.1.1i) and rebuild the module.

@jmklix
Copy link
Member

jmklix commented Jan 16, 2021

@rodmaz sorry for pointing you in the wrong direction. Thanks for finding and sharing a fix for this on Ubuntu!

Is anyone else still having problems with the CRT binary?

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jan 16, 2021
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 5 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 5 days unless further comments are made. labels Jan 31, 2021
@github-actions github-actions bot closed this as completed Feb 3, 2021
@markusl
Copy link
Author

markusl commented Feb 7, 2021

@jmklix I followed your instructions and run the pub_sub sample on Raspberry Zero W which confirms the problem:

pi@raspberrypi:~/aws-iot-device-sdk-js-v2/samples/node/pub_sub $ node dist/index.js --endpoint xxxxx-ats.iot.eu-west-1.amazonaws.com --root-ca AmazonRootCA1.pem --cert RaspberryPiZeroW.cert.pem --key RaspberryPiZeroW.public.key 
/home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/native/binding.js:60
    throw new Error("AWS CRT binary not present in any of the following locations:\n\t" + search_paths.join('\n\t'));
    ^

Error: AWS CRT binary not present in any of the following locations:
        /home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
        /home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/bin/linux-arm/aws-crt-nodejs

@marciopamplona
Copy link

I had the same problem with Raspbian 10.8

Raspberry Pi 4 Model B Rev 1.4
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

Linux rpi4 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

After installing globally it works, surprinsingly.
# npm install -g aws-crt

@yonatangross
Copy link

yonatangross commented Jun 20, 2021

I have the same problem with Raspberry Pi 3B+:

/home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/native/binding.js:60
    throw new Error("AWS CRT binary not present in any of the following locations:\n\t" + search_paths.join('\n\t'));
    ^

Error: AWS CRT binary not present in any of the following locations:
        /home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
        /home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/bin/linux-arm/aws-crt-nodejs
    at Object.<anonymous> (/home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/native/binding.js:60:11)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/pi/aws-iot-device-sdk-js-v2/node_modules/aws-crt/dist/native/crt.js:22:35)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

I can't run the pub_sub example...

I followed exact example as described in AWS IoT

@bretambrose
Copy link
Contributor

Just a note on a closed issue: per [email protected] and [email protected] we now bundle pre-built linux aarch64 binaries. This hopefully addresses raspberry pi 4/3 issues, although the .node file path in some of the above errors does not match the way they are currently bundled (dist/bin/linux_arm64). armv7a support will be more difficult and will need to come at a later date.

@sukruavcuoglu
Copy link

sukruavcuoglu commented Jul 29, 2021

Hi @bretambrose ,
I am still getting the same error with the versions you mentioned, [email protected] and [email protected].

Is it because library is still lacking armv7 support? What am I missing?

  • root@raspberrypi:/etc/s-agent# uname -a
    Linux raspberrypi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux

  • root@raspberrypi:/etc/s-agent# uname -r
    5.10.17-v7l+

  • Here is my package.json:
    {
    "name": "some_app",
    "version": "1.0.0",
    "description": "",
    "main": "server.js",
    "scripts": {
    "start": "tsc && node dist/app.js",
    "build": "tsc",
    "dev": "concurrently --kill-others "tsc -w" "nodemon dist/server.js"",
    "test": "jest --verbose --config=jest.config.test.js --detectOpenHandles",
    "lint": "eslint . && echo 'Lint complete.'",
    "lint-fix": "eslint . --fix --ext .js"
    },
    "author": "me",
    "dependencies": {
    "@types/node": "^16.0.0",
    "typescript": "4.3.5",
    "uuid": "^3.3.2",
    "@types/uuid": "^8.3.1",
    "node-os-utils": "^1.3.5",
    "@types/node-os-utils": "^1.2.0",
    "mqtt": "^4.2.8",
    "aws-iot-device-sdk-v2": "^1.5.5",
    "node-uname": "^3.0.4",
    "@babel/core": "^7.14.6",
    "@babel/preset-env": "^7.14.7",
    "@babel/preset-typescript": "^7.14.5",
    "@types/aws-lambda": "^8.10.77"
    },
    "devDependencies": {
    "@types/jest": "^26.0.23",
    "babel-jest": "^27.0.6",
    "jest": "^27.0.6",
    "eslint": "^7.24.0",
    "eslint-config-prettier": "^8.2.0",
    "eslint-plugin-mocha": "^8.1.0",
    "eslint-plugin-prettier": "^3.4.0",
    "prettier": "^2.2.1",
    "ts-jest": "^27.0.3",
    "sinon": "^11.1.1",
    "@types/sinon": "^10.0.2",
    "chai": "^4.3.4",
    "@types/chai": "^4.2.21",
    "@types/lodash": "^4.14.171"
    }
    }

  • "npm install" successfully installs all packages without building aws-crt from source, which is great!

  • If I run "npm run start" I still get this error:
    root@raspberrypi:/etc/s-agent# sudo npm run start

[email protected] start /etc/s-agent
tsc && node dist/app.js

/etc/s-agent/node_modules/aws-crt/dist/native/binding.js:60
throw new Error("AWS CRT binary not present in any of the following locations:\n\t" + search_paths.join('\n\t'));
^

Error: AWS CRT binary not present in any of the following locations:
/etc/s-agent/node_modules/aws-crt/dist/bin/native/aws-crt-nodejs
/etc/s-agent/node_modules/aws-crt/dist/bin/linux-arm/aws-crt-nodejs
at Object. (/etc/s-agent/node_modules/aws-crt/dist/native/binding.js:60:11)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/etc/s-agent/node_modules/aws-crt/dist/native/crt.js:22:35)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

  • root@raspberrypi:/etc/s-agent# ls node_modules/aws-crt/dist/bin/
    darwin-x64 linux-arm64 linux-x64 sha256_profile win32-x64

@bretambrose
Copy link
Contributor

bretambrose commented Jul 29, 2021

Well only armv8 binaries have been added, so in this case armv7 is still going to fail and you'd need to do a full build of the crt and copy it over yourself. The thing holding back armv7 (and v6) binaries is finding a good docker image that has a sufficiently old glibc on it so that we don't get glibc version mismatches. We use the manylinux2014 images for all of the other builds since its glibc is 2.17, but it doesn't have an armv7 image (just a tag) and the best thing we've found so far is something with 2.24 I think.

@sukruavcuoglu
Copy link

Thanks for the answer @bretambrose :)
For my case I solved the issue by installing a 64bit OS version on Raspberry Pi4. I had Rasbian OS 32bit before since Rasbian does not have an official 64bit version (still in beta). That's why I have installed Ubuntu Core 64bit version and it is working just fine now.
Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days.
Projects
None yet
Development

No branches or pull requests

9 participants