Skip to content

App Engine deployment issue with grpc and nodejs v6.2.0 #1347

Description

@jduval

I'm trying to deploy to App Engine with a nodejs runtime. It seems to fail because of a mismatch version of grpc.

screenshot from 2016-05-31 11 46 07

I successfully deployed to GAE with a custom runtime with docker which only runs npm install. I saw from grpc/grpc#6218 that running npm install --update-binary may solves the problem. But I can't figure out to do that.

If I'm not mistaken, gcloud preview app gen-config --custom generates a Dockerfile from the nodejs runtime base, right ? So I try to add the last command to update binary. But it didn't work.

What am I missing ?

Thanks.

Activity

  1. stephenplusplus commented on May 31, 2016

    @stephenplusplus
    Contributor

    @jmdobry @jonparrott do you have any ideas?

  2. stephenplusplus commented on Jun 6, 2016

    @stephenplusplus
    Contributor

    Hey guys, just wondering if you've run into this situation before and if a best practice has emerged for how to handle it? Thanks!

  3. jmdobry commented on Jun 6, 2016

    @jmdobry
    Contributor

    I have never encountered this with GAE. As far as I know, npm install --update-binary should have worked. Pinging @JustinBeckwith

  4. JustinBeckwith commented on Jun 6, 2016

    @JustinBeckwith
    Contributor

    I can't find any documentation on "npm install --update-binary" - so I have no idea what that really is scratches head.

  5. JustinBeckwith commented on Jun 6, 2016

    @JustinBeckwith
    Contributor

    Also - if you are using the default deploy path - we don't cache binaries or packages in between deploys. We do no caching, so you get new binaries every time.

  6. jduval commented on Jun 7, 2016

    @jduval
    Author

    Ok, I finally deployed to GAE successfully.

    I used Dockerfile base and update it like this :

    ADD package.json /app/
    RUN npm install 
    ADD . /app
    
  7. jmdobry commented on Jun 7, 2016

    @jmdobry
    Contributor

    Interesting, have you tried adding "engines": { "node": "6.2.0" } to your package.json instead?

  8. jduval commented on Jun 7, 2016

    @jduval
    Author

    I did, and here is app.yaml

    runtime: custom # or nodejs without Dockerfile...
    vm: true
    threadsafe: true
    
    automatic_scaling:
      min_num_instances: 4
      max_num_instances: 80
      cool_down_period_sec: 60
      cpu_utilization:
        target_utilization: 0.8
    
    resources:
      cpu: 1
      memory_gb: 1.3
      disk_size_gb: 10
    
    health_check:
      enable_health_check: True
      check_interval_sec: 5
      timeout_sec: 4
      unhealthy_threshold: 2
      healthy_threshold: 2
      restart_threshold: 60
    
    beta_settings:
      cloud_sql_instances: projectname:zone:instanceid
      service_account_scopes: >
        https://www.googleapis.com/auth/userinfo.email,
        https://www.googleapis.com/auth/cloud-platform,
        https://www.googleapis.com/auth/pubsub
    
  9. jmdobry commented on Jun 7, 2016

    @jmdobry
    Contributor

    Hmm, were you ever able to try npm install --update-binary? One way to do that would be to add "postinstall": "npm install --update-binary" to the scripts in your package.json. Now, was the original deployment itself failing, or was it deploying and the app failing to start? The "app unhealthy" error would indicated that the initial npm install succeeded, but that the app failed to start, which is what I suspect since you were able to take a screenshot of the logs in the Cloud Console.

  10. JustinBeckwith commented on Jun 7, 2016

    @JustinBeckwith
    Contributor

    @jduval can you share your package.json? We're kinda guessing here.

  11. jduval commented on Jun 8, 2016

    @jduval
    Author

    @jmdobry I just try to add and deploy with "postinstall": "npm install --update-binary" and runtime: nodejs, but it fails at building.
    Otherwise it was deploying but the app failing to start. I could see the GAE version with instances and browsed logs.

    @JustinBeckwith here is my package.json

    {
      "name": "projectname",
      "version": "1.0.0",
      "description": "project desc",
      "main": "app.js",
      "engines": {
        "node": "6.2.0"
      },
      "dependencies": {
        "async": "^1.5.2",
        "body-parser": "^1.15.1",
        "bunyan": "^1.8.1",
        "common-errors": "^0.5.1",
        "cors": "^2.7.1",
        "express": "^4.13.3",
        "express-domain": "^1.0.5",
        "express-winston": "^1.3.1",
        "gcloud": "^0.34.0",
        "googleapis": "^6.1.0",
        "helmet": "^2.0.0",
        "jsonwebtoken": "^6.2.0",
        "lodash": "^4.12.0",
        "memcached": "^2.2.2",
        "morgan": "^1.6.1",
        "mysql": "^2.10.2",
        "prompt": "^1.0.0",
        "require-dir": "^0.3.0",
        "winston": "^2.2.0"
      },
      "devDependencies": {
        "supertest": "^1.2.0",
        "tap-spec": "^4.1.1",
        "tape": "^4.5.1"
      },
      "scripts": {
        "start": "node app.js",
        "deploy": "gcloud preview app deploy app.yaml --no-promote --project=projectid",
        "test": "./node_modules/.bin/tape tests/*.js | ./node_modules/.bin/tap-spec"
      },
      "repository": {
        "type": "git",
        "url": "url"
      },
      "author": "",
      "license": "ISC"
    }
  12. jmdobry commented on Jun 8, 2016

    @jmdobry
    Contributor

    I just tested with your configuration, and it worked.

    I used the following to deploy:

    app.yaml

    runtime: nodejs
    vm: true
    manual_scaling:
      instances: 1

    package.json

    {
      "name": "projectname",
      "main": "app.js",
      "engines": {
        "node": "6.2.0"
      },
      "dependencies": {
        "async": "^1.5.2",
        "body-parser": "^1.15.1",
        "bunyan": "^1.8.1",
        "common-errors": "^0.5.1",
        "cors": "^2.7.1",
        "express": "^4.13.3",
        "express-domain": "^1.0.5",
        "express-winston": "^1.3.1",
        "gcloud": "^0.34.0",
        "googleapis": "^6.1.0",
        "helmet": "^2.0.0",
        "jsonwebtoken": "^6.2.0",
        "lodash": "^4.12.0",
        "memcached": "^2.2.2",
        "morgan": "^1.6.1",
        "mysql": "^2.10.2",
        "prompt": "^1.0.0",
        "require-dir": "^0.3.0",
        "winston": "^2.2.0"
      },
      "scripts": {
        "start": "node app.js"
      }
    }

    app.js

    require('async');
    require('body-parser');
    require('bunyan');
    require('common-errors');
    require('cors');
    require('express-domain');
    require('express-winston');
    require('gcloud');
    require('googleapis');
    require('helmet');
    require('jsonwebtoken');
    require('lodash');
    require('memcached');
    require('morgan');
    require('mysql');
    require('prompt');
    require('require-dir');
    require('winston');
    
    var express = require('express');
    var app = express();
    app.get('*', function (req, res) {
      res.status(200).send('Ok').end();
    });
    app.listen(process.env.PORT || 8080);
  13. jduval commented on Jun 13, 2016

    @jduval
    Author

    I try without threadsafe like you did. Building is OK, but still have this mismatch version issue.

  14. stephenplusplus commented on Jul 6, 2016

    @stephenplusplus
    Contributor

    Going to close the issue, since this isn't a bug with the code in this repo. But if there are still issues, feel free to keep discussing.

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

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions