Error running app on Google App Engine - python

I get this strange message error when trying to run an app using dev_appserver.py:
ERROR 2011-04-21 23:03:44,984 dev_appserver_main.py:407] Fatal error when loading
application configuration:
Value 'warmup' for key ??? does not match expression '^(mail|xmpp_message|rest|startup)$'
in "stackprinter/app.yaml", line 53, column 1
I have no idea what may be causing this, I hope someone is able to at least guide me in the right direction!
EDIT: Content of the app.yaml:
application: foo
version: 1b
runtime: python
api_version: 1
builtins:
- datastore_admin: on
inbound_services:
- warmup
handlers:
- url: /test.*
login: admin
script: gaeunit.py
- url: /favicon.ico
static_files: app/static/images/favicon.ico
upload: app/static/images/favicon.ico
- url: /robots.txt
static_files: app/static/docs/robots.txt
upload: app/static/docs/robots.txt
- url: /crossdomain.xml
static_files: app/static/docs/crossdomain.xml
upload: app/static/docs/crossdomain.xml
- url: /sitemap.xml
static_files: app/static/docs/sitemap.xml
upload: app/static/docs/sitemap.xml
- url: /javascripts
static_dir: app/static/javascripts
- url: /stylesheets
static_dir: app/static/stylesheets
- url: /images
static_dir: app/static/images
- url: /docs
static_dir: app/static/docs
- url: /deleted
static_dir: app/static/deleted
- url: /_ah/queue/deferred
script: $PYTHON_LIB/google/appengine/ext/deferred/handler.py
login: admin
- url: /_ereporter
script: $PYTHON_LIB/google/appengine/ext/ereporter/report_generator.py
login: admin
- url: /admin.*
script: application.py
login: admin
- url: /_ah/warmup
script: application.py
login: admin
- url: /.*
script: application.py
Thanks!

Solved!
The problem was that i had an old GAE SDK, Warmup requests were added in the 1.4.0 version.
Cheers

Related

Google App Engine - Endpoints Failure

I'm trying to deploy a gae project with endpoints but it's giving me errors that's should be happening.
I Don't Think there is anything wrong with my code but i keep getting this error when trying to deploy:
There is a /_ah/spi handler configured, but no Google Cloud Endpoints service was found in the app
my app.yaml :
application: app-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
# --- Handlers
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
secure: always
- url: /js
static_dir: static/js
- url: /img
static_dir: static/img
- url: /css
static_dir: static/bootstrap/css
- url: /fonts
static_dir: static/fonts
- url: /partials
static_dir: static/partials
- url: /_ah/spi/.*
script: game.api
secure: always
# --- Libraries
libraries:
- name: webapp2
version: "2.5.2"
- name: pycrypto
version: latest
- name: endpoints
version: latest
- name: jinja2
version: latest
and my game.py :
from datetime import datetime
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.api import memcache
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
# --- Setup Code
WEB_CLIENT_ID = 'app-id'
# --- Classes
class Hello(messages.Message):
"""String that stores a message."""
greeting = messages.StringField(1)
class TestOne(messages.Message):
''' TestOne message '''
msg = messages.StringField(1)
# --- API & Endpoints
#endpoints.api(name='whoamigame', version='v1')
class WhoAmIGameApi(remote.Service):
#endpoints.method(message_types.VoidMessage, TestOne, path='testone', http_method='GET', name='testonemethod')
def testOneM(self, req):
testOneMsgReturn = TestOne(msg='Test One...')
return testOneMsgReturn
# --- API
api = endpoints.api_server([WhoAmIGameApi])
Every time i try to deploy it, the endpoints fail. i'm not sure how to fix this issue. the code and syntax is perfect to me. everything is defined. the sdk fails every time.

google app engine wordpress update failure

I have come across a problem with the app.yaml setup for the installation of wordpress in GAE following this guide: https://developers.google.com/appengine/articles/wordpress
Using the guide, I copied the app.yaml (I also used the github project: https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project to check that my copy/paste was ok).
Whilst the test using dev_appserver.py works fine, the upload whinges with the message:
03:08 PM Getting current resource limits.
03:08 PM Scanning files on local disk.
03:08 PM Scanned 500 files.
03:08 PM Scanned 1000 files.
Error 400: --- begin server output ---
Error when loading application configuration:
Unable to assign value '__static__/wordpress/.*\.(htm|html|css|js)$' to attribute 'upload':
Value '__static__/wordpress/.*\.(htm|html|css|js)$' for upload does not match expression '^(?:(?!\^).*(?!\$).)$'
--- end server output ---
I am using the PHP SDK v1.8.9. My app.yaml is as follows:
application: blah-de-blah
version: wp
runtime: php
api_version: 1
handlers:
- url: /(.*\.(htm|html|css|js))$
static_files: wordpress/\1
upload: wordpress/.*\.(htm|html|css|js)$
application_readable: true
- url: /wp-content/(.*\.(ico|jpg|png|gif))$
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/.*\.(ico|jpg|png|gif)$
application_readable: true
- url: /(.*\.(ico|jpg|png|gif))$
static_files: wordpress/\1
upload: wordpress/.*\.(ico|jpg|png|gif)$
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
Something is up with the file type selector regex, but I'm not sure how to fix it. Someone came across it here: Google App Engine and Wordpress set up error - Windows 7 professional but it's still not fixed.
Does anyone have any light to shed on the subject?
Ok - I fixed it. The app.yaml needed modifying.
I think the instructions on the guide are a bit misleading - maybe something is out of date?
Here is my fixed app.yaml:
application: pooper-scooper-117
version: wp
runtime: php
api_version: 1
handlers:
- url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress/\1
upload: wordpress/.*\.(htm$|html$|css$|js$)
application_readable: true
- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/.*\.(ico$|jpg$|png$|gif$)
application_readable: true
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/\1
upload: wordpress/.*\.(ico$|jpg$|png$|gif$)
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
you shouldn't have to modify the app.yaml or submit a pull request(unless it's to change the documentation). Instead you need to get the latest version of the appengine SDK for PHP. As of mid January older versions won't work.

To host a static (HTML) website on Google App Engine, what should be in the app.yaml file?

Can I use this for uploading HTML pages?
app.yaml contents:
application: visualvidya
version: 1
runtime: python
api_version: 1
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css))
static_files: \1
upload: (.*\.(gif|png|jpg|ico|js|css))
A minimal handlers section for a static site might look something like this:
handlers:
- url: /
static_files: static/index.html
upload: static/index.html
- url: /
static_dir: static
Every site is different, so as Sean pointed out in the comments, you'll want to consult the documentation.

google appengine receive email error

I'm in trouble. I'm playing now for a long time with receiving email in google apps but in my application Logs only get this:
0.1.0.20 - - [13/Jun/2013:08:42:23 -0700] "POST /_ah/mail/contact#myappid.appspotmail.com HTTP/1.1" 200 0 - - "myappid.appspot.com" ms=69 cpu_ms=0 cpm_usd=0.100008 app_engine_release=1.8.1 instance=00c61b117c2fb913155f167711d12979c818fd
My mail handler script schould be this: mailmain.py
import logging
import webapp2
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
from google.appengine.api import mail
class LogSenderHandler(InboundMailHandler):
def receive(self, mail_message):
tobesent = mail_message.subject
logging.info("From: " + mail_message.sender)
logging.info("To:" + mail_message.to)
logging.info("Subject: " + mail_message.subject)
logging.info("Date: " + mail_message.date)
app = webapp2.WSGIApplication([LogSenderHandler.mapping()], debug=True)
and my app.yaml is this:
application: myappid
version: 1
runtime: python27
api_version: 1
threadsafe: no
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /_ah/mail/contact#myappid.appsportmail.com
script: mailmain.py
login: admin
- url: /.*
script: mailmain.py
inbound_services:
- mail
I've tried playing with the script so I have many versions, some ending in this (if this matters) but really nothing works:
def main():
app = webapp2.WSGIApplication([LogSenderHandler.mapping()], debug=True)
run_wsgi_app(application)
if __name__ == "__main__":
main()
I do have a favicon.ico uploaded as well.
Googled the error up for hours and hours and nothing works.
Here on Stackoverflow I've found for similar error message solutions such as correct recieve into receive but this is not the case here. I've copied other solutions as well, also this from GITHUB so I believe this question is not a duplicate.
You mixing up CGI and WSGI. See Python27 getting started.
Docs : https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp
Yaml update :
application: myappid
version: 1
runtime: python27
api_version: 1
threadsafe: false
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /_ah/mail/contact#myappid.appsportmail.com
script: mailmain.app
login: admin
- url: /.*
script: mailmain.app
inbound_services:
- mail
With WSGI you do not need the run_wsgi_app stuff.
And some background about CGI / WSGI: http://blog.notdot.net/2011/10/Migrating-to-Python-2-7-part-1-Threadsafe

Issue of updating GAE python application

When updating my app into GAE by using the following command:
python appcfg.py update /home/tom/workspace/DjangoProject
I got an error message:
mapping values are not allowed here
in "/home/tom/workspace/DjangoProject/app.yaml", line 6, column 9
Here is my yaml:
application:myapp
version:1
runtime:python
api_version:1
handlers:
- url:/
script:home.py
- url:/index\.html
script: home.py
- url: /stylesheets
static_dir: stylesheets
- url: /(.*\.(gif|png|jpg))
static_files: static/\1
upload: static/(.*\.(gif|png|jpg))
- url: /admin/.*
script: admin.py
login: admin
- url: /.*
script: not_found.py
Can anybody help me?
I changed my yaml:
application:myapp
version:1
runtime:python
api_version:1
handlers
- url:/
script:home.py
- url:/index\.html
script:home.py
- url:/stylesheets
static_dir:stylesheets
- url:/(.*\.(gif|png|jpg))
static_files:static/\1
upload:static/(.*\.(gif|png|jpg))
- url:/admin/.*
script:admin.py
login:admin
- url:/.*
script:not_found.py
Now the error meesage is :
google.appengine.api.appinfo_errors.MissingURLMapping: No URLMap entries found in application configuration
After a colon , there has to be space . That's why it was not able to parse your app.yaml.
Try this
application: myapp
version: 1
runtime: python
api_version: 1
handlers:
- url: /
script: home.py
- url: /index\.html
script: home.py
- url: /stylesheets
static_dir: stylesheets
- url: /(.*\.(gif|png|jpg))
static_files: static/\1
upload: static/(.*\.(gif|png|jpg))
- url: /admin/.*
script: admin.py
login: admin
- url: /.*
script: not_found.py

Categories

Resources