How to add a second module to GAE? - python

I have followed the docs to create an additional B2 module to my existing default F1 instance.
app.yaml (default instance)
application: myapp-uat
version: 1-7-0
runtime: python27
api_version: 1
instance_class: F1
automatic_scaling:
max_idle_instances: 2
max_pending_latency: 1s
threadsafe: true
- url: .*
script: run.myapp.app
and the new module:
application: myapp-uat
module: backend
version: 1.0.0
runtime: python27
api_version: 1
threadsafe: true
instance_class: B2
manual_scaling:
instances: 1
- url: /generator
script: run.myapp.app
login: admin
I have updated the app like this:
appcfg.py update src app.yaml backend.yaml
However looking at my modules in dashboard, I only see the default instance. Something isn't quite right here.

Ok I had done something quote silly. The correct way would be:
appcfg.py update src/app.yaml src/backend.yaml
and last but not least the dispatch needs to be called:
appcfg.py update_dispatch src

Related

Unable to set manual scaling on a google app engine service

I am unable to set manual scaling on a google app engine service (Previously called module). Using python on app engine.
app.yaml:
application: xxx-xxxx
version: 2
runtime: python27
module: xxbackend
instance_class: F4
api_version: 1
threadsafe: true
handlers:
- url: /taskcontroller\.py
script: TaskController.app
so on...
libraries:
- name: webapp2
version: latest
- name: numpy
version: "1.6.1"
- name: PIL
version: latest
inbound_services:
- warmup
xxbackend.yaml:
application: xxx-xxxx
version: uno
module: xxbackend
runtime: python27
api_version: 1
instance_class: B4
manual_scaling:
instances: 5
Even though I have specified instance class and manual scaling settings in xxbackend.yaml, the xxbackend instances are still autoscaled. Can someone point out where I am going wrong?
You have the same module: name is both yamls. app.yaml should not specify a module, so it uses the default module. So remove module: xxbackend from app.yaml. Otherwise, you are overriding the expected config.
Then, when you deploy, use a command like:
appcfg.py update app.yaml xxbackend.yaml
That deploys both updated yaml files.

Google App Engine Error at yaml_error

Following error as shown in screen-shot,occurs when i try to run my helloworld.py script in Google App engine from terminal.
#My Operating system:Ubuntu.14.#
And Here is my file app.yaml.
application: #My project Id.
version: 1
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /static
static_dir: static
- url: /
static_files: static/index.html
upload: static/index\.html
secure: always
- url: /_ah/spi/.*
script: helloworld_api.app
libraries:
- name: endpoints
version: 1.0
The Problem is that i can't deploy my code on local machine.
Any helps would be Appreciated.Thanks :)
I had check Online Yaml parser and it shows its Valid too.
You're missing the libraries line, the endpoints library are actually interpreted as part of the handlers list, which is incorrect.
Should look like this:
...
- url: /_ah/spi/.*
script: helloworld_api.app
libraries:
- name: endpoints
version: 1.0

MissingURLMapping: No URLMap entries found in application configuration

I'm new in GAE development, I've just created a simple API but I'm unable to run my app, because I keep getting the error No URLMap entries found in application configuration.
Here's my app.yaml file
application: gw2
version: 1
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /_ah/spi/.*
script: main.api_server
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
And here is my main.py file where I've declared the api_server variable
from google.appengine.ext import endpoints
import api
api_server = endpoints.api_server([api.GW2Service])
GW2Service inherits from remote.Service
Edit I'm using command line tools (Ubuntu 12.04)
Where's the mistake?
Thanks in advance. Eric ~H
You start server from the app or command line?
Try using "import endpoints" not from ... import endpoints
In app.yaml set endpoints version to latest.
Move GW2Service to main.py and test if server is ok. The problem might be generated by file name "api".

login: admin is simply ignored

I have this app.yaml:
application: xyz
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /static
static_dir: static
- url: /admin/.*
script: admin.app
login: admin
- url: /.*
script: main.app
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
when I access /admin/, both the dev server and appengine display the contents without asking for authentication. What gives?
I've run into this before. Try clearing your cookies. Clearing the cookies also helps if you accidentally forgot to check "log in as administrator" when the dev server prompts you for the fake login info.

Error uploading application Python Google App Engine

I have been trying to upload python Google app engine folder using windows command prompt. I have the app.yaml as well as a python file in the folder. But when I pass the following command in the Command Prompt:
appcfg.py --oauth2 update C:/Path/to/the/folder
I get this error.
appcfg.py: error: Directory does not contain an Project.yaml configuration file.
Where am I wrong and how should I proceed?
This is my app.yaml file:
application: myappid
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: sampleapp.app
libraries:
- name: lxml
version: "latest"
Check your shell syntax. I had this error message also, by not referencing the right project folder. Note the ending slash:
appcfg.py --oauth2 update C:/Path/to/the/folder/

Categories

Resources