Code Monkey home page Code Monkey logo

grpc-node's Introduction

Build Status

gRPC on Node.js

Implementations

For a comparison of the features available in these two libraries, see this document

Pure JavaScript Client and Server

Directory: packages/grpc-js

npm package: @grpc/grpc-js

This library implements the core functionality of gRPC purely in JavaScript, without a C++ addon. It works on the latest versions of Node.js on all platforms that Node.js runs on.

C-based Client and Server (deprecated)

Directory: packages/grpc-native-core (lives in the [email protected] branch) (see here for installation information)

npm package: grpc.

This is the deprecated implementation of gRPC using a C++ addon. It works on versions of Node.js up to 14 on most platforms that Node.js runs on.

Other Packages

gRPC Protobuf Loader

Directory: packages/proto-loader

npm package: @grpc/proto-loader

This library loads .proto files into objects that can be passed to the gRPC libraries.

gRPC Tools

Directory: packages/grpc-tools

npm package: grpc-tools

Distribution of protoc and the gRPC Node protoc plugin for ease of installation with npm.

gRPC Health Check Service

Directory: packages/grpc-health-check

npm package: grpc-health-check

Health check service for gRPC servers.

gRPC Reflection API Service

Directory: packages/grpc-reflection

npm package: @grpc/reflection

Reflection API service for gRPC servers.

grpc-node's People

Contributors

alexander-fenster avatar b0b3rt avatar badsyntax avatar cjihrig avatar crevil avatar ctiller avatar dgquintas avatar hiepthai avatar jackofmosttrades avatar jboeuf avatar jtattermusch avatar jtimmons avatar justinbeckwith avatar kjin avatar kpayson64 avatar lunatk avatar matt-kwong avatar merlinnot avatar mrfelton avatar murgatroid99 avatar n0v1 avatar nicolasnoble avatar patrick-remy avatar sergiitk avatar shahidhs-ibm avatar sreecha avatar stanley-cheung avatar tbetbetbe avatar wkchee avatar yang-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpc-node's Issues

Switch to `gts` instead of `google-ts-style`

We renamed the module to gts. The configuration has been synced up to be closer to what is used internally. I would recommend switching to it. Beware that it includes more lint rules than before (but gts fix should make it easy to fix the new lint errors caught by the tool).

windows versions are missing

I have a node app that deploys to Windows Azure, it uses the googleapis and therefore the grpc, deployment on this environment has been working up until a few days ago and not deployment fails because node-pre-gyp cannot download pre-compiled versions of the file. I tried it with node 8.9.0 and it didn't work, I dialed it back to 8.0.0 as this was the last one that worked and it doesn't work either.

it doesn't work on my dev machine either, on node 9.2.0, windows 10, and this was working fine on 9.0.0 just a few days ago.

currently from azure instance forcing 8.0.0 it throws

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.6.6/node-v11-win32-ia32.tar.gz 

node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v11 ABI) (falling back to source compile with node-gyp) 

any pointers on how to fix this?

Release cadence of other grpc packages

Would it be possible to release new versions of the tooling packages like grpc-tools and grpc-health-check with the latest releases? Or do they follow another release cadence?

'Stream removed' with GRPC 1.8.0

node main.js fail due to grpc

I am trying to test blockchain benchmark using caliper tool but i faced create channel error due to grpc fail

#node main.js

__dirname: /opt/caliper/src/fabric: caRootsPath: network/fabric/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
channels: before new Client creation
# create channel......
org name1: org1
org name5: org1
org name5: org1
channel is success1
E1211 19:39:24.820579917  106870 ssl_transport_security.c:970] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
error: [Orderer.js]: sendBroadcast - on error: "Error: Connect Failed\n    at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:255:19)\n    at ClientDuplexStream._readsDone (/opt/caliper/node_modules/grpc/src/client.js:221:8)\n    at readCallback (/opt/caliper/node_modules/grpc/src/client.js:283:12)"
channel is success2
not ok 1 Failed to create channels Error: SERVICE_UNAVAILABLE at ClientDuplexStream.<anonymous> (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12) at ClientDuplexStream._readsDone (/opt/caliper/node_modules/grpc/src/client.js:221:8) at readCallback (/opt/caliper/node_modules/grpc/src/client.js:283:12)
  ---
    operator: fail
    at: channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:171:19)
    stack: |-
      Error: Failed to create channels Error: SERVICE_UNAVAILABLE
          at ClientDuplexStream.<anonymous> (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21)
          at emitOne (events.js:96:13)
          at ClientDuplexStream.emit (events.js:188:7)
          at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12)
          at ClientDuplexStream._readsDone (/opt/caliper/node_modules/grpc/src/client.js:221:8)
          at readCallback (/opt/caliper/node_modules/grpc/src/client.js:283:12)
          at Test.assert [as _assert] (/opt/caliper/node_modules/tape/lib/test.js:212:54)
          at Test.bound [as _assert] (/opt/caliper/node_modules/tape/lib/test.js:64:32)
          at Test.fail (/opt/caliper/node_modules/tape/lib/test.js:277:10)
          at Test.bound [as fail] (/opt/caliper/node_modules/tape/lib/test.js:64:32)
          at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:171:19)
          at process._tickCallback (internal/process/next_tick.js:103:7)
  ...
fabric.init() failed, Error: Fabric: Create channel failed
    at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:173:31)
    at process._tickCallback (internal/process/next_tick.js:103:7)
unexpected error, Error: Fabric: Create channel failed
    at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:173:31)
    at process._tickCallback (internal/process/next_tick.js:103:7)

1..1
# tests 1
# pass  0
# fail  1

Determine if the bundled dependency on node-pre-gyp can be removed in 2.0

For the grpc 2.0 package, we plan to drop support for Node 4, 5, and 7. At the same time, we may be able to easily change the minimum version of npm we require. When we do so, we should re-evaluate whether the original reasons for bundling the dependency on node-pre-gyp still apply.

As grpc/grpc#12798 demonstrates, there are some risks involved in pinning the version of the dependency by bundling it.

GRPC Node Compression

Any idea on when compression is added to the grpc-node?
or if it is already supported, any example on how to set it in Server and Client?
thank you

cannot build on FreeBSD

(in case you will think "some guy just keeps posting about my app not building on abandonware" - I really have no live/decent Linuxes there, so please don't think it's some kind of trolling - it's not)

gcc:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc5/gcc/x86_64-portbld-freebsd11.0/5.4.0/lto-wrapper
Target: x86_64-portbld-freebsd11.0
Configured with: /wrkdirs/usr/ports/lang/gcc/work/gcc-5.4.0/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc5 --libexecdir=/usr/local/libexec/gcc5 --program-suffix=5 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc5/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/gcc5 --build=x86_64-portbld-freebsd11.0
Thread model: posix
gcc version 5.4.0 (FreeBSD Ports Collection)
> npm install grpc

> [email protected] install /usr/home/emz/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v51-freebsd-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI, unknown) (falling back to source compile with node-gyp)
gmake: ะฒั…ะพะด ะฒ ะบะฐั‚ะฐะปะพะณ ยซ/usr/home/emz/node_modules/grpc/buildยป
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
[...]
  CXX(target) Release/obj.target/gpr/deps/grpc/src/core/lib/support/tmpfile_windows.o
  CXX(target) Release/obj.target/gpr/deps/grpc/src/core/lib/support/wrap_memcpy.o
  AR(target) Release/obj.target/libgpr.a
  COPY Release/libgpr.a
  CXX(target) Release/obj.target/grpc_node/ext/byte_buffer.o
c++: error: unknown argument: '-zdefs'
gmake: *** [grpc_node.target.mk:158: Release/obj.target/grpc_node/ext/byte_buffer.o] ะžัˆะธะฑะบะฐ 1
gmake: ะฒั‹ั…ะพะด ะธะท ะบะฐั‚ะฐะปะพะณะฐ ยซ/usr/home/emz/node_modules/grpc/buildยป
gyp ERR! build error
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System FreeBSD 11.0-RELEASE-p5
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown"
gyp ERR! cwd /usr/home/emz/node_modules/grpc
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/home/emz/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System FreeBSD 11.0-RELEASE-p5
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/home/emz/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/home/emz/node_modules/grpc
node-pre-gyp ERR! node -v v7.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/usr/home/emz/node_modules/grpc/src/node/extension_binary/node-v51-freebsd-x64-unknown' (1)
npm WARN enoent ENOENT: no such file or directory, open '/usr/home/emz/package.json'
npm WARN emz No description
npm WARN emz No repository field.
npm WARN emz No README data
npm WARN emz No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/emz/.npm/_logs/2017-12-21T17_56_18_305Z-debug.log

[email protected] -- cannot read property 'name' of null

We are seeing this error with [email protected]. It looks like arguejs may have some difficulty resolving the argument order inside makeUnaryRequest.

