GoogleAppEngineLauncher deploy fails: appcfg.py has finished with exit code 0 *** - google-app-engine

My GoogleApp worked like a charm for a couple of weeks. For every update, I used GoogleAppEngineLauncher (from Mac OS X 10.10) to deploy it again. Never had problems.
Today, while I was deploying the app after a small fix, it was taking too much time, so I tried to abort and re-try. Terrible idea.
Now every time I try to deploy the app, it gives me this output:
*** Running appcfg.py with the following flags:
--oauth2_credential_file=~/.appcfg_oauth2_tokens update
12:25 AM Application: appname; version: 1
12:25 AM Host: appengine.google.com
12:25 AM Starting update of app: appname, version: 1
12:25 AM Getting current resource limits.
12:25 AM Scanning files on local disk.
12:25 AM Cloning 1 static file.
12:25 AM Cloning 6 application files.
12:25 AM Compilation starting.
12:25 AM Compilation completed.
12:25 AM Starting deployment.
12:25 AM Checking if deployment succeeded.
12:25 AM Deployment successful.
12:25 AM Checking if updated app version is serving.
12:25 AM Completed update of app: appname, version: 1
12:25 AM Uploading index definitions.
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 0 ***
I used the Make Symlinks option but it didn't help. I also rollbacked manually, from cmd:
appcfg.py rollback Users/bran/Documents/Projects/appname
The output was:
12:54 AM Application: appname
12:54 AM Host: appengine.google.com
12:54 AM Rolling back the update.
I have found a couple of other related/similar questions, but the answers didn't solve my problem. Moreover, the other users didn't abort the deploying process, that is why I believe there is another reason why someone could get this error. I also tried to create another GoogleApp and copying the files, as well as uninstalling and re-installing GoogleAppEngineLauncher again. Same result. Please help, I don't know what else can I try to restore my previously working app. Maybe I didn't uninstall the GoogleAppEngineLauncher properly?
Also, I don't think the problem is in the app code, because I tried to revert the app back to its previous (deployed) status, but the error is still there.
edit: I tried to use the Make Symlinks option again, and it gave me the following output/error:
*** Running appcfg.py with the following flags:
--oauth2_credential_file=~/.appcfg_oauth2_tokens update
07:17 PM Application: appname; version: 1
07:17 PM Host: appengine.google.com
07:17 PM Starting update of app: astribot, version: 1
07:17 PM Getting current resource limits.
2016-08-03 19:18:17,605 ERROR appcfg.py:2411 An error occurred processing file '': EOF occurred in violation of protocol (_ssl.c:590). Aborting.
Traceback (most recent call last):
File "google_appengine/appcfg.py", line 133, in <module>
run_file(__file__, globals())
File "google_appengine/appcfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5497, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine- default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5488, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2966, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5144, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3876, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3929, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3814, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2401, in DoUpload
self.error_fh)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 497, in GetResourceLimits
resource_limits.update(_GetRemoteResourceLimits(logging_context))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 467, in _GetRemoteResourceLimits
yaml_data = logging_context.Send('/api/appversion/getresourcelimits')
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1709, in Send
result = self.rpcserver.Send(url, payload=payload, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 246, in Send
url, method=method, body=payload, headers=headers)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/oauth2client/oauth2client/client.py", line 569, in new_request
redirections, connection_type)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/httplib2/__init__.py", line 1584, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/httplib2/__init__.py", line 1332, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/httplib2/__init__.py", line 1268, in _conn_request
conn.connect()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/httplib2/__init__.py", line 1014, in connect
self.disable_ssl_certificate_validation, self.ca_certs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/httplib2/httplib2/__init__.py", line 80, in _ssl_wrap_socket
cert_reqs=cert_reqs, ca_certs=ca_certs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 911, in wrap_socket
ciphers=ciphers)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__
self.do_handshake()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:590)
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***

Related

What should go in the Dockerfile when using Rasa with Google Cloud Platform

