user7956520
user7956520

Reputation:

(gcloud.app.deploy) Error Response: [400] The VM runtime does not support basic scaling or dynamic backends

What I do wrong

I just try to upload my python flask app on google cloud app engine

With that commands

gcloud config set project project-85474158

gcloud app deploy

FOLDER STRUCTURE

MY_APP
     |
     |__app.yaml
     |__requirements.txt
     |__setup.py

app.yaml

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:setup

runtime_config:
    python_version: 3

api_version: 1
instance_class: B8
basic_scaling:
    max_instances: 2
    idle_timeout: 10m

requirements.txt

Flask==0.12.2
gunicorn==19.6.0

setup.py

import logging

from flask import Flask

app = Flask(__name__)

@app.route('/')
def home():
    return 'Hello Youtube v2'

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5000, debug=True)

Upvotes: 1

Views: 919

Answers (1)

David
David

Reputation: 9721

You have env: flex which means you are trying to use GAE Flexible. There are a few things in your code incompatible with Flexible:

  1. You cannot specify instance_class: B8. Instance classes are from GAE Standard. Instead, leave it out entirely or specify resources

  2. You cannot specify basic_scaling. This is also from Standard. Instead specify automatic_scaling or manual_scaling.

  3. You are running gunicorn with main:setup, but you are using object app in module setup, so you should use setup:app.

Upvotes: 1

Related Questions