"TypeError: Cannot read property 'name' of null
    at (/srv/www/link/releases/20171219165514/node_modules/plaid-escalate client/node_modules/grpc/node_modules/arguejs/argue.js:117:46)
    at ServiceClient.Client.makeUnaryRequest (/srv/www/link/releases/20171219165514/node_modules/plaid-escalate-client/node_modules/grpc/src/client.js:507:14)
    at apply (/srv/www/link/releases/20171219165514/node_modules/plaid-escalate-client/node_modules/grpc/node_modules/lodash/lodash.js:499:17)
    at ServiceClient.wrapper (/srv/www/link/releases/20171219165514/node_modules/plaid-escalate-client/node_modules/grpc/node_modules/lodash/lodash.js:5356:16)

It seems like this is a known issue with arguejs: zvictor/ArgueJS#23.
The "bug" is just that it does an invalid dereference before it can throw a more useful error. If you change the problem line there to print out "foobar" instead of throwing a NPE, we end up with something like this:

"Error: Incompatible type signature. Expecting ( String, Function, Function, foobar, [Metadata], [Object], Function ), given ( String, Function, Function, Object, Object, Object, Function )

It seems like this is still an "irrecoverable error" type scenario, though.

here is how we are creating the client (typescript)

const root = new $protobufjs.Root();
root.resolvePath = (origin, target) =>
  path.resolve(PATH_TO_PROTO) + '/' + target;
root.loadSync(GRPC_SERVICE_DEFINITION', {
  keepCase: true,
});

const proto = grpc.loadObject(root, {
  enumsAsStrings: false,
  protobufjsVersion: 6,
});

We implement a custom promisification wrapper around the grpc prototype... at the end of the day it looks something like:

function grpcUnaryPromisifier(func: grpc.Request): any {
  // tslint:disable-next-line only-arrow-functions
  return async function promisified(
    // The argument to use
    argument: any,

    // The grpc metadata object, if undefined -- grpc will default to creation
    // of new metadata.
    metadata?: grpc.Metadata,

    // Options for this rpc
    options: grpc.CallOptions = ({} as grpc.CallOptions),
  ): P<any> {
    if (metadata == null) {
      metadata = new grpc.Metadata();
    }

    // tslint:disable no-invalid-this
    const self: EscalateClientInternal = this;
    // tslint:enable no-invalid-this

    // Populate default values into the options.
    options = R.merge({
      deadline: Date.now() + DEFAULT_TIMEOUT_MS,
    }, options);

    // do some logging, retry with exponential backoff, etc.
    try {
      const result = await P.fromCallback(cb => func.call(
            self, argument, metadata, options, cb));
    } catch (e) {
      // log and retthrow
    }

   // return the result
}

This all works fine and dandy with the client using 1.7.3...

     const metadata = new grpc.Metadata();

     if (typeof context.requestId === 'string') {
       metadata.set('request_id', context.requestId);
     }

     plaidGrpcService.client()
     .nameOfPromisifiedMethodAsync(requestObject, metadata, {
       deadline: plaidGrpcService.defaultDeadline(),
     })
     .then(res => {
       // business logic.
     })

I initially thought that there was some problem because the calling service was using [email protected] despite the client using [email protected]. Since npm does not flatten dependencies, this should be a valid use case.

The problem first arose when we were passing a grpc.Metadata that was created by 1.8.0 to this client implementation using 1.7.3. To test whether this is the problem, I tried changing both the calling service and the client to use [email protected] and this issue persists. With both the service and the client using 1.7.3, there is no issue. I have not tested what happens when the client uses 1.8.0 and the service uses 1.7.3.

Based upon the error I was able to coerce out of arguejs, it looks as if it is not recognizing that the Object passed in is actually a Metadata. Why this would be, I am not sure. Note that the version of arguejs that grpc uses is constant between 1.7.3 and 1.8.0.

I looked at the diff between v1.7.3 and v1.8.0 and it seems fairly innocuous, so I am rather at a loss here.

Help would be appreciated.

Error in [email protected] install script while installing firebase-admin in Windows 10

When I try to install firebase-admin on my Windows 10 OS, it causes so many errors in compiling c files and at the end it says:

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--msvs_version=2015" "firebase-admin" "--save"
npm ERR! node v6.12.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

I attached the log file.
npm-debug.log

License problem with `node-pre-gyp`

grpc depends on node-pre-gyp and it has a transitive dependency, jsonify, whose license is "Public Domain". "Public Domain" is not a valid license for Google.

This issue blocks googleapis/google-cloud-node#2785.

We need to either get an explicit approval for that package or remove the dependency.

The dependency chain is like this:

Download grpc-node got 403

Short description:
npm info lifecycle [email protected]~install: [email protected]

[email protected] install /usr/src/app/node_modules/google-gax/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp info check checked for "/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl/grpc_node.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.3/node-v48-linux-x64-musl.tar.gz
node-pre-gyp http 403 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.3/node-v48-linux-x64-musl.tar.gz
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.3/node-v48-linux-x64-musl.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI, musl) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.3/node-v48-linux-x64-musl.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:449:14)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:353:11
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 3.13.0-37-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl"
gyp ERR! cwd /usr/src/app/node_modules/google-gax/node_modules/grpc
gyp ERR! node -v v6.12.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/src/app/node_modules/google-gax/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:920:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
node-pre-gyp ERR! System Linux 3.13.0-37-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/google-gax/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/src/app/node_modules/google-gax/node_modules/grpc
node-pre-gyp ERR! node -v v6.12.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/usr/src/app/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-musl' (1)
npm info lifecycle [email protected]~install: Failed to exec install script

cannot build on Solaris 11

Via npm install:

[emz@hyperion ~]$ npm install grpc

