gcloud app deploy fails with flexible environment

[亡魂溺海] 提交于 2021-01-29 12:42:08

问题


I've tried the hello world example with nodejs and php and both the standard environments work fine. But both examples using the flexible give the same error when I use 'gcloud app deploy': ERROR: gcloud crashed (TypeError): '>' not supported between instances of 'NoneType' and 'int'

Works: https://cloud.google.com/nodejs/getting-started/hello-world https://cloud.google.com/appengine/docs/standard/php7/quickstart

Fails: https://cloud.google.com/appengine/docs/flexible/nodejs/quickstart https://cloud.google.com/appengine/docs/flexible/php/quickstart

I've tried deleting the project and starting from scratch (and made sure billing was enabled). gcloud info is displaying the correct gmail account and project is set.

What am I missing?

app.yaml

runtime: nodejs
env: flex
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

app.js

'use strict';

// [START gae_flex_quickstart]
const express = require('express');

const app = express();

app.get('/', (req, res) => {
  res
    .status(200)
    .send('Hello, world!')
    .end();
});

// Start the server
const PORT = process.env.PORT || 8081;
app.listen(PORT, () => {
  console.log(`App listening on port ${PORT}`);
  console.log('Press Ctrl+C to quit.');
});
// [END gae_flex_quickstart]

module.exports = app;

package.json

{
  "name": "appengine-hello-world",
  "description": "Simple Hello World Node.js sample for Google App Engine Flexible Environment.",
  "version": "0.0.1",
  "private": true,
  "license": "Apache-2.0",
  "author": "Google Inc.",
  "repository": {
    "type": "git",
    "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
  },
  "engines": {
    "node": ">=8.0.0"
  },
  "scripts": {
    "start": "node app.js",
    "test": "mocha --exit test/*.test.js"
  },
  "dependencies": {
    "express": "^4.16.3"
  },
  "devDependencies": {
    "mocha": "^6.2.0",
    "supertest": "^4.0.2"
  }
}

来源:https://stackoverflow.com/questions/58427909/gcloud-app-deploy-fails-with-flexible-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!