Problems using Go App Engine behind a proxy - google-app-engine

I'm trying to run the example application hosted at: https://github.com/googlesamples/cloud-polymer-go, but when running it behind a proxy, I get the following errors:
$ goapp serve dispatch.yaml frontend/app.yaml backend/app.yaml
INFO 2015-10-13 13:04:19,461 devappserver2.py:763] Skipping SDK update check.
INFO 2015-10-13 13:04:19,526 api_server.py:205] Starting API server at: http://localhost:59441
INFO 2015-10-13 13:04:19,527 dispatcher.py:185] Starting dispatcher running at: http://localhost:8080
INFO 2015-10-13 13:04:19,529 dispatcher.py:197] Starting module "frontend" running at: http://localhost:8081
INFO 2015-10-13 13:04:19,534 dispatcher.py:197] Starting module "default" running at: http://localhost:8082
INFO 2015-10-13 13:04:19,534 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO 2015-10-13 13:04:23,859 module.py:786] frontend: "GET / HTTP/1.1" 304 -
INFO 2015-10-13 13:04:23,870 module.py:786] frontend: "GET /elements/post-list.html HTTP/1.1" 304 -
INFO 2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-service.html HTTP/1.1" 304 -
INFO 2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-form.html HTTP/1.1" 304 -
INFO 2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-card.html HTTP/1.1" 304 -
WARNING 2015-10-13 13:04:26,344 dispatcher.py:762] Skipping dispatch.yaml rules because /_ah/api/static/proxy.html is not a dispatchable path.
socket.error 101
Traceback (most recent call last):
File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
req.respond()
File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2117, in respond
for chunk in response:
File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 121, in __call__
yield self.dispatch(request, start_response)
File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 138, in dispatch
start_response)
File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 172, in dispatch_non_api_requests
return dispatch_function(request, start_response)
File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 212, in handle_api_static_request
response, body = discovery_api.get_static_file(request.relative_url)
File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/discovery_api_proxy.py", line 113, in get_static_file
connection.request('GET', path, None, {})
File "/usr/lib/python2.7/httplib.py", line 979, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 797, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1178, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 101] Network is unreachable
The variables:
$ echo $http_proxy
http://asusis-isa2.personal.com.py:8080/
$ echo $https_proxy
http://asusis-isa2.personal.com.py:8080/
Are correctly set.
I works with a direct Internet connection.
I'm under Ubuntu 14.04.

EDIT Looks like there is a defect in the SDK around using a proxy with URLFetch.
https://code.google.com/p/googleappengine/issues/detail?id=544
Try setting the uppercase versions of those environment variables, HTTP_PROXY and HTTPS_PROXY. The gcloud launcher requires them that way so I assume goapp does as well.
Using an HTTP proxy
If you are running gcloud preview app behind an HTTP proxy, you must
tell gcloud preview app the name of the proxy. To set an HTTP proxy
for gcloud preview app, set the http_proxy and https_proxy environment
variables. Note that you must specify the full path for the app.yaml
file.
Using Windows (in Command Prompt):
$ set HTTP_PROXY=http://cache.mycompany.com:3128
$ set HTTPS_PROXY=http://cache.mycompany.com:3128
$ gcloud preview app deploy DIRECTORY/app.yaml
Using the command line in Mac OS X (in Terminal) or Linux:
$ export HTTP_PROXY="http://cache.mycompany.com:3128"
$ export HTTPS_PROXY="http://cache.mycompany.com:3128"
$ gcloud preview app deploy DIRECTORY/app.yaml

Related

invalid ELF header in Apache Beam python module on Google Cloud

I'm encountering an issue when trying to run a simple BigQuery ETL pipeline with a flask app on Google App Engine in the flex environment.
It works when I run it locally, which I do by first starting it with flask run or gunicorn -b :$PORT main:app and then going to an endpoint in my browser, doing stuff on the page, and submitting a form. The POST handler for the page then invokes the Apache Beam pipeline. All of that works fine.
But when I deploy it with gcloud app deploy and try to access any endpoint I get a 502 error and the logs show the following:
2018-10-04 14:03:39 default[20181003t232620] Traceback (most recent call last): File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker worker.init_process() File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process self.load_wsgi() File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi self.wsgi = self.app.wsgi() File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load return self.load_wsgiapp() File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp return util.import_app(self.app_uri) File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app __import__(module) File "/home/vmagent/app/main.py", line 15, in <module> import rw_bigquery_etl File "/home/vmagent/app/rw_bigquery_etl.py", line 9, in <module> import apache_beam as beam File "lib/apache_beam/__init__.py", line 88, in <module> from apache_beam import coders File "lib/apache_beam/coders/__init__.py", line 19, in <module> from apache_beam.coders.coders import * File "lib/apache_beam/coders/coders.py", line 30, in <module> from apache_beam.coders import coder_impl ImportError: lib/apache_beam/coders/coder_impl.so: invalid ELF header
2018-10-04 14:03:39 default[20181003t232620] [2018-10-04 14:03:39 +0000] [8] [INFO] Worker exiting (pid: 8)
2018-10-04 14:03:39 default[20181003t232620] [2018-10-04 14:03:39 +0000] [1] [INFO] Shutting down: Master
2018-10-04 14:03:39 default[20181003t232620] [2018-10-04 14:03:39 +0000] [1] [INFO] Reason: Worker failed to boot.
With the actual error being from apache_beam.coders import coder_impl ImportError: lib/apache_beam/coders/coder_impl.so: invalid ELF header
I had lots of issues with dependencies recently, so I just ran pip freeze > requirements.txt in the project folder, giving me this (pastebin). I've installed this to a lib folder in the project folder and have the line
vendor.add('lib') in appengine_config.py. Also, this is my app.yaml:
runtime: python
api_version: 1
threadsafe: true
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 2
handlers:
- url: /.*
script: main.app
login: required
How can I resolve this issue, or go about troubleshooting it?
I'm new to Google Cloud and pip, so I'm still trying to understand how the cloud environment works, especially with python packages.
Consolidating python dependencies/requirements for apache beam is uniquely frustrating.
It would be helpful to see your
pipeline config
how you launch your pipeline locally
how you launch your pipeline remotely (your request handler code that launches it)
where your pipeline code sits relative to your project root
But it sounds like that requirements.txt you set up is the requirements.txt for your gae flex instance but not getting used for your dataflow worker. Possibly you supplied your requirements.txt as a commandline option when running locally and your server code is not supplying that same option.
Look at my answer here:
https://stackoverflow.com/a/51312281/4458510
I've had the best luck using a setup.py for my pipeline's dependencies, like they do in this example: https://github.com/apache/beam/tree/master/sdks/python/apache_beam/examples/complete/juliaset

dev_appserver.py issue with cloud endpoints framework and grpcio