> [email protected] install /home/emz/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-sunos-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
make: ะ’ั…ะพะด ะฒ ะบะฐั‚ะฐะปะพะณ `/home/emz/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
In file included from ../deps/grpc/include/grpc/support/port_platform.h:22:0,
                 from ../deps/grpc/src/core/lib/surface/init.cc:19:
../deps/grpc/include/grpc/impl/codegen/port_platform.h:296:2: error: #error "Could not auto-detect platform"
 #error "Could not auto-detect platform"
  ^
../deps/grpc/include/grpc/impl/codegen/port_platform.h:328:2: error: #warning "GPR_PLATFORM_STRING not auto-detected" [-Werror=cpp]
 #warning "GPR_PLATFORM_STRING not auto-detected"
  ^
In file included from ../deps/grpc/include/grpc/support/port_platform.h:22:0,
                 from ../deps/grpc/src/core/lib/surface/init.cc:19:
../deps/grpc/include/grpc/impl/codegen/port_platform.h:378:2: error: #error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WINDOWS_ATOMIC
 #error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WINDOWS_ATOMIC
  ^
../deps/grpc/include/grpc/impl/codegen/port_platform.h:382:2: error: #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
 #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
  ^
../deps/grpc/include/grpc/impl/codegen/port_platform.h:388:2: error: #error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
 #error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
  ^
../deps/grpc/include/grpc/impl/codegen/port_platform.h:394:2: error: #error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_CUSTOM_TLS
 #error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_CUSTOM_TLS
  ^
In file included from ../deps/grpc/include/grpc/impl/codegen/sync_generic.h:23:0,
                 from ../deps/grpc/include/grpc/impl/codegen/sync.h:46,
                 from ../deps/grpc/include/grpc/support/sync.h:23,
                 from ../deps/grpc/include/grpc/slice.h:23,
                 from ../deps/grpc/include/grpc/slice_buffer.h:22,
                 from ../deps/grpc/include/grpc/byte_buffer.h:23,
                 from ../deps/grpc/include/grpc/grpc.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:25:
../deps/grpc/include/grpc/impl/codegen/atm.h:79:2: error: #error could not determine platform for atm
 #error could not determine platform for atm
  ^
In file included from ../deps/grpc/include/grpc/support/sync.h:23:0,
                 from ../deps/grpc/include/grpc/slice.h:23,
                 from ../deps/grpc/include/grpc/slice_buffer.h:22,
                 from ../deps/grpc/include/grpc/byte_buffer.h:23,
                 from ../deps/grpc/include/grpc/grpc.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:25:
../deps/grpc/include/grpc/impl/codegen/sync.h:55:2: error: #error Unable to determine platform for sync
 #error Unable to determine platform for sync
  ^
In file included from ../deps/grpc/include/grpc/impl/codegen/sync_generic.h:23:0,
                 from ../deps/grpc/include/grpc/impl/codegen/sync.h:46,
                 from ../deps/grpc/include/grpc/support/sync.h:23,
                 from ../deps/grpc/include/grpc/slice.h:23,
                 from ../deps/grpc/include/grpc/slice_buffer.h:22,
                 from ../deps/grpc/include/grpc/byte_buffer.h:23,
                 from ../deps/grpc/include/grpc/grpc.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:25:
../deps/grpc/include/grpc/impl/codegen/atm.h:88:1: error: โ€˜gpr_atmโ€™ does not name a type
 gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
 ^
In file included from ../deps/grpc/include/grpc/impl/codegen/sync.h:46:0,
                 from ../deps/grpc/include/grpc/support/sync.h:23,
                 from ../deps/grpc/include/grpc/slice.h:23,
                 from ../deps/grpc/include/grpc/slice_buffer.h:22,
                 from ../deps/grpc/include/grpc/byte_buffer.h:23,
                 from ../deps/grpc/include/grpc/grpc.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:25:
../deps/grpc/include/grpc/impl/codegen/sync_generic.h:27:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm state;
   ^
../deps/grpc/include/grpc/impl/codegen/sync_generic.h:35:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm count;
   ^
../deps/grpc/include/grpc/impl/codegen/sync_generic.h:40:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm value;
   ^
In file included from ../deps/grpc/include/grpc/slice.h:23:0,
                 from ../deps/grpc/include/grpc/slice_buffer.h:22,
                 from ../deps/grpc/include/grpc/byte_buffer.h:23,
                 from ../deps/grpc/include/grpc/grpc.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:25:
../deps/grpc/include/grpc/support/sync.h:37:25: error: variable or field โ€˜gpr_mu_initโ€™ declared void
 GPRAPI void gpr_mu_init(gpr_mu* mu);
                         ^
../deps/grpc/include/grpc/support/sync.h:37:25: error: โ€˜gpr_muโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:37:33: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI void gpr_mu_init(gpr_mu* mu);
                                 ^
../deps/grpc/include/grpc/support/sync.h:41:28: error: variable or field โ€˜gpr_mu_destroyโ€™ declared void
 GPRAPI void gpr_mu_destroy(gpr_mu* mu);
                            ^
../deps/grpc/include/grpc/support/sync.h:41:28: error: โ€˜gpr_muโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:41:36: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI void gpr_mu_destroy(gpr_mu* mu);
                                    ^
../deps/grpc/include/grpc/support/sync.h:46:25: error: variable or field โ€˜gpr_mu_lockโ€™ declared void
 GPRAPI void gpr_mu_lock(gpr_mu* mu);
                         ^
../deps/grpc/include/grpc/support/sync.h:46:25: error: โ€˜gpr_muโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:46:33: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI void gpr_mu_lock(gpr_mu* mu);
                                 ^
../deps/grpc/include/grpc/support/sync.h:50:27: error: variable or field โ€˜gpr_mu_unlockโ€™ declared void
 GPRAPI void gpr_mu_unlock(gpr_mu* mu);
                           ^
../deps/grpc/include/grpc/support/sync.h:50:27: error: โ€˜gpr_muโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:50:35: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI void gpr_mu_unlock(gpr_mu* mu);
                                   ^
../deps/grpc/include/grpc/support/sync.h:56:27: error: โ€˜gpr_muโ€™ was not declared in this scope
 GPRAPI int gpr_mu_trylock(gpr_mu* mu);
                           ^
../deps/grpc/include/grpc/support/sync.h:56:35: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI int gpr_mu_trylock(gpr_mu* mu);
                                   ^
../deps/grpc/include/grpc/support/sync.h:65:25: error: variable or field โ€˜gpr_cv_initโ€™ declared void
 GPRAPI void gpr_cv_init(gpr_cv* cv);
                         ^
../deps/grpc/include/grpc/support/sync.h:65:25: error: โ€˜gpr_cvโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:65:33: error: โ€˜cvโ€™ was not declared in this scope
 GPRAPI void gpr_cv_init(gpr_cv* cv);
                                 ^
../deps/grpc/include/grpc/support/sync.h:69:28: error: variable or field โ€˜gpr_cv_destroyโ€™ declared void
 GPRAPI void gpr_cv_destroy(gpr_cv* cv);
                            ^
../deps/grpc/include/grpc/support/sync.h:69:28: error: โ€˜gpr_cvโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:69:36: error: โ€˜cvโ€™ was not declared in this scope
 GPRAPI void gpr_cv_destroy(gpr_cv* cv);
                                    ^
../deps/grpc/include/grpc/support/sync.h:78:24: error: โ€˜gpr_cvโ€™ was not declared in this scope
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                        ^
../deps/grpc/include/grpc/support/sync.h:78:32: error: โ€˜cvโ€™ was not declared in this scope
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                                ^
../deps/grpc/include/grpc/support/sync.h:78:36: error: โ€˜gpr_muโ€™ was not declared in this scope
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                                    ^
../deps/grpc/include/grpc/support/sync.h:78:44: error: โ€˜muโ€™ was not declared in this scope
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                                            ^
../deps/grpc/include/grpc/support/sync.h:78:61: error: expected primary-expression before โ€˜abs_deadlineโ€™
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                                                             ^
../deps/grpc/include/grpc/support/sync.h:78:73: error: expression list treated as compound expression in initializer [-fpermissive]
 GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
                                                                         ^
../deps/grpc/include/grpc/support/sync.h:84:27: error: variable or field โ€˜gpr_cv_signalโ€™ declared void
 GPRAPI void gpr_cv_signal(gpr_cv* cv);
                           ^
../deps/grpc/include/grpc/support/sync.h:84:27: error: โ€˜gpr_cvโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:84:35: error: โ€˜cvโ€™ was not declared in this scope
 GPRAPI void gpr_cv_signal(gpr_cv* cv);
                                   ^
../deps/grpc/include/grpc/support/sync.h:87:30: error: variable or field โ€˜gpr_cv_broadcastโ€™ declared void
 GPRAPI void gpr_cv_broadcast(gpr_cv* cv);
                              ^
../deps/grpc/include/grpc/support/sync.h:87:30: error: โ€˜gpr_cvโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:87:38: error: โ€˜cvโ€™ was not declared in this scope
 GPRAPI void gpr_cv_broadcast(gpr_cv* cv);
                                      ^
../deps/grpc/include/grpc/support/sync.h:100:27: error: variable or field โ€˜gpr_once_initโ€™ declared void
 GPRAPI void gpr_once_init(gpr_once* once, void (*init_routine)(void));
                           ^
../deps/grpc/include/grpc/support/sync.h:100:27: error: โ€˜gpr_onceโ€™ was not declared in this scope
../deps/grpc/include/grpc/support/sync.h:100:37: error: โ€˜onceโ€™ was not declared in this scope
 GPRAPI void gpr_once_init(gpr_once* once, void (*init_routine)(void));
                                     ^
../deps/grpc/include/grpc/support/sync.h:100:50: error: โ€˜init_routineโ€™ was not declared in this scope
 GPRAPI void gpr_once_init(gpr_once* once, void (*init_routine)(void));
                                                  ^
../deps/grpc/include/grpc/support/sync.h:100:64: error: expected primary-expression before โ€˜voidโ€™
 GPRAPI void gpr_once_init(gpr_once* once, void (*init_routine)(void));
                                                                ^
../deps/grpc/include/grpc/support/sync.h:283:18: error: expected โ€˜)โ€™ before โ€˜*โ€™ token
   mu_guard(gpr_mu* mu) : mu_(mu) { gpr_mu_lock(mu); }
                  ^
../deps/grpc/include/grpc/support/sync.h:290:3: error: โ€˜gpr_muโ€™ does not name a type
   gpr_mu* const mu_;
   ^
../deps/grpc/include/grpc/support/sync.h: In destructor โ€˜grpc_core::mu_guard::~mu_guard()โ€™:
../deps/grpc/include/grpc/support/sync.h:284:31: error: โ€˜mu_โ€™ was not declared in this scope
   ~mu_guard() { gpr_mu_unlock(mu_); }
                               ^
../deps/grpc/include/grpc/support/sync.h:284:34: error: โ€˜gpr_mu_unlockโ€™ was not declared in this scope
   ~mu_guard() { gpr_mu_unlock(mu_); }
                                  ^
In file included from ../deps/grpc/src/core/lib/iomgr/closure.h:31:0,
                 from ../deps/grpc/src/core/lib/iomgr/call_combiner.h:26,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:43,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/support/mpscq.h: At global scope:
../deps/grpc/src/core/lib/support/mpscq.h:38:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm next;
   ^
../deps/grpc/src/core/lib/support/mpscq.h:43:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm head;
   ^
../deps/grpc/src/core/lib/support/mpscq.h:68:3: error: โ€˜gpr_muโ€™ does not name a type
   gpr_mu mu;
   ^
In file included from ../deps/grpc/src/core/lib/iomgr/call_combiner.h:27:0,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:43,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:31:9: error: โ€˜gpr_atmโ€™ does not name a type
 typedef gpr_atm grpc_millis;
         ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:80:3: error: โ€˜grpc_millisโ€™ does not name a type
   grpc_millis now;
   ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:121:1: error: โ€˜grpc_millisโ€™ does not name a type
 grpc_millis grpc_exec_ctx_now(grpc_exec_ctx* exec_ctx);
 ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:123:38: error: โ€˜grpc_millisโ€™ was not declared in this scope
 gpr_timespec grpc_millis_to_timespec(grpc_millis millis, gpr_clock_type clock);
                                      ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:123:73: error: expected primary-expression before โ€˜clockโ€™
 gpr_timespec grpc_millis_to_timespec(grpc_millis millis, gpr_clock_type clock);
                                                                         ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:124:1: error: โ€˜grpc_millisโ€™ does not name a type
 grpc_millis grpc_timespec_to_millis_round_down(gpr_timespec timespec);
 ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:125:1: error: โ€˜grpc_millisโ€™ does not name a type
 grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec timespec);
 ^
In file included from ../deps/grpc/src/core/lib/channel/channel_stack.h:43:0,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/iomgr/call_combiner.h:46:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm size;  // size_t, num closures in queue or currently executing
   ^
../deps/grpc/src/core/lib/iomgr/call_combiner.h:51:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm cancel_state;
   ^
In file included from ../deps/grpc/src/core/lib/iomgr/polling_entity.h:22:0,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:44,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/iomgr/pollset.h:46:47: error: โ€˜gpr_muโ€™ has not been declared
 void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu);
                                               ^
../deps/grpc/src/core/lib/iomgr/pollset.h:77:31: error: โ€˜grpc_millisโ€™ has not been declared
                               grpc_millis deadline) GRPC_MUST_USE_RESULT;
                               ^
In file included from ../deps/grpc/src/core/lib/transport/transport.h:32:0,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:46,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/transport/metadata_batch.h:56:3: error: โ€˜grpc_millisโ€™ does not name a type
   grpc_millis deadline;
   ^
In file included from ../deps/grpc/src/core/lib/channel/channel_stack.h:46:0,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/transport/transport.h:156:5: error: โ€˜gpr_atmโ€™ does not name a type
     gpr_atm* peer_string;
     ^
../deps/grpc/src/core/lib/transport/transport.h:183:5: error: โ€˜gpr_atmโ€™ does not name a type
     gpr_atm* peer_string;
     ^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:29:0:
../deps/grpc/src/core/lib/channel/channel_stack.h:73:3: error: โ€˜grpc_millisโ€™ does not name a type
   grpc_millis deadline;
   ^
In file included from ../deps/grpc/src/core/lib/channel/handshaker_factory.h:24:0,
                 from ../deps/grpc/src/core/lib/channel/handshaker_registry.h:24,
                 from ../deps/grpc/src/core/lib/surface/init.cc:31:
../deps/grpc/src/core/lib/channel/handshaker.h:152:5: error: โ€˜grpc_millisโ€™ has not been declared
     grpc_millis deadline, grpc_tcp_server_acceptor* acceptor,
     ^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:32:0:
../deps/grpc/src/core/lib/debug/stats.h:31:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm counters[GRPC_STATS_COUNTER_COUNT];
   ^
../deps/grpc/src/core/lib/debug/stats.h:32:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm histograms[GRPC_STATS_HISTOGRAM_BUCKETS];
   ^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:47:0:
../deps/grpc/src/core/lib/surface/call.h:52:3: error: โ€˜grpc_millisโ€™ does not name a type
   grpc_millis send_deadline;
   ^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:53:0:
../deps/grpc/src/core/lib/transport/bdp_estimator.h:76:3: error: โ€˜grpc_millisโ€™ does not name a type
   grpc_millis CompletePing(grpc_exec_ctx* exec_ctx);
   ^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:54:0:
../deps/grpc/src/core/lib/transport/connectivity_state.h:41:3: error: โ€˜gpr_atmโ€™ does not name a type
   gpr_atm current_state_atm;
   ^
../deps/grpc/src/core/lib/surface/init.cc:62:8: error: โ€˜gpr_onceโ€™ does not name a type
 static gpr_once g_basic_init = GPR_ONCE_INIT;
        ^
../deps/grpc/src/core/lib/surface/init.cc:63:8: error: โ€˜gpr_muโ€™ does not name a type
 static gpr_mu g_init_mu;
        ^
../deps/grpc/src/core/lib/surface/init.cc: In function โ€˜void do_basic_init()โ€™:
../deps/grpc/src/core/lib/surface/init.cc:69:16: error: โ€˜g_init_muโ€™ was not declared in this scope
   gpr_mu_init(&g_init_mu);
                ^
../deps/grpc/src/core/lib/surface/init.cc:69:25: error: โ€˜gpr_mu_initโ€™ was not declared in this scope
   gpr_mu_init(&g_init_mu);
                         ^
../deps/grpc/src/core/lib/surface/init.cc: In function โ€˜void grpc_init()โ€™:
../deps/grpc/src/core/lib/surface/init.cc:124:18: error: โ€˜g_basic_initโ€™ was not declared in this scope
   gpr_once_init(&g_basic_init, do_basic_init);
                  ^
../deps/grpc/src/core/lib/surface/init.cc:124:45: error: โ€˜gpr_once_initโ€™ was not declared in this scope
   gpr_once_init(&g_basic_init, do_basic_init);
                                             ^
In file included from ../deps/grpc/src/core/lib/iomgr/call_combiner.h:27:0,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:43,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:89:3: error: too many initializers for โ€˜grpc_exec_ctxโ€™
   }
   ^
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:94:3: note: in expansion of macro โ€˜GRPC_EXEC_CTX_INITIALIZERโ€™
   GRPC_EXEC_CTX_INITIALIZER(GRPC_EXEC_CTX_FLAG_IS_FINISHED, NULL, NULL)
   ^
../deps/grpc/src/core/lib/surface/init.cc:126:28: note: in expansion of macro โ€˜GRPC_EXEC_CTX_INITโ€™
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
                            ^
../deps/grpc/src/core/lib/surface/init.cc:127:16: error: โ€˜g_init_muโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                ^
../deps/grpc/src/core/lib/surface/init.cc:127:25: error: โ€˜gpr_mu_lockโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                         ^
../deps/grpc/src/core/lib/surface/init.cc:154:27: error: โ€˜gpr_mu_unlockโ€™ was not declared in this scope
   gpr_mu_unlock(&g_init_mu);
                           ^
In file included from ../deps/grpc/src/core/lib/iomgr/call_combiner.h:27:0,
                 from ../deps/grpc/src/core/lib/channel/channel_stack.h:43,
                 from ../deps/grpc/src/core/lib/surface/init.cc:29:
../deps/grpc/src/core/lib/surface/init.cc: In function โ€˜void grpc_shutdown()โ€™:
../deps/grpc/src/core/lib/iomgr/exec_ctx.h:89:3: error: too many initializers for โ€˜grpc_exec_ctxโ€™
   }
   ^
../deps/grpc/src/core/lib/surface/init.cc:163:7: note: in expansion of macro โ€˜GRPC_EXEC_CTX_INITIALIZERโ€™
       GRPC_EXEC_CTX_INITIALIZER(0, grpc_never_ready_to_finish, nullptr);
       ^
../deps/grpc/src/core/lib/surface/init.cc:164:16: error: โ€˜g_init_muโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                ^
../deps/grpc/src/core/lib/surface/init.cc:164:25: error: โ€˜gpr_mu_lockโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                         ^
../deps/grpc/src/core/lib/surface/init.cc:181:27: error: โ€˜gpr_mu_unlockโ€™ was not declared in this scope
   gpr_mu_unlock(&g_init_mu);
                           ^
../deps/grpc/src/core/lib/surface/init.cc: In function โ€˜int grpc_is_initialized()โ€™:
../deps/grpc/src/core/lib/surface/init.cc:187:18: error: โ€˜g_basic_initโ€™ was not declared in this scope
   gpr_once_init(&g_basic_init, do_basic_init);
                  ^
../deps/grpc/src/core/lib/surface/init.cc:187:45: error: โ€˜gpr_once_initโ€™ was not declared in this scope
   gpr_once_init(&g_basic_init, do_basic_init);
                                             ^
../deps/grpc/src/core/lib/surface/init.cc:188:16: error: โ€˜g_init_muโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                ^
../deps/grpc/src/core/lib/surface/init.cc:188:25: error: โ€˜gpr_mu_lockโ€™ was not declared in this scope
   gpr_mu_lock(&g_init_mu);
                         ^
../deps/grpc/src/core/lib/surface/init.cc:190:27: error: โ€˜gpr_mu_unlockโ€™ was not declared in this scope
   gpr_mu_unlock(&g_init_mu);
                           ^
cc1plus: all warnings being treated as errors
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] ะžัˆะธะฑะบะฐ 1
make: ะ’ั‹ั…ะพะด ะธะท ะบะฐั‚ะฐะปะพะณะฐ `/home/emz/node_modules/grpc/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/node.js-6.9.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System SunOS 5.11
gyp ERR! command "/usr/local/node.js-6.9.2/bin/node" "/usr/local/node.js-6.9.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown"
gyp ERR! cwd /home/emz/node_modules/grpc
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/node.js-6.9.2/bin/node /usr/local/node.js-6.9.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/emz/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System SunOS 5.11
node-pre-gyp ERR! command "/usr/local/node.js-6.9.2/bin/node" "/home/emz/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/emz/node_modules/grpc
node-pre-gyp ERR! node -v v6.9.2
node-pre-gyp ERR!  -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/node.js-6.9.2/bin/node /usr/local/node.js-6.9.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/home/emz/node_modules/grpc/src/node/extension_binary/node-v48-sunos-x64-unknown' (1)
npm WARN enoent ENOENT: no such file or directory, open '/home/emz/package.json'
npm WARN emz No description
npm WARN emz No repository field.
npm WARN emz No README data
npm WARN emz No license field.
npm ERR! SunOS 5.11
npm ERR! argv "/usr/local/node.js-6.9.2/bin/node" "/usr/local/node.js/bin/npm" "install" "grpc"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/emz/npm-debug.log

