Google App Engine Launcher - localhost shows a blank page. (Python2.7) - google-app-engine

I'm on Win 8 x64, Python 2.7
Steps I followed:
Downloaded, installed python.
Downloaded, installed Google App Engine Launcher.
Created new application with name helloworld-kg on the app engine site.
In Launcher, File > Create New Application > entered the name of app and browsed to the directory.
Hit Run, wait for light to turn green.
Click Browser. Get a blank page on localhost:8080
Here's the log from launcher:
2013-04-05 20:54:10 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', u'C:\\Users\\Karan\\Desktop\\helloworld-kg\\helloworld-kg']"
INFO 2013-04-05 20:54:12,068 devappserver2.py:401] Skipping SDK update check.
WARNING 2013-04-05 20:54:12,078 api_server.py:328] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-04-05 20:54:12,088 api_server.py:152] Starting API server at: http://localhost:55309
INFO 2013-04-05 20:54:12,091 dispatcher.py:98] Starting server "default" running at: http://localhost:8080
INFO 2013-04-05 20:54:12,092 admin_server.py:117] Starting admin server at: http://localhost:8000
INFO 2013-04-05 20:54:58,167 api_server.py:517] Applying all pending transactions and saving the datastore
INFO 2013-04-05 20:54:58,167 api_server.py:520] Saving search indexes
2013-04-05 20:54:58 (Process exited with code 0)
2013-04-05 20:55:01 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', u'C:\\Users\\Karan\\Desktop\\helloworld-kg\\helloworld-kg']"
INFO 2013-04-05 20:55:03,788 devappserver2.py:401] Skipping SDK update check.
WARNING 2013-04-05 20:55:03,799 api_server.py:328] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-04-05 20:55:03,809 api_server.py:152] Starting API server at: http://localhost:55354
INFO 2013-04-05 20:55:03,811 dispatcher.py:98] Starting server "default" running at: http://localhost:8080
INFO 2013-04-05 20:55:03,813 admin_server.py:117] Starting admin server at: http://localhost:8000
INFO 2013-04-05 20:56:02,868 api_server.py:517] Applying all pending transactions and saving the datastore
INFO 2013-04-05 20:56:02,869 api_server.py:520] Saving search indexes
2013-04-05 20:56:02 (Process exited with code 0)
2013-04-05 20:56:09 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', u'C:\\Users\\Karan\\Desktop\\helloworld-kg\\helloworld-kg']"
INFO 2013-04-05 20:56:11,631 devappserver2.py:401] Skipping SDK update check.
WARNING 2013-04-05 20:56:11,644 api_server.py:328] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-04-05 20:56:11,653 api_server.py:152] Starting API server at: http://localhost:55397
INFO 2013-04-05 20:56:11,655 dispatcher.py:98] Starting server "default" running at: http://localhost:8080
INFO 2013-04-05 20:56:11,657 admin_server.py:117] Starting admin server at: http://localhost:8000
My app.yaml file contents:
application: helloworld-kg
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: helloworld-kg.app
And the helloworld-kg.py file contents:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, webapp2 World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
I'm new with Python and GAE. This is for Udacity's CS 253 course.
Possible solutions?

Got it to work. Apparently, GAEL was creating a new app for me. A re-install solved the problem. App is working fine now!

Related

Google Cloud App engine after Travis building

I wanted to host my spring boot application on the Google App engine after building on Travis.
I have configured the following in my .travis.yml but I'm always getting the following error from GCP:
Step #0: Exception in thread "main" com.google.cloud.runtimes.builder.exception.ArtifactNotFoundException: No deployable artifacts were found. Unable to proceed.
I dont know how to fix this problem in my code
sudo: false
language: java
jdk:
- oraclejdk8
cache:
directories:
- "$HOME/.m2/repository"
before_deploy:
- mv target/healthcare-1.0.jar target/healthcare.jar
deploy:
provider: gae
skip_cleanup: true
keyfile: secret.json
project: healthcare-196408
file: target/healthcare.jar
before_install:
- chmod +x mvnw
- openssl aes-256-cbc -K $encrypted_07ec618bb998_key -iv $encrypted_07ec618bb998_iv
-in secret.json.enc -out secret.json -d
My app.yaml file:
runtime: java
env: flex
handlers:
- url: /.*
script: this field is required, but ignored
It seems like Travis isnt uploading my .Jar at all, but how can I fix this problem?
I have tried to build it as docker with the same result:
Invalid or corrupt jarfile /app.jar --from docker

Issues while creating and deploying an app to google app engine

I am running into this error while deploying my app to google app-engine.
Error:
Error 404: --- begin server output ---
This application does not exist (project_id=u'homework-153002'). To create an App Engine application in this project, run "gcloud beta app create" in your console.
--- end server output ---
When I try to create the app using the above command this is what I see:
ERROR: (gcloud.beta.app.create) You do not have permission to access app [homework] (or it may not exist): Operation not allowed
I have created a project in google developers api website with project_name of "homework" and random id. Here is the url for that:
https://console.developers.google.com/apis/library?project=homework-153002
Any pointers on what I might be doing wrong here?
This is my yaml file:
application: homework-153002
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
Your app URL indicates your app ID is homework-153002, but the
error message indicates you're connecting to an ap called homework - likely not your own, hence the permission issue.
Simply correcting the app ID in your deployment command and/or your app.yaml file should suffice.
As your comment indicates, for your case (gcloud deployment) the solution was:
gcloud config set project homework-153002
gcloud beta app create
appcfg.py update homework/

Google app engine: (devappserver2.py:835) No default module found.

I am trying to run a service with in google app engine. I used this command to run the local app engine development server gor Go and run the admin service.
goapp serve -admin_port 8081 admin
But it gives me error of "No default module found. Ignoring."
parminder_sohal#compact-window-137215:~/conference-central/default$ goapp serve -admin_port 8081 admin
INFO 2016-07-15 21:00:25,850 devappserver2.py:769] Skipping SDK update check.
INFO 2016-07-15 21:00:25,949 api_server.py:205] Starting API server at: http://0.0.0.0:57478
INFO 2016-07-15 21:00:25,974 dispatcher.py:197] Starting module "admin" running at: http://0.0.0.0:8080
INFO 2016-07-15 21:00:25,975 admin_server.py:116] Starting admin server at: http://0.0.0.0:8081
WARNING 2016-07-15 21:00:25,975 devappserver2.py:835] No default module found. Ignoring.

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

How to create local copy of GAE datastore?

I want to make client version of GAE app that store exact data of online version.(myapp.appspot.com) If i can use sdk instead, is any library or tools to sync online and sdk version? I try using bulkloader but i can't load downloaded data to local SDK? Please help.
As explained in this article (link updated, thanks to Zied Hamdi)
You simply need to enable the remote api
builtins:
- remote_api: on
Update your application then run the following commands:
appcfg.py download_data -A s~YOUR_APP_NAME --url=http://YOUR_APP_NAME.appspot.com/_ah/remote_api/ --filename=data.csv
appcfg.py --url=http://localhost:8080/_ah/remote_api/ --filename=data.csv upload_data .
Edit for After April 12th 2016 on Latest AppEngine SDK:
The above works for SDK version 1.9.0 and before. However with the depreciation of ClientLogin, the above will cause an error of
03:13 PM Uploading data records.
[INFO ] Logging to bulkloader-log-20160909.151355
[INFO ] Throttling transfers:
[INFO ] Bandwidth: 250000 bytes/second
[INFO ] HTTP connections: 8/second
[INFO ] Entities inserted/fetched/modified: 20/second
[INFO ] Batch Size: 10
[INFO ] Opening database: bulkloader-progress-20160909.151355.sql3
2016-09-09 15:13:55,175 INFO client.py:578 Refreshing due to a 401 (attempt 1/2)
2016-09-09 15:13:55,176 INFO client.py:804 Refreshing access_token
2016-09-09 15:13:55,312 INFO client.py:578 Refreshing due to a 401 (attempt 2/2)
Recommended by Anssi here, we can use the API server directly without running into this error. For a typical dev_appserver startup you get the following output
INFO 2016-09-09 19:27:11,662 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO 2016-09-09 19:27:11,899 api_server.py:205] Starting API server at: http://localhost:52497
INFO 2016-09-09 19:27:11,905 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-09-09 19:27:11,918 admin_server.py:116] Starting admin server at: http://localhost:8000
instead of the above for upload use the API port, in this case
appcfg.py --url=http://localhost:52497/_ah/remote_api/ --filename=data.csv upload_data .
See the docs for details on how to download and upload your entire datastore. Simply bulk download from production, then bulk upload to your local datastore.
Bear in mind, however, that the local datastore is not designed to handle large volumes of data - you may run into performance or memory issues.

Resources