When attempting to pull in the grpcio library along with Cloud Endpoints Framework, it causes an error when running it through dev_appserver.py. When these changes are pushed to Google Cloud Platform App Engine the error does not present itself.
I have tried changing the versions of google-endpoints, grpcio, and six, but none of the combinations resolved the error. I have run into the error on both Windows and Ubuntu.
Error
Traceback (most recent call last):
File "C:\Users\jwesley\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Users\jwesley\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "C:\Users\jwesley\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\main.py", line 19, in <module>
import endpoints
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\endpoints\__init__.py", line 27, in <module>
from .apiserving import *
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\endpoints\apiserving.py", line 76, in <module>
from endpoints_management.control import client as control_client
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\endpoints_management\__init__.py", line 17, in <module>
from . import auth, config, control, gen
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\endpoints_management\control\__init__.py", line 19, in <module>
from ..gen import servicecontrol_v1_messages as sc_messages
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\endpoints_management\gen\servicecontrol_v1_messages.py", line 23, in <module>
from apitools.base.py import encoding
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\apitools\base\py\__init__.py", line 21, in <module>
from apitools.base.py.base_api import *
File "C:\Users\jwesley\code_store\gcp_python_sample\python-docs-samples\appengine\standard\endpoints-frameworks-v2\echo\lib\apitools\base\py\base_api.py", line 27, in <module>
from six.moves import http_client
ImportError: No module named moves
Recreating the issue
Make sure you have Google Cloud SDK installed.
Clone the python-docs-samples repository:
https://github.com/GoogleCloudPlatform/python-docs-samples.git
Navigate into echo sample
cd python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo
Start dev_appserver
dev_appserver.py app.yaml
Send a POST test to make sure it works.
curl -d '{"content":"time"}' -H "Content-Type: application/json" -X POST http://localhost:8080/_ah/api/echo/v1/echo
With the echo application working, now install grpcio with the version GCP uses.
pip install grpcio==1.0.0
Edit the app.yaml file to include the grpcio library, so your file will look like this.
runtime: python27
threadsafe: true
api_version: 1
basic_scaling:
max_instances: 2
#[START_EXCLUDE]
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^(.*/)?setuptools/script \(dev\).tmpl$
#[END_EXCLUDE]
handlers:
# The endpoints handler must be mapped to /_ah/api.
- url: /_ah/api/.*
script: main.api
libraries:
- name: pycrypto
version: 2.6
- name: ssl
version: 2.7.11
- name: grpcio
version: "latest"
# [START env_vars]
env_variables:
# The following values are to be replaced by information from the output of
# 'gcloud endpoints services deploy swagger.json' command.
ENDPOINTS_SERVICE_NAME: YOUR-PROJECT-ID.appspot.com
ENDPOINTS_SERVICE_VERSION: 2016-08-01r0
# [END env_vars]
Start dev_appserver.py again.
dev_appserver.py app.yaml
Send the POST again.
curl -d '{"content":"time"}' -H "Content-Type: application/json" -X POST http://localhost:8080/_ah/api/echo/v1/echo
The error I placed above should show up in the output of the dev_appserver.py.

Couldn't connect to the Docker daemon due to an SSL

I'm trying to deploy Managed VM (Python) on Google App / Compute Engine with command:
gcloud --verbosity debug preview app deploy ./app.yaml --set-default
during deployment VM instance is created but it exits on error (here is paste of last few lines of listing):
DEBUG: Display disabled.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
DEBUG: Loaded Command Group: ['gcloud', 'compute', 'copy_files']
DEBUG: Detected docker environment variables: DOCKER_HOST=tcp://104.197.50.238:2376, DOCKER_CERT_PATH=../../../../../tmp/tmpPbKmOs, DOCKER_TLS_VERIFY=True
INFO: Starting new HTTPS connection (1): 104.197.50.238
DEBUG: Failed to connect to Docker daemon due to an SSL problem: [Errno 1] _ssl.c:523: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon due to an SSL problem.
Traceback (most recent call last):
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 591, in Execute
result = args.cmd_func(cli=self, args=args)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1191, in Run
resources = command_instance.Run(args)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/app_commands/deploy.py", line 208, in Run
implicit_remote_build)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/deploy_command_util.py", line 137, in BuildAndPushDockerImages
with docker_util.DockerHost(cli, version_id, remote) as docker_client:
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/docker_util.py", line 215, in __enter__
return containers.NewDockerClient(local=(not self._remote), **kwargs)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 313, in NewDockerClient
'Couldn\'t connect to the Docker daemon due to an SSL problem.' + msg)
DockerDaemonConnectionError: Couldn't connect to the Docker daemon due to an SSL problem.
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon due to an SSL problem.
apparently there is problem with SSL but I have no idea how to solve it, and I'm quite desperate at the moment :)
I have:
Docker version 1.8.2, build 0a8c2e3
Boot2Docker-cli version: v1.8.0 Git commit: 9a26066
Google Cloud SDK 0.9.79
app 2015.09.23
app-engine-java 1.9.26
app-engine-python 1.9.26
bq 2.0.18
bq-nix 2.0.18
core 2015.09.23
core-nix 2015.09.03
gcloud 2015.09.21
gsutil 4.15
gsutil-nix 4.14
preview 2015.09.21
OpenSuse 13.2
OpenSSL 1.0.1k-fips 8 Jan 2015
I would very much appreciate help of any kind.
EDIT:
app.yaml
module: default
runtime: python27
api_version: 1
threadsafe: yes
vm: true
resources:
cpu: .5
memory_gb: 1.3
manual_scaling:
instances: 1
handlers:
- url: .*
script: main.app
Are you using homebrew Python on OS X? If so, there's an existing bug for OpenSSL and Docker here.
The easiest way around this is to temporary use a virtualenv with system python.
pip install virtualenv
virtualenv ~/system-python-env
source ~/system-python-env
gcloud preview app deploy ...
You can get at a short-lived SSL with "gcloud docker --authorize-only". Then immediately do your "gcloud preview app deploy..".
gcloud docker --authorize-only
gcloud preview app deploy app.yaml --promote