When trying to build by hand, it doesn't even get there, so, it's impossible to debug for me:

[emz@hyperion package]$ node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using @0.6.39
node-pre-gyp info using [email protected] | sunos | x64
node-pre-gyp info check checked for "/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-sunos-x64-unknown.tar.gz
node-pre-gyp http 403 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-sunos-x64-unknown.tar.gz
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-sunos-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-sunos-x64-unknown.tar.gz
(node:14716) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp info ok
(node:14717) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp http GET https://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.gz
gyp http 200 https://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.gz
gyp http GET https://nodejs.org/dist/v6.9.2/SHASUMS256.txt
gyp http 200 https://nodejs.org/dist/v6.9.2/SHASUMS256.txt
gyp info spawn python2
gyp info spawn args [ '/usr/local/node.js-6.9.2/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/emz/.npm/grpc/1.8.0/package/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/node.js-6.9.2/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/emz/.node-gyp/6.9.2/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/emz/.node-gyp/6.9.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/node.js-6.9.2/lib/node_modules/node-gyp',
gyp info spawn args   '-Dmodule_root_dir=/home/emz/.npm/grpc/1.8.0/package',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
module.js:471
    throw err;
    ^

Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at [eval]:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.exports.runInThisContext (vm.js:77:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:570:32)
    at Immediate.<anonymous> (bootstrap_node.js:357:29)
gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/node.js-6.9.2/lib/node_modules/node-gyp/lib/configure.js:357:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System SunOS 5.11
gyp ERR! command "/usr/local/node.js-6.9.2/bin/node" "/usr/local/node.js-6.9.2/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown"
gyp ERR! cwd /home/emz/.npm/grpc/1.8.0/package
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/node.js-6.9.2/bin/node /usr/local/node.js-6.9.2/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/node.js-6.9.2/lib/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System SunOS 5.11
node-pre-gyp ERR! command "/usr/local/node.js-6.9.2/bin/node" "/usr/local/node.js/bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/emz/.npm/grpc/1.8.0/package
node-pre-gyp ERR! node -v v6.9.2
node-pre-gyp ERR!  -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/node.js-6.9.2/bin/node /usr/local/node.js-6.9.2/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/home/emz/.npm/grpc/1.8.0/package/src/node/extension_binary/node-v48-sunos-x64-unknown' (1)
[emz@hyperion package]$ node-gyp build
(node:14830) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: ะ’ั…ะพะด ะฒ ะบะฐั‚ะฐะปะพะณ `/home/emz/.npm/grpc/1.8.0/package/build'
make: *** ะะต ะทะฐะดะฐะฝั‹ ั†ะตะปะธ ะธ ะฝะต ะฝะฐะนะดะตะฝ make-ั„ะฐะนะป.  ะžัั‚ะฐะฝะพะฒ.
make: ะ’ั‹ั…ะพะด ะธะท ะบะฐั‚ะฐะปะพะณะฐ `/home/emz/.npm/grpc/1.8.0/package/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/node.js-6.9.2/lib/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System SunOS 5.11
gyp ERR! command "/usr/local/node.js-6.9.2/bin/node" "/usr/local/node.js/bin/node-gyp" "build"
gyp ERR! cwd /home/emz/.npm/grpc/1.8.0/package
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok

Client calls are escaping the request domain

Client calls are escaping the domain making some of our apps to crash.

Similar to this problem mongodb/node-mongodb-native#1184

I modified this example for demonstration:

const domain = require('domain');
const d = domain.create();

const messages = require('./helloworld_pb');
const services = require('./helloworld_grpc_pb');
const grpc = require('grpc');

function main() {
  const client = new services.GreeterClient('localhost:50051', grpc.credentials.createInsecure());
  const request = new messages.HelloRequest();

  client.sayHello(request, (err, response) => {
    console.log('Greeting:', response.getMessage());
    throw new Error('Break!'); // <-- This makes the app crash --
  });

  setInterval(() => {
    console.log('app is running.');
  }, 2000);
}

d.run(() => {
  main();
});

// This should catch the error and recover
d.on('error', (error) => {
  console.log('Something wrong happened, but I caught it here and recovered:', error);
  main();
});

A workaround is to wrap the callback with domain.bind

  client.sayHello(request, process.domain.bind((err, response) => {
    console.log('Greeting:', response.getMessage());
    throw new Error('Break!');
  }));

streaming flow control

Forgive me if I've overlooked documentation on this subject, but I'm trying to understand how to properly configure flow control on streaming interfaces. Usually with Node streams I believe you would set the highWatermark option, however it appears that gRPC does not accept that option.

I thought maybe there was a grpc specific configuration that could be set, but after looking through the available options, it wasn't very clear to me if there was and how to use it correctly.

Essentially the issue I have is that I want to temporarily stop buffering results, typically in Node you would use the pause() and resume() methods to do this, however even if a stream is paused its internal buffer continues to get filled up and if I'm unable to configure the size of said buffer, I start to see increased memory usage.

Interop clients and servers failing - Invalid value for global._client_implementation

example error stack trace:

2017-11-13 17:26:55,822 /var/local/git/grpc-node/test/any_grpc.js:9
    throw new Error([
    ^

Error: Invalid value for global._client_implementation: undefined. If running from the command line, please --require a fixture first.
    at getImplementation (/var/local/git/grpc-node/test/any_grpc.js:9:11)
    at Object.<anonymous> (/var/local/git/grpc-node/test/any_grpc.js:23:20)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/local/git/grpc-node/test/interop/interop_client.js:23:12)

2017-11-13 17:26:55,822 FAILED: cloud_to_prod:node:default:empty_unary [ret=1, pid=20612, time=1.0sec]

seen in https://sponge.corp.google.com/target?id=de78aca9-7303-4ddf-98ed-a6ad111c1fd1&target=grpc/ubuntu/pull_request/grpc_interop_toprod&searchFor=&show=ALL&sortBy=STATUS (cloud to prod) and https://sponge.corp.google.com/target?id=dd531fd9-274b-4aa7-9e3f-1e89e67f1d35&target=grpc/ubuntu/pull_request/grpc_interop_tocloud&searchFor=&show=ALL&sortBy=STATUS (cloud to cloud)

about waring

C:\Users\wellorange\Desktop\document\rpc\grpc\src\dynamic_codegen>node greeter_server.js
(node:4392) DeprecationWarning: Server#addProtoService: Use Server#addService instead

๏ผŸ๏ผŸ๏ผŸ๏ผŸ๏ผŸ

Typescript Implementation Of server.addService Is Incorrect

It's typed as addService(service: Service, implementation: { [name: string]: handleCall }) (Service defined here).

However, if you look at the implementation of addService, it seems that none of the properties defined on Service are necessary to add a new service.

The example outlined here using this generated code, confirms that services.GreeterService doesn't actually implement the Services class, but I'm assuming that this example contains valid code.

Getting GOAWAY error

From @mkamioner on December 28, 2017 9:33

I have been getting the following error a lot after upgrading to 0.15.0

Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to "too_many_pings"

It seems that the grpc module is printing it (it is the only place in my code base where this string exists) and pubsub is the only component using grpc... Anyone else having this problem? What is the impact and how can we stop it?

Thanks!
Mo

Environment details

  • OS: Debian 8.10, x86_64 GNU/Linux
  • Node.js version: 6.12.2
  • npm version: 3.10.10
  • @google-cloud/pubsub version: 0.16.1

Steps to reproduce

  1. Unsure, we are subscribing with multiple instances to a very active subscription

Copied from original issue: googleapis/nodejs-pubsub#27

segfault with [email protected] on alpine-3.6

Using the prebuild binary of grpc-1.7.1 in alpine-3.6 (or rather: in the current node:8-alpine docker build which builds upon alpine-3.6) segfaults when requiring the module:

% docker run -ti --rm node:8-alpine ash
/ # apk add --update libc6-compat
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/1) Installing libc6-compat (1.1.16-r14)
OK: 5 MiB in 14 packages
/ # npm install grpc

> [email protected] install /node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open '/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

+ [email protected]
added 150 packages in 13.427s
/ # node node_modules/grpc/index.js
Segmentation fault

Forcing a build from source makes the segfault go away:

docker run -ti --rm node:8-alpine ash
/ # apk add --update libc6-compat python make gcc musl-dev g++
/ # npm install grpc --build-from-source

> [email protected] install /node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

206 MiB in 38 packages
make: Entering directory '/node_modules/grpc/build'
  CC(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CC(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
[โ€ฆ]
  SOLINK_MODULE(target) Release/obj.target/grpc_node.node
  COPY Release/grpc_node.node
  COPY /node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/node_modules/grpc/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No license field.

+ [email protected]
added 150 packages in 53.43s
/ # node node_modules/grpc/index.js
/ #

coredump:

Reading symbols from /usr/local/bin/node...done.
[New LWP 42]
[New LWP 47]
[New LWP 46]
[New LWP 45]
[New LWP 44]
[New LWP 43]

warning: Can't read pathname for load map: No error information.
Core was generated by `node node_modules/grpc/index.js'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000037a56 in ?? ()
[Current thread is 1 (LWP 42)]
(gdb) bt
#0  0x0000000000037a56 in ?? ()
#1  0x00007f2cc97e6e74 in vasprintf (__ap=0x7ffe134552f8,
    __fmt=0x7f2cc98024c0 "Warning: insecure environment read function '%s' used", __ptr=0x7ffe134552f0)
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:210
#2  gpr_log (file=file@entry=0x7f2cc9802580 "../deps/grpc/src/core/lib/support/log.c", line=line@entry=87,
    severity=severity@entry=GPR_LOG_SEVERITY_DEBUG,
    format=format@entry=0x7f2cc98024c0 "Warning: insecure environment read function '%s' used")
    at ../deps/grpc/src/core/lib/support/log_linux.c:49
#3  0x00007f2cc97e6d52 in gpr_log_verbosity_init () at ../deps/grpc/src/core/lib/support/log.c:87
#4  0x00007f2cc97655db in do_basic_init () at ../deps/grpc/src/core/lib/surface/init.c:67
#5  0x00007f2ccbfef86f in __pthread_once_full () from /lib/ld-musl-x86_64.so.1
#6  0x00007ffe00100200 in ?? ()
#7  0x00007f2ccbfef7ee in pthread_mutexattr_settype () from /lib/ld-musl-x86_64.so.1
#8  0x00007f2cc9a29568 in g_init_mu ()
   from /node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node
#9  0x0000000000000000 in ?? ()
(gdb)

[QUESTION] `npm i grpc` failed

I have run npm i grpc which goes to compile from source code on my PC. But the compilation failed after some minutes with this error message:

node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v57-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epoll1_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollex_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollsig_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_poll_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/exec_ctx.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/executor.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_fallback.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_host_name_max.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_sysconf.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iocp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/is_epollexclusive_available.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/load_file.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/lockfree_event.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/network_status_tracker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/polling_entity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resource_quota.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/sockaddr_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_factory_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_mutator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_common_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/time_averaged_stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_generic.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_heap.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_manager.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/udp_server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_cv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_pipe.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_writer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/b64.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/percent_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_hash_table.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_intern.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_string_helpers.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/alarm.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/api_trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_details.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_log_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_ping.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_stack_type.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/event_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/lame_client.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/metadata_array.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/validate_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/version.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/bdp_estimator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/byte_stream.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/connectivity_state.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/error_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/pid_controller.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/service_config.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/static_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/status_conversion.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/timeout_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport_op_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_data.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_ping.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_settings.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/hpack_table.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/http2_settings.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/huffsyms.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/parsing.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/stream_lists.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/stream_map.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/varint.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/writing.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/alpn/alpn.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/http/client/http_client_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/http/http_filters_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/http/server/http_server_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli_security_connector.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/context/security_context.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/composite/composite_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/credentials_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/fake/fake_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/google_default/credentials_generic.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/iam/iam_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/jwt/json_token.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/client_auth_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/lb_targets_info.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/secure_endpoint.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/security_connector.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/security_handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/server_auth_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/transport/tsi_error.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/security/util/json_util.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init_secure.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/fake_transport_security.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/gts_transport_security.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/ssl_transport_security.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/transport_security_grpc.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/transport_security.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/tsi/transport_security_adapter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/chttp2_server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/backup_poller.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/channel_connectivity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/client_channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/client_channel_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/client_channel_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/connector.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/http_proxy.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/parse_address.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/proxy_mapper.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/proxy_mapper_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/retry_throttle.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/subchannel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/subchannel_index.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/uri_parser.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/deadline/deadline_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/inproc/inproc_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/inproc/inproc_transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.o
  CC(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.o
  CC(target) Release/obj.target/grpc/deps/grpc/third_party/nanopb/pb_common.o
  CC(target) Release/obj.target/grpc/deps/grpc/third_party/nanopb/pb_decode.o
  CC(target) Release/obj.target/grpc/deps/grpc/third_party/nanopb/pb_encode.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/load_reporting/server_load_reporting_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/census/grpc_context.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/max_age/max_age_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/message_size/message_size_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/workarounds/workaround_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/plugin_registry/grpc_plugin_registry.o
  LIBTOOL-STATIC Release/libgrpc.a
Traceback (most recent call last):
  File "./gyp-mac-tool", line 611, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./gyp-mac-tool", line 28, in main
    exit_code = executor.Dispatch(args)
  File "./gyp-mac-tool", line 43, in Dispatch
    return getattr(self, method)(*args[1:])
  File "./gyp-mac-tool", line 246, in ExecFilterLibtool
    if not libtool_re.match(line) and not libtool_re5.match(line):
TypeError: cannot use a string pattern on a bytes-like object
make: *** [Release/libgrpc.a] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/poppinl/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/Users/poppinl/.nvm/versions/node/v8.9.3/bin/node" "/Users/poppinl/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown"
gyp ERR! cwd /Users/poppinl/Documents/code/work/pudge/node_modules/grpc
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/poppinl/.nvm/versions/node/v8.9.3/bin/node /Users/poppinl/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.3.0
node-pre-gyp ERR! command "/Users/poppinl/.nvm/versions/node/v8.9.3/bin/node" "/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/poppinl/Documents/code/work/pudge/node_modules/grpc
node-pre-gyp ERR! node -v v8.9.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/Users/poppinl/.nvm/versions/node/v8.9.3/bin/node /Users/poppinl/.nvm/versions/node/v8.9.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/poppinl/Documents/code/work/pudge/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/poppinl/.npm/_logs/2017-12-19T09_13_08_177Z-debug.log

I'm not sure what's going on here. So what shoud i do to install grpc successfully?

ENV:
OS mac 10.13.2
node 8.9.3
npm 5.5.1
already have python=/usr/local/bin/python2.7 in .npmrc

Steps to releasing gRPC 2.0

  • Move the low-level pure JavaScript (TypeScript) code into packages/grpc-js-core (#14)
  • Import the existing grpc package into packages/grpc-native-core (#17)
    • Create a submodule in packages/grpc-native-core that points to the grpc/grpc repository for the C core dependency (#18)
    • Divide that code into several packages
      • Move all protobuf.js related code into packages/grpc-protobufjs
      • Move other code that is shared between implementations (currently just grpc.makeGenericClientConstructor) into packages/grpc-surface
      • Move grpc-tools code into packages/grpc-tools (#20)
      • Move health checking code into packages/grpc-health-check (#20)
      • Move API surface-level unit tests, interop tests, performance tests, etc. into tests in the repository root, and create a pseudo package to handle their dependencies on the other packages in the repository
  • Create the gRPC metapackage in packages/grpc that initially depends on grpc-native.
  • Add feature/capability enabling functionality
  • Upgrade the dependency on Protobuf.js to version 6.
  • Make any other breaking changes (TODO(murgatroid99): insert a reference to a relevant gRFC)

help about credentials in Server

This code is from etcd to create server, and when I let grpcServer listen at http://localhost:2379, tls === nil and grpc.NewServer doesn't include grpc.Creds.

func Server(s *etcdserver.EtcdServer, tls *tls.Config, gopts ...grpc.ServerOption) *grpc.Server {
	var opts []grpc.ServerOption
	opts = append(opts, grpc.CustomCodec(&codec{}))
	if tls != nil {
		opts = append(opts, grpc.Creds(credentials.NewTLS(tls)))
	}
	opts = append(opts, grpc.UnaryInterceptor(newUnaryInterceptor(s)))
	opts = append(opts, grpc.StreamInterceptor(newStreamInterceptor(s)))
	opts = append(opts, grpc.MaxRecvMsgSize(int(s.Cfg.MaxRequestBytes+grpcOverheadBytes)))
	opts = append(opts, grpc.MaxSendMsgSize(maxSendBytes))
	opts = append(opts, grpc.MaxConcurrentStreams(maxStreams))
	grpcServer := grpc.NewServer(append(opts, gopts...)...)

I want to do the same thing with nodejs grpc, does grpc.ServerCredentials.createInsecure() work?

Service IP Address change during connection

Lets say I have a grpc server running on 192.168.99.100

I have a client connection to this server.

For one reason or another the server is brought down and then goes back up again, with lets say an ip address of 192.168.99.102

The client that was connected to the server before the IP change is still sending requests to the old IP address.

Is there any way that to restart the connection to the new IP address?

Just a note these IP's are discovered through DNS, so I assumed that every GRPC request would require a DNS resolution query, but this is not the case. The DNS resolution is cached and the client needs to be restarted to resolve to the new, correct, IP address.

Should allow colon in metadata keys for HTTP/2 pseudo headers?

Hello,

I am trying to set a metadata key/value pair for an http/2 header like so:

var meta = new grpc.Metadata();
meta.add(':authority', 'account');

This fails with the following error:

Error: Metadata key":authority" contains illegal characters
web_1              |     at normalizeKey (/app/node_modules/grpc/src/node/src/metadata.js:67:11)
web_1              |     at Metadata.add (/app/node_modules/grpc/src/node/src/metadata.js:108:9)
web_1              |     at Promise (/app/src/functions/index.js:54:10)
web_1              |     at Object.createUserSession (/app/src/functions/index.js:52:10)
web_1              |     at createUserSession (/app/src/routes/index.js:8:23)
web_1              |     at Promise.resolve.then (/app/src/lib/promisify-grpc.js:6:16)
web_1              |     at process._tickDomainCallback (internal/process/next_tick.js:135:7)
web_1              | Processing [/auth.Authenticator/CreateUserSession]

The problem is that Metadata.add() does not allow a key value pair with a key that contains a colon. However, shouldn't this be allowed considering the HTTP/2 spec specifies that pseudo headers (such as :authority) are supposed to be implemented with a leading colon?

Link to offending code:
https://github.com/grpc/grpc-node/blob/master/packages/grpc-js-core/src/metadata.ts

P.S. I did find this issue, which identifies the same problem, but does not actually discuss whether or not metadata keys SHOULD support a colon: grpc/grpc-go#613

P.P.S. Just to provide some context, I want to use the :authority header because Envoy proxy relies on this header to determine where a request should be forwarded to. Though this has little to do with gRPC, thought it might be useful to provide a legitimate use case. https://www.envoyproxy.io/docs/envoy/latest/intro/deployment_types/service_to_service.html#service-to-service-egress-listener

npm install firebase fails due to grpc

I'm trying to install firebase to my Angular Project. I have tried with several versions of Node.js but no luck so far.

I get an error similar to that of below:

[email protected] install E:\Development\Angular\RecipeBookProject\node_modules\grpc
node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v48-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at Object.failNoPython (E:\Development\Angular\RecipeBookProject\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at Object. (E:\Development\Angular\RecipeBookProject\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at E:\Development\Angular\RecipeBookProject\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\Development\Angular\RecipeBookProject\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown"
gyp ERR! cwd E:\Development\Angular\RecipeBookProject\node_modules\grpc
gyp ERR! node -v v6.12.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe E:\Development\Angular\RecipeBookProject\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown' (1)
node-pre-gyp ERR! stack at ChildProcess. (E:\Development\Angular\RecipeBookProject\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:920:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\Development\Angular\RecipeBookProject\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd E:\Development\Angular\RecipeBookProject\node_modules\grpc
node-pre-gyp ERR! node -v v6.12.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe E:\Development\Angular\RecipeBookProject\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Development\Angular\RecipeBookProject\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown' (1)
[email protected] E:\Development\Angular\RecipeBookProject
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "firebase"
npm ERR! node v6.12.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! E:\Development\Angular\RecipeBookProject\npm-debug.log
npm ERR! code 1

I can post the contents of npm-debug.log if required.

I'm not sure if this is the correct place to post something like this, but google has come up short and the feedback from npm suggests to do this.

Thanks

Prebuilt binaries for v1.7.0 have incorrect permissions

The permissions for the prebuilt linux binaries for v1.7.0 use 0750 instead of 0755 and seem to be preserving some random-ish looking uid/gid instead of using the uid/gid of the installing process.

The following were run inside a docker container (docker run --rm -it node:8.6.0 bash):

v1.7.0:

root@73ae751b8855:~# npm install [email protected]
root@73ae751b8855:~# ls -l node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/
total 6468
-rwxr-x--- 1 255363 5000 6621262 Nov  1 20:12 grpc_node.node

v1.6.6:

root@73ae751b8855:~# npm install [email protected]
root@73ae751b8855:~# ls -l node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/
-rwxr-xr-x 1 root root 6184072 Oct  5 19:31 grpc_node.node

Segfault with IPV6 6rd enabled

From @kuzyn on December 26, 2017 15:27

This is a strange problem; apologies that the step to reproduces aren't super straightforward:

It appears that if I'm behind a router (Cisco EA3500) and leave the Internet Settings / IPV6 / IPV6 6rd to "Automatic", all request to the datastore will result in a segfault

image

image

The sensor.model:createOne method (hangs at ds.save/datastore.save):

 createOne: o => {
    return sensorEntity.new(o).then(e => ds.save(e))
  },

The sensor.model:createOne test:

  test('sensor.model:createOne', t => {
    return sensorModel.createOne(entityPayload)
      .then(d => {
        const id = extract(d, 'id')
        t.equal(id.length, 16, 'id has 16 digits')
        t.equal(typeof parseInt(id), 'number', 'id parse to number')
        entitiesIds.push(id)
      })
      .then(() => t.end())
  })

I'm trying to understand why there is no error displayed and why it only seems to affect the datastore (so far). Maybe someone has an idea on how to replicate this environment in a Docker image or something?

Environment details

  • OS: 4.14.4-1-ARCH
  • Node.js version: v8.9.1
  • npm version: 5.5.1
  • yarn version: 1.3.2
  • @google-cloud/datastore version:

Steps to reproduce

  1. Enable 6RD on a router
  2. Try to perform a datastore operation

Copied from original issue: googleapis/nodejs-datastore#36

node-v59-linux-x64/grpc_node.node is missing

I am trying to use Firebase admin SDK in my server. When I deploy I get the error I am missing file node-v59-linux-x64/grpc_node.node in firebase-admin node_module map. I added "grpc": "1.7.1" in my package, but I still do not get that file after NPM update. I get an older version, node-v57. I also checked this path https://registry.npmjs.org/grpc/-/grpc-1.7.1.tgz, but I could not locate the file. I deleted my node_modules map and ran npm install again, still no node-v59.

How/where can I download that file? Is there any one who can put the file here so I can manually add it?

Error: Cannot find module '/data/app/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64/grpc_node.node'

Support reflection

I want to expose proto file for clients through HTTP as REST endpoint. I want to call this endpoint and get a raw proto file. Can I do this with gRPC.serveHTTP or not? Maybe you can advise some better ways to share a proto file with clients. Thanks!

Broken windows build for electron

Since version 1.7.2 where the module path now contains -{libc}, it won't compile properly when grpc is used in an electron app using electron-builder. The later still look for the path without -{libc}. Reverting to version 1.7.1 of grpc-node fixes the issue.

Bug when calling server.tryShutdown

OS Version
Linux 4.14.11-1-ARCH #1 SMP PREEMPT Wed Jan 3 07:02:42 UTC 2018 x86_64 GNU/Linux

Node
v9.3.0

grpc-node
1.8.0

When calling server.tryShutdown() without a callback I'm getting this error:

#
# Fatal error in ../deps/v8/src/objects.cc, line 3574
# Check failed: receiver->IsJSFunction().
#

Isn't this (no callback) supposed to be handled by the library?

Endpoint read failed in client request

When I restart grpc server, occasionally error is given which message is Endpoint read failed and code is 14 in grpc client, and it won't reconnect to server.
In general, err with code 14 gives a message Connect Failed and client can reconnect successfully.

If frequency of request is 30ms, then this error appears easily.

pubsub: not working inside docker (no error output)

From @victorperin on November 8, 2017 15:25

Environment details

  • OS: Fedora 25 (Docker 17.09)
  • Node.js version: Using image node:9.0.0-alpine (same problem with older versions)
  • npm version: 5.5.1
  • google-cloud-node version: "@google-cloud/pubsub": "0.14.7"

Steps to reproduce

I created a repository reproducing the steps, to make it easy to everyone understand what is the problem.
https://github.com/victorperin/google-pubsub-node-docker-bug

Seems to be some kind of lib missing, but I don't know how to find it.

Copied from original issue: googleapis/google-cloud-node#2733

Dependency on Old Protobufjs

Wasn't there a fix to use the new protobufjs 6 version?

grpc/grpc#8991

However, when I pull down the latest grpc 1.7.2 version, it is still dependent on 5.0.0. It would be useful to have version 6 in there so that I can use loading property and proto verification especially with messages that use the virtual oneof parameters.

{
  "name": "grpc",
  "version": "1.7.2",
  "author": "Google Inc.",
  "description": "gRPC Library for Node",
  "homepage": "https://grpc.io/",
  "repository": {
    "type": "git",
    "url": "https://github.com/grpc/grpc-node.git"
  },
  "bugs": "https://github.com/grpc/grpc-node/issues",
  "contributors": [
    {
      "name": "Michael Lumish",
      "email": "[email protected]"
    }
  ],
  "directories": {
    "lib": "src"
  },
  "scripts": {
    "build": "./node_modules/.bin/node-pre-gyp build",
    "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
    "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test",
    "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library"
  },
  "bundledDependencies": [
    "node-pre-gyp"
  ],
  "dependencies": {
    "arguejs": "^0.2.3",
    "lodash": "^4.15.0",
    "nan": "^2.8.0",
    "node-pre-gyp": "^0.6.39",
    "protobufjs": "^5.0.0"
  },

I am not doing anything special other than just
npm install grpc

Missing dependencies

After installing grpc I get compilaion errors when running the application.

Error in ./~/grpc/~/node-pre-gyp/lib/info.js
Module not found: 'aws-sdk' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/node-pre-gyp/lib

 @ ./~/grpc/~/node-pre-gyp/lib/info.js 14:14-32

Error in ./~/grpc/~/node-pre-gyp/lib/publish.js
Module not found: 'aws-sdk' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/node-pre-gyp/lib

 @ ./~/grpc/~/node-pre-gyp/lib/publish.js 17:14-32

Error in ./~/grpc/~/node-pre-gyp/lib/unpublish.js
Module not found: 'aws-sdk' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/node-pre-gyp/lib

 @ ./~/grpc/~/node-pre-gyp/lib/unpublish.js 15:14-32

Error in ./~/grpc/~/node-pre-gyp/lib/testbinary.js
Module not found: 'child_process' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/node-pre-gyp/lib

 @ ./~/grpc/~/node-pre-gyp/lib/testbinary.js 10:9-33

Error in ./~/grpc/~/node-pre-gyp/lib/util/compile.js
Module not found: 'child_process' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/node-pre-gyp/lib/util

 @ ./~/grpc/~/node-pre-gyp/lib/util/compile.js 9:9-33

Error in ./~/grpc/~/detect-libc/lib/detect-libc.js
Module not found: 'child_process' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/detect-libc/lib

 @ ./~/grpc/~/detect-libc/lib/detect-libc.js 4:16-40

Error in ./~/grpc/~/uid-number/uid-number.js
Module not found: 'child_process' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/uid-number

 @ ./~/grpc/~/uid-number/uid-number.js 9:20-44

Error in ./~/grpc/~/osenv/osenv.js
Module not found: 'child_process' in /home/smikerov/Others/Wow/Ui/node_modules/grpc/node_modules/osenv

 @ ./~/grpc/~/osenv/osenv.js 3:11-35

After updating node to the latest LTS (v.8.9.1) I received different dependency errors:

./node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js
16:20-67 Critical dependency: the request of a dependency is an expression

./node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js
19:22-48 Critical dependency: the request of a dependency is an expression

./node_modules/grpc/src/grpc_extension.js
30:14-35 Critical dependency: the request of a dependency is an expression

Search for the keywords to learn more about each warning.

grpc does not re-establish duplex streams when writes are pending

The sequence of events I'm hitting is:

  1. An existing connection fails; the client tries to reconnect
  2. I create a new grpc stream. It seems like this gets created lazily, and is connected before the remote server actually recovers and starts accepting connections.
  3. I write on the stream
  4. The server recovers and starts accepting connections
  5. But, the write never goes through and the TCP connection does not get created. Eventually the test case times out.

I have traced the call to this startBatch call. The call is made, but the callback never fires, and eventually the test case times out. No TCP connection is made to the remote server and calls are not recorded. If I switch the order of step 3 and 4, adding a delay before the write happens, it works fine.

This is the full test case I'm running. I have grpc set up to hit a simple TLS proxy server which I can use to simulate network disruptions. pause() tears down the server and terminates all existing connections, resume() recreates the server. By manually adding a delay before the proxy.resume(), I can guarantee this event ordering--the library will try to reconnect to the server as in step 2-3 in the meantime.

node grpc client is writing data to non-existent grpc server which running on AWS.

We have our grpc servers running on AWS and maintained by AWS ELB. After every deployments, all the old instances will take down and new ones will come up.

I am using node grpc client to consume grpc. What is surprising is, after deployment, node client is still able to write data to instances which are already terminated. they are removed from AWS.

This is happening consistently and able to get logs.

Before deploying new instances, it is connect 99.126.18.38

D1027 00:02:32.641248526      20 tcp_uv.c:170]               READ 0x2ca2440 (peer=ipv4:99.126.18.38:50051): 00 00 00 04 01 00 00 00 00 '.........'
D1027 00:02:32.641256175      20 tcp_uv.c:205]               Initiating read on 0x2ca2440: error="No Error"
D1027 00:02:56.319402144      20 tcp_uv.c:165]               read: error="No Error"
D1027 00:02:56.319445970      20 tcp_uv.c:170]               READ 0x2ca2440 (peer=ipv4:99.126.18.38:50051): ......'
D1027 00:02:56.319465809      20 tcp_uv.c:205]               Initiating read on 0x2ca2440: error="No Error"
workflow-j994qpll-log-14 PENDING deploy Processing by xxxxx...
D1027 00:02:59.687340345      20 tcp_uv.c:165]               read: error="No Error"
D1027 00:02:59.687392673      20 tcp_uv.c:170]               READ 0x2ca2440 (peer=ipv4:99.126.18.38:50051): .'
D1027 00:02:59.687433036      20 tcp_uv.c:205]               Initiating read on 0x2ca2440: error="No Error"
D1027 00:02:59.687475521      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): .......'
D1027 00:02:59.687538793      20 tcp_uv.c:223]               write complete on 0x2ca2440: error="No Error"
D1027 00:02:59.690488603      20 tcp_uv.c:165]               read: error="No Error"
D1027 00:02:59.690499049      20 tcp_uv.c:170]               READ 0x2ca2440 (peer=ipv4:99.126.18.38:50051): 00 00 00 04 01 00 00 00 00 '.........'
D1027 00:02:59.690505852      20 tcp_uv.c:205]               Initiating read on 0x2ca2440: error="No Error"
commit call status :  { code: 0,
  details: '',
  metadata: Metadata { _internal_repr: {} } }

After deployment, new instances came up with new IPs.

D1027 02:08:03.254455899      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): ..........'
D1027 02:08:03.254477131      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): ':path'
D1027 02:08:03.254482534      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): '*'
D1027 02:08:03.254488566      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): '
D1027 02:08:03.254494090      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): .......'
D1027 02:08:03.254498968      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051):  'grpc-timeout'
D1027 02:08:03.254504662      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051):  '.630S..........'
D1027 02:08:03.254509486      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): '....'
D1027 02:08:03.254517491      20 tcp_uv.c:248]               WRITE 0x2ca2440 (peer=ipv4:99.126.18.38:50051): '
D1027 02:08:03.254847362      20 tcp_uv.c:223]               write complete on 0x2ca2440: error="No Error"

There is almost 120 mins between two calls.

Also I have tried to ping or curl to make sure that the IP not recycled.

Why is still writing to non-existent IP ? any hints will help me debug this issue. thanks !!

[NodeJS] Promises and async/await

It would be nice if there was a grpc-tools and/or grpc_node_plugin option that would generate client and server code that follows the ES6 Promise and ES7 async/await model.

For example, instead of:
https://github.com/grpc/grpc/blob/98f8989a6712118549c432c9f91b6a516250014d/examples/node/static_codegen/greeter_client.js#L35-L37
We could write:

  [err, response] = await client.sayHello(request);

Or something similar. On the server side, instead of:
https://github.com/grpc/grpc/blob/98f8989a6712118549c432c9f91b6a516250014d/examples/node/static_codegen/greeter_server.js#L27-L31
We could write:

async function sayHello(call) {
  var reply = new messages.HelloReply();
  reply.setMessage('Hello ' + call.request.getName());
  return [null, reply]
}

Again, just ideas.

This feature would eliminate the need for wrapper code for users wanting to use this pattern. I would love to know if anyone is interested in this feature or planning on adding it. Thanks!

(moved from grpc/grpc#12751)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.