I’m using Google Cloud Platform and Google App Engine (flexible) for my Rasa Opensource chatbot.
I've downloaded the Google Cloud SDK to my local machine and deployed the chatbot using gcloud app deploy to App Engine (I think I'm right that this creates a docker image).
App Engine requires a Dockerfile and an app.yaml file. I just wasn't sure what should go in the Dockerfile. And having some trouble point to the model endpoint where it doesn't think its a zip file.
The Dockerfile looks like:
FROM rasa/rasa
ENV BOT_ENV=production
COPY . /var/www
WORKDIR /var/www
RUN pip install rasa
ENTRYPOINT [ "rasa", "run", "-m", "./models", "-vv", "--enable-api", "--endpoints", "endpoints.yml", "--credentials", "credentials.yml", "-p", "8080"]
C:\Users\xxxxxxxx\Desktop\xxxxxxxxx>gcloud app deploy --version chatbot15
Services to deploy:
descriptor: [C:\Users\xxxxxx\Desktop\xxxxxxxxx\app.yaml]
source: [C:\Users\xxxxxx\Desktop\xxxxxxxx]
target project: [xxxxx-xxxxxxx]
target service: [default]
target version: [chatbot15]
target url: [https://xxxxxxxx.appspot.com]
Do you want to continue (Y/n)? y
Beginning deployment of service [default]...
Building and pushing image for service [default]
Started cloud build [.
To see logs in the Cloud Console: https://console.cloud.google.com/gcr/builds/xxxxxx41f1f-c289-xxxxxxx-9ba1-xxxxxxxxxxx]
------------------------------------------------- REMOTE BUILD OUTPUT --------------------------------------------------
starting build "xxxxxx41f1f-c289-xxxxxxx-9ba1-xxxxxxxxxxx]"
FETCHSOURCE
Fetching storage object: gs://staging.xxxxxxxxxx.appspot.com/us.gcr.io/xxxxxxxxxx/appengine/default.chatbot15:latest#1xxxxxxxxxxx0
Copying gs://staging.xxxxxxxxxxx.appspot.com/us.gcr.io/xxxxxxxxxx/appengine/default.chatbot15:latest#158xxxxxxxxxx2560...
\ [1 files][ 24.3 MiB/ 24.3 MiB]
Operation completed over 1 objects/24.3 MiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon 38.15MB
Step 1/6 : FROM rasa/rasa
latest: Pulling from rasa/rasa
Digest: sha256:cc6a48c7cxxxc8f1c8c3bxxxxxxxxxxxxxxxxef266a58121f41e22b418c6a
Status: Downloaded newer image for rasa/rasa:latest
---> fcf204982b0f
Step 2/6 : ENV BOT_ENV=production
---> Running in 708a75c57f16
Removing intermediate container 708a75c57f16
---> 780c38217741
Step 3/6 : COPY . /var/www
---> a32cfeb03a84
Step 4/6 : WORKDIR /var/www
---> Running in 4f4f0446c8a4
Removing intermediate container 4f4f0446c8a4
---> 1751f3ffc062
Step 5/6 : RUN pip install rasa
---> Running in b70c61ca4670
[91mWARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
[0mRemoving intermediate container b70cxxxx670
---> 3e8xxx0f91c
Step 6/6 : ENTRYPOINT [ "rasa", "run", "-m", "./models", "-vv", "--enable-api", "--endpoints", "endpoints.yml", "--credentials", "credentials.yml", "-p", "8080"]
---> Running in 4xxxxxx6
Removing intermediate container 4xxxxxxxxxx6
---> 6fxxxxxxxxx30
Successfully built 6xxxxxxxxxxx30
Successfully tagged us.gcr.io/xxxxxxxxxx/appengine/default.chatbot15:latest
PUSH
Pushing us.gcr.io/xxxxxxxxxxx/appengine/default.chatbot15:latest
The push refers to repository [us.gcr.io/xxxxxxxxxxx/appengine/default.chatbot15]
0da5206fa56e: Pushed
latest: digest: sha256:d1cxxxxxxxxxxxxxxxxxxxxxxxx724xxxxxx size: 2837
DONE
------------------------------------------------------------------------------------------------------------------------
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
2020-01-27 19:54:37 DEBUG rasa.core.utils - Available web server routes:
/conversations/<conversation_id>/messages POST add_message
/conversations/<conversation_id>/tracker/events POST append_events
/webhooks/rasa GET custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook POST custom_webhook_RasaChatInput.receive
/webhooks/rest GET custom_webhook_RestInput.health
/webhooks/rest/webhook POST custom_webhook_RestInput.receive
/model/test/intents POST evaluate_intents
/model/test/stories POST evaluate_stories
/conversations/<conversation_id>/execute POST execute_action
/domain GET get_domain
/socket.io GET handle_request
/ GET hello
/model PUT load_model
/model/parse POST parse
/conversations/<conversation_id>/predict POST predict
/conversations/<conversation_id>/tracker/events PUT replace_events
/conversations/<conversation_id>/story GET retrieve_story
/conversations/<conversation_id>/tracker GET retrieve_tracker
/webhooks/socketio GET socketio_webhook.health
/status GET status
/model/predict POST tracker_predict
/model/train POST train
/conversations/<conversation_id>/trigger_intent POST trigger_intent
/model DELETE unload_model
/version GET version
2020-01-27 19:54:37 INFO root - Starting Rasa server on http://localhost:8080
2020-01-27 19:54:37 DEBUG rasa.core.utils - Using the default number of Sanic workers (1).
2020-01-27 19:54:37 INFO root - Enabling coroutine debugging. Loop id 94796527495608.
2020-01-27 19:54:37 DEBUG rasa.model - Extracted model to '/tmp/tmpq4hewp3_'.
2020-01-27 19:54:41.930821: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2020-01-27 19:54:42 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore.
2020-01-27 19:54:42 DEBUG rasa.core.lock_store - Connected to lock store 'InMemoryLockStore'.
2020-01-27 19:54:42 DEBUG rasa.core.nlg.generator - Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.
2020-01-27 19:54:42 DEBUG rasa.core.agent - Requesting model from server http://xxxxxxxxxxx.appspot.com/?hl=en-GB/models/20200123-205743.tar.gz...
2020-01-27 19:54:42 ERROR rasa.core.agent - Could not load model due to File is not a zip file.
[2020-01-27 19:54:42 +0000] [1] [ERROR] Experienced exception while trying to serve
Traceback (most recent call last):
File "/build/lib/python3.6/site-packages/rasa/utils/io.py", line 195, in unarchive
tar = tarfile.open(fileobj=IOReader(byte_array))
File "/usr/local/lib/python3.6/tarfile.py", line 1576, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build/lib/python3.6/site-packages/sanic/app.py", line 1133, in run
serve(**server_settings)
File "/build/lib/python3.6/site-packages/sanic/server.py", line 857, in serve
trigger_events(before_start, loop)
File "/build/lib/python3.6/site-packages/sanic/server.py", line 634, in trigger_events
loop.run_until_complete(result)
File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
File "/build/lib/python3.6/site-packages/rasa/core/run.py", line 247, in load_agent_on_start
action_endpoint=endpoints.action,
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 248, in load_agent
model_server,
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 64, in load_from_server
await _update_model_from_server(model_server, agent)
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 122, in _update_model_from_server
model_server, agent.fingerprint
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 180, in _pull_model_and_fingerprint
rasa.utils.io.unarchive(await resp.read(), model_directory)
File "/build/lib/python3.6/site-packages/rasa/utils/io.py", line 200, in unarchive
zip_ref = zipfile.ZipFile(IOReader(byte_array))
File "/usr/local/lib/python3.6/zipfile.py", line 1131, in __init__
self._RealGetContents()
File "/usr/local/lib/python3.6/zipfile.py", line 1198, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
Traceback (most recent call last):
File "/build/lib/python3.6/site-packages/rasa/utils/io.py", line 195, in unarchive
tar = tarfile.open(fileobj=IOReader(byte_array))
File "/usr/local/lib/python3.6/tarfile.py", line 1576, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build/bin/rasa", line 8, in <module>
sys.exit(main())
File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
cmdline_arguments.func(cmdline_arguments)
File "/build/lib/python3.6/site-packages/rasa/cli/run.py", line 83, in run
rasa.run(**vars(args))
File "/build/lib/python3.6/site-packages/rasa/run.py", line 56, in run
**kwargs,
File "/build/lib/python3.6/site-packages/rasa/core/run.py", line 206, in serve_application
endpoints.lock_store if endpoints else None
File "/build/lib/python3.6/site-packages/sanic/app.py", line 1133, in run
serve(**server_settings)
File "/build/lib/python3.6/site-packages/sanic/server.py", line 857, in serve
trigger_events(before_start, loop)
File "/build/lib/python3.6/site-packages/sanic/server.py", line 634, in trigger_events
loop.run_until_complete(result)
File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
File "/build/lib/python3.6/site-packages/rasa/core/run.py", line 247, in load_agent_on_start
action_endpoint=endpoints.action,
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 248, in load_agent
model_server,
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 64, in load_from_server
await _update_model_from_server(model_server, agent)
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 122, in _update_model_from_server
model_server, agent.fingerprint
File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 180, in _pull_model_and_fingerprint
rasa.utils.io.unarchive(await resp.read(), model_directory)
File "/build/lib/python3.6/site-packages/rasa/utils/io.py", line 200, in unarchive
zip_ref = zipfile.ZipFile(IOReader(byte_array))
File "/usr/local/lib/python3.6/zipfile.py", line 1131, in __init__
self._RealGetContents()
File "/usr/local/lib/python3.6/zipfile.py", line 1198, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
Thanks.
My dockerfile looks like this:
FROM rasa/rasa
USER root
ENV BOT_ENV=development
COPY . /var/www
WORKDIR /var/www
RUN pip install --no-cache-dir phonenumbers pgeocode
#ENTRYPOINT ["rasa", "run", "-vv", "--enable-api", "actions"]
#ENTRYPOINT ["rasa", "run", "-vv", "--enable-api", "-m", "models", "--cors", "*", "--endpoints", "endpoints.yml", "--credentials", "credentials.yml", "-p", "8080"]
ENTRYPOINT ["rasa", "run", "-p", "8080", "--debug", "--enable-api", "--cors", "*"]
#ENTRYPOINT["rasa", "run", "-p", "8080"]
I have many options because I've been trying different ones as I don't manage to get my bot to take actions on the received messages. With the last one that is commented out, I get to see some HTTP 204 responses from twilio, which I think is good as at least I'm not receiving error responses anymore.
I'm still trying to figure out why my domain and policy are not being taken into account, as I'm getting these messages in the console:
2020-02-25 03:45:47 default[botgister-0] /build/lib/python3.6/site-packages/rasa/utils/common.py:351: UserWarning: No policy ensemble or domain set. Skipping action prediction and execution.
2020-02-25 03:45:47 default[botgister-0] More info at https://rasa.com/docs/rasa/core/policies/
Well, hope this helps.

Error downloading App Engine source code with appcfg.py

I try to download my code from google using:
appcfg.py download_app -A "canada-math" ./trunk3
I have the old appengine installed under my home dir, which you can see in the error output below.
appcfg.py download_app -A "canada-math" ./trunk3
I get this:
stephen#stephen-AO725:~/webprog$ appcfg.py download_app -A "canada-math" ./trunk3
05:06 PM Host: appengine.google.com
05:06 PM Fetching file list...
Traceback (most recent call last):
File "/home/stephen/webprog/google_appengine/appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "/home/stephen/webprog/google_appengine/appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4282, in <module>
main(sys.argv)
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4273, in main
result = AppCfgApp(argv).Run()
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 2409, in Run
self.action(self)
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4003, in __call__
return method()
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 2861, in DownloadApp
DoDownloadApp(rpcserver, out_dir, app_id, module, app_version)
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 1373, in DoDownloadApp
result = rpcserver.Send('/api/files/list', **url_args)
File "/home/stephen/webprog/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
f = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
TypeError: do_open() got an unexpected keyword argument 'context'
The simplest fix is likely to download the source code by running appcfg.py in Cloud Shell. That will ensure that your appcfg.py and Python versions are compatible with the App Engine API.
Depending on your specific versions of appcfg and Python, you may have a version mismatch. Also keep in mind that appcfg is deprecated. See also:
SDK is incompatible with python 2.7.9
Deploying Google app engine with python failed

Simple Application in Go using Google App Engine SDK

When I follow Google-Developers' tutorial for creating a simple application in Go using App Engine SDK for Go, while running the command
goapp serve
I receive the following error:
Traceback (most recent call last):
File "/home/kamal/go_appengine/dev_appserver.py", line 82, in <module>
_run_file(__file__, globals())
File "/home/kamal/go_appengine/dev_appserver.py", line 78, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1001, in <module>
main()
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 994, in main
dev_server.start(options)
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 754, in start
options.config_paths)
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 632, in __init__
module_configuration = ModuleConfiguration(config_path)
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 97, in __init__
self._config_path)
File "/home/kamal/go_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 316, in _parse_configuration
config, files = appinfo_includes.ParseAndReturnIncludePaths(f)
File "/home/kamal/go_appengine/google/appengine/api/appinfo_includes.py", line 81, in ParseAndReturnIncludePaths
appyaml = appinfo.LoadSingleAppInfo(appinfo_file)
File "/home/kamal/go_appengine/google/appengine/api/appinfo.py", line 1873, in LoadSingleAppInfo
listener.Parse(app_info)
File "/home/kamal/go_appengine/google/appengine/api/yaml_listener.py", line 226, in Parse
self._HandleEvents(self._GenerateEventParameters(stream, loader_class))
File "/home/kamal/go_appengine/google/appengine/api/yaml_listener.py", line 177, in _HandleEvents
raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Unknown url handler type.
URLMap
auth_fail_action=redirect
static_dir=None
secure=default
http_headers=None
url=/.*
static_files=None
expiration=None
upload=None
api_endpoint=None
script=None
application_readable=None
position=None
login=optional
mime_type=None
require_matching_file=None
in "myapp/app.yaml", line 8, column 1
error while running dev_appserver.py: exit status 1
I don't know how to debug it. Just a hint would be sufficient.
Also, can it be because I have no web server installed? Do I have to install Apache or Nginx for goapp serve or go handles the server stuff itself?
The problem was indentation of script in handlers in .yaml file.
I initially did it like this:
handlers:
- url: /.*
script: _go_app
While it should be:
handlers:
- url: /.*
script: _go_app
It works now!

Error uploading Google App Engine Application

I am using a normal command to upload my application in Google App Engine (Python 2.7, SDK 1.8.9):
appcfg.py --oauth2 update .
But after a refactoring in my project there is an error in a regular expression for app.yaml (here is the code)
The error is:
02:00 AM Application: sandengine; version: dev
02:00 AM Host: appengine.google.com
02:00 AM Starting update of app: sandengine, version: dev
02:00 AM Getting current resource limits.
02:00 AM Scanning files on local disk.
Traceback (most recent call last):
File "/usr/local/bin/appcfg.py", line 199, in <module>
run_file(__file__, globals())
File "/usr/local/bin/appcfg.py", line 195, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4933, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4924, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2648, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4604, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3419, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3466, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3357, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2143, in DoUpload
self._AddFilesThatAreSmallEnough(paths, openfunc)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2211, in _AddFilesThatAreSmallEnough
file_classification = FileClassification(self.config, path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 257, in __init__
self.__static_mime_type = self.__GetMimeTypeIfStaticFile(config, filename)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 287, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 137, in match
return _compile(pattern, flags).match(string)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'
It is a regular expression error, where in upload: you can't use \1 or \2
Here is the fix: https://github.com/coto/gae-boilerplate/commit/7fbcba2cb217f8ccd8ced7bfe634b4aceaf616c6
Instead of "dev" as the version number, try putting in an actual number :)
dev is a reserved keyword. Change the version and instead of dev use a number or a lowercase string.
It Worked for me
Its pretty easy to figure out what file of your app.yaml is the problem by putting a print here.
/home/nburn42/Apps/google_appengine/google/appengine/tools/appcfg.py
line 315
It is maybe a bit overkill but it will definitely get you unstuck.

Certificate not work when i try to update

Good day to all. I am using Google App Engine 1.6.2 , Python 2.7 ,Windows 7x64, i created an application..uploded it...it was successfully working for about a weak. But when i was trying to make an update this morning, luncher gave me this error:
2012-02-20 12:26:41 Running command: "['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=myemail#gmail.com', '--passin', 'update', 'D:\\Dropbox\\Google\\handmade']"
Application: bubonchikhub; version: 1
Host: appengine.google.com
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 101, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 97, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3935, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3926, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2497, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3692, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2915, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2897, in UpdateVersion
updatecheck.CheckForUpdates()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 572, in CheckForUpdates
runtime=self.config.runtime)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 365, in Send
f = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 394, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 412, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1207, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 363, in do_open
url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host 127.0.0.1:8888 returned an invalid certificate (_ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl
2012-02-20 12:26:43 (Process exited with code 1)
You can close this window now.
You can close this window now.
Can anyone help how to fix this?
Thnx in advance
Your request might be going through a local proxy.
Upgrading to Python 2.7.9 fixed this for me.
You need to paste your proxy's certification to the end of google_appengine/lib/cacerts/cacerts.txt
This does seem to be related to proxy servers, when I run fiddler and try to deploy I get this error. When I shut it down deployment works fine.
You will get an invalid certificate error like
fancy_urllib.InvalidCertificateException: Host 127.0.0.1:8888 returned an invalid certificate (_ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
So turn of the proxy server (assuming this is your issue) you are running and and the run the appcfg deploy!

Resources