Google App Engine Managed VMs for Go: AttributeError: 'module' object has no attribute 'CleanableContainerName'

On a Mac OS X, trying to turn on the debug flag or to run the hello world test project for Go Managed VMs, I am getting the following error: AttributeError: 'module' object has no attribute 'CleanableContainerName'
Any ideas?
Full error log:
orcaman$ $(boot2docker shellinit)
Writing /Users/orcaman/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/orcaman/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/orcaman/.boot2docker/certs/boot2docker-vm/key.pem
orcaman$ gcloud --verbosity debug preview app setup-managed-vms
DEBUG: Running gcloud.preview.app.setup-managed-vms with _Args({'base_image_bucket': 'containers-prod',
'docker_host': None,
'format': None,
'h': None,
'help': None,
'image_version': 'latest',
'markdown': None,
'project': None,
'quiet': None,
'shell': None,
'user_output_enabled': None,
'verbosity': 'debug'}).
DEBUG: Detected docker environment variables: DOCKER_HOST=tcp://192.168.59.103:2376, DOCKER_CERT_PATH=/Users/orcaman/.boot2docker/certs/boot2docker-vm, DOCKER_TLS_VERIFY=1
INFO: Starting new HTTPS connection (1): 192.168.59.103
DEBUG: "GET /v1.10/_ping HTTP/1.1" 200 2
INFO: Looking for image_id for image with tag google/docker-registry
DEBUG: "GET /v1.10/images/json?filter=google%2Fdocker-registry&only_ids=1&all=0 HTTP/1.1" 200 253
DEBUG: Found Cloud SDK root: /Users/orcaman/google-cloud-sdk
Select the runtime to download the base image for:
[1] Go
[2] Java
[3] Python27
[4] All
Please enter your numeric choice (4): 1
DEBUG: Detected docker environment variables: DOCKER_HOST=tcp://192.168.59.103:2376, DOCKER_CERT_PATH=/Users/orcaman/.boot2docker/certs/boot2docker-vm, DOCKER_TLS_VERIFY=1
INFO: Starting new HTTPS connection (1): 192.168.59.103
DEBUG: "GET /v1.10/_ping HTTP/1.1" 200 2
Pulling base images for runtimes [go] from Google Cloud Storage
INFO: Refreshing access_token
DEBUG: Copy /Users/orcaman/.config/gcloud/legacy_credentials/orhiltch#gmail.com/.boto to /var/folders/dv/g8_pdljx49gdtbs25_1ch7vm0000gn/T/tmp7imPhg...
DEBUG: Copy /Users/orcaman/google-cloud-sdk/docker/true-asm to /var/folders/dv/g8_pdljx49gdtbs25_1ch7vm0000gn/T/tmp7imPhg...
Traceback (most recent call last):
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 177, in <module>
main()
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 173, in main
_cli.Execute()
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 409, in Execute
post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 928, in Run
result = command_instance.Run(args)
File "/Users/orcaman/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/setup_managed_vms.py", line 39, in Run
args.image_version)
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/pull.py", line 54, in PullBaseDockerImages
util.PullSpecifiedImages(docker_client, image_names, version, bucket)
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/util.py", line 217, in PullSpecifiedImages
with credentials.CredentialsContainer(docker_client) as creds, (
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/credentials.py", line 114, in __enter__
self.Start()
File "/Users/orcaman/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/credentials.py", line 95, in Start
name=containers.CleanableContainerName(
AttributeError: 'module' object has no attribute 'CleanableContainerName'
Docker/Boot2docker version:
bash-3.2$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8
gcloud version:
gcloud version
Google Cloud SDK 0.9.42
app 2015.01.06
app-engine-go-darwin-x86_64 1.9.17
app-engine-java 1.9.17
app-engine-managed-vms 2014.11.03
app-engine-python 1.9.17
bq 2.0.18
bq-nix 2.0.18
compute 2015.01.06
core 2015.01.06
core-nix 2014.10.20
dns 2015.01.06
gcutil 1.16.5
gcutil-nix 1.16.5
gsutil 4.7
gsutil-nix 4.6
preview 2015.01.06
preview-extensions-darwin-x86_64 0.7.0
sql 2015.01.06
UPDATE:
The fix for gcloud is now available in the latest version and this issue should be resolved.
Previous Post:
As a temporary workaround you can run:
gcloud components restore
There may be a bug in the latest gcloud update. I saw the same error after updating - but is working now after running the above command.

Google App Engine Guestbook application gives error

I upload the Google App Engine application which is at the url developers.google.com/appengine/docs/python/memcache/usingmemcache#Memcache
When I run the application on Google App Engine Launcher, it runs but the website shows:
(First error is there us no Python "PIL" module but I am not using image. Could you please suggest what is causing the error?
*** Running dev_appserver with the following flags:
--skip_sdk_update_check=yes --port=13080 --admin_port=8005
Python command: /usr/bin/python2.7
INFO 2014-01-17 20:43:22,217 devappserver2.py:660] Skipping SDK update check.
WARNING 2014-01-17 20:43:22,222 api_server.py:331] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2014-01-17 20:43:22,226 api_server.py:138] Starting API server at: localhost:55385
INFO 2014-01-17 20:43:22,230 dispatcher.py:171] Starting module "default" running at: localhost:13080
INFO 2014-01-17 20:43:22,238 admin_server.py:117] Starting admin server at: localhost:8005
ERROR 2014-01-17 20:43:24,601 wsgi.py:262]
Traceback (most recent call last):
File "/Users/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 239, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 301, in _LoadHandler
raise err
ImportError: <module 'guestbookw2' from '/Users/guestbookw2/guestbookw2.pyc'> has no attribute application
INFO 2014-01-17 20:43:24,607 module.py:617] default: "GET / HTTP/1.1" 500 -
ERROR 2014-01-17 20:43:24,727 wsgi.py:262]
Traceback (most recent call last):
File "/Users/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 239, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 301, in _LoadHandler
raise err
ImportError: <module 'guestbookw12' from '/Users/guestbookw2/guestbookw2.pyc'> has no attribute application
INFO 2014-01-17 20:43:24,732 module.py:617] default: "GET /favicon.ico HTTP/1.1" 500 -
Make sure that you have the following files in the path that you are uploading your application from:
index.yaml (auto-generated; you don't need to add or change anything in here at this point).
favicon.ico (in the correct format; should be 16x16 or 32x32 pixels if I remember correctly).
main.py (mapping all the paths in your web-site; example given below):
from webapp2 import WSGIApplication
from Server import MainRequestHandler
from Server import SomeRequestHandler
from Server import OtherRequestHandler
app = WSGIApplication([
('/' ,MainRequestHandler),
('/abc' ,SomeRequestHandler),
('/def' ,SomeRequestHandler),
('/xyz' ,OtherRequestHandler),
])
app.yaml (with the following contents; using <...> where you need to set a value):
application: <the app-id you chose when use signed in for GAE>
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.1" // you might need to change this as well
Note:
if you wish to avoid handling 'favicon.ico' request, then you must remove the reference in file 'app.yaml'.
Supplemental:
You will need to implement all the request handlers imported in 'main.py'.
In the example above, 'main.py' expects to find them in a Python module named 'Server'.
Each request handler must inherit class RequestHandler, imported from webapp2.
Supplemental #2:
In order to solve the 'PIL' issue (had a similar problem if memory serves correctly), simply install it.
From a Windows command line, enter: pip install pil.

Resources