Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployment error using logging-bunyan #2128

Closed
chadbr opened this issue Mar 22, 2017 · 4 comments
Closed

deployment error using logging-bunyan #2128

chadbr opened this issue Mar 22, 2017 · 4 comments
Assignees

Comments

@chadbr
Copy link

chadbr commented Mar 22, 2017

Environment details

  • OS:CentOS 7

  • Node.js version:

  • npm version:
    Installing : 1:npm-3.10.10-1.6.9.4.2.el7.x86_64 3/4
    Installing : 1:nodejs-6.9.4-2.el7.x86_64 4/4

  • google-cloud-node version:
    "@google-cloud/logging-bunyan@^0.1.0":
    version "0.1.0"

Steps to reproduce

Download this repo: https://github.com/chadbr/google-bunyan-error

  • yarn install
  • yarn build
  • deploying will yield:
ERROR: (gcloud.app.deploy) Error Response: [9] 
Application startup error:
yarn start v0.21.3
$ node dist/index.js 
Listening on port 8080
Mar 22 22:34:57 google-bunyan-issue[14] INFO:  ::ffff:172.18.0.3 <-- GET /_ah/health HTTP/1.1 200 0 - Other 0.0 Other 0.0.0 48.062011 ms
  req: GET 10.128.0.7/_ah/health 200 48.062011ms - 0 bytes
node: symbol lookup error: /app/node_modules/grpc/src/node/extension_binary/grpc_node.node: undefined symbol: SSL_CTX_set_alpn_protos
error Command failed with exit code 127.
@ofrobots
Copy link
Contributor

ofrobots commented Mar 23, 2017

Thanks for opening the bug. This is an issue caused by gRPC. It expects the version of OpenSSL that Node.js 6.x ships with, but on your system it seems like the Node.js binary might be linked against a different version of OpenSSL.

How are you installing Node? Are you using a CentOS package or are you using official Node.js tarballs?

The fix would be either:

  • Recommended: Use official Node.js binaries. They ship with the version of OpenSSL that we in node-core intend it to be shipped with. (For confirmation, can you try this and report back?)
  • If it is not possible for you to use official Node.js binaries, you can work-around the problem by
    adding the following 'preinstall' script to your package.json: "preinstall": "npm install grpc --build-from-source=grpc --grpc_alpn=false". Note that this requires gRPC version 1.2.0 or greater.

/cc @murgatroid99 in case I got any of the details wrong.

@murgatroid99
Copy link

Instead of modifying the preinstall script, it should also be sufficient to add "build_from_source": "grpc" and "grpc_alpn": true as top level properties in your package.json. These options are just NPM config values, which can be set in a variety of ways, including command line arguments, package.json properties, and environment variables.

@chadbr
Copy link
Author

chadbr commented Mar 23, 2017

Installing from source does the trick --

I removed the installation of OpenSSL

and added these lines from https://github.com/GoogleCloudPlatform/nodejs-docker/blob/master/base/Dockerfile

RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

RUN mkdir /nodejs && curl https://nodejs.org/dist/v6.10.1/node-v6.10.1-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1
ENV PATH $PATH:/nodejs/bin

Thanks much - I hope this helps someone else in the future...

@gaofanmichael
Copy link

This issue was moved to googleapis/nodejs-logging-bunyan#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants