grpc / grpc/grpc-node

grpc_tools_node_protoc in grpc-tools@1.7.0 fails with ENOENT

Open
#744 9 comments 8 reactions 0 assignees View on GitHub
package: grpc-tools
Dominant language
TypeScript
Stars
4.8k
Forks
716
Avg merge
2d 3h
Merged PRs (30d)
10

Description

### Problem description
When trying to run `protoc` from the `grpc-tools@1.7.0` package on linux, it fails with "No such file or directory".

This also manifests as `ENOENT` when trying to run `grpc_tools_node_protoc`:
```
# ./node_modules/.bin/grpc_tools_node_protoc
/toolstest/node_modules/grpc-tools/bin/protoc.js:41
throw error;
^

Error: spawn /toolstest/node_modules/grpc-tools/bin/protoc ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
at onErrorNT (internal/child_process.js:427:16)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:51:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:804:11)
at internal/main/run_main_module.js:21:11
```

From what I can tell, this is due to the `protoc` executable being a 32-bit binary in 1.7.0, whereas it was a 64-bit binary in 1.6.6:
```
$ npm install grpc-tools@1.6.6 && file node_modules/grpc-tools/bin/protoc
node_modules/grpc-tools/bin/protoc: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=1b2e70e2faad598dfc7849be2c4bd1e11190dde7, stripped

$ npm install grpc-tools@1.7.0 && file node_modules/grpc-tools/bin/protoc
node_modules/grpc-tools/bin/protoc: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d2f865292439a6ba1bdf92921b0961c147916f01, not stripped
```

### Reproduction steps
(run on macos via docker. similarly reproducible on linux.)
```
$ docker run --rm -it node /bin/bash
root:/# mkdir toolstest && cd toolstest/
root:/# npm install grpc-tools@1.7.0
root:/# npx grpc_tools_node_protoc --version
spawn /toolstest/node_modules/grpc-tools/bin/protoc ENOENT
```

### Environment
- OS name, version and architecture: Ubuntu 16.04.5 LTS(xenial), and also reproducible on the node docker image mentioned above
- Node version: 8.12.0 and 11.10.0
- Node installation method: nvm and node docker image
- Package name and version: grpc-tools@1.7.0

### Additional context
Here is the post that led me to believe this is related to the 64-bit/32-bit change: https://askubuntu.com/a/133460

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.