What should go in the Dockerfile when using Rasa with Google Cloud Platform - google-app-engine

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.

Related

OSX dev_appserver.py file not accessible: '/System/Library/CoreServices/SystemVersion.plist'

I did a gcloud components update 2 days ago and started getting this error when i run dev_appserver.py
(venv) myusername#mymachine:~/projects/myproject$ dev_appserver.py ./ --host 0.0.0.0 --port 8002 --enable_console --env_var GCS_TOKEN=ya29........YJDQAnp772B0
INFO 2019-03-13 23:45:31,205 devappserver2.py:278] Skipping SDK update check.
INFO 2019-03-13 23:45:31,268 api_server.py:275] Starting API server at: http://localhost:64587
INFO 2019-03-13 23:45:31,319 dispatcher.py:256] Starting module "default" running at: http://0.0.0.0:8002
INFO 2019-03-13 23:45:31,325 admin_server.py:150] Starting admin server at: http://localhost:8000
/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/mtime_file_watcher.py:182: UserWarning: There are too many files in your application for changes in all of them to be monitored. You may have to restart the development server to see some changes to your files.
'There are too many files in your application for '
INFO 2019-03-13 23:45:35,237 instance.py:294] Instance PID: 29760
appengine_config
requests.__version__ 2.21.0
Appengine config done
4
ERROR 2019-03-13 23:45:35,986 wsgi.py:263]
Traceback (most recent call last):
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/Users/myusername/projects/myproject/main.py", line 34, in <module>
from bp_includes.lib.error_handler import handle_error
File "/Users/myusername/projects/myproject/bp_includes/lib/error_handler.py", line 15, in <module>
from bp_includes.lib import jinja_bootstrap
File "/Users/myusername/projects/myproject/bp_includes/lib/jinja_bootstrap.py", line 7, in <module>
from src.handlers.utils import ordinal
File "/Users/myusername/projects/myproject/src/handlers/utils.py", line 14, in <module>
from lib.pytz.gae import pytz
File "/Users/myusername/projects/myproject/lib/pytz/__init__.py", line 29, in <module>
from pkg_resources import resource_stream
File "/Users/myusername/projects/myproject/lib/pkg_resources/__init__.py", line 1022, in <module>
class Environment(object):
File "/Users/myusername/projects/myproject/lib/pkg_resources/__init__.py", line 1025, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(),
File "/Users/myusername/projects/myproject/lib/pkg_resources/__init__.py", line 263, in get_supported_platform
plat = get_build_platform()
File "/Users/myusername/projects/myproject/lib/pkg_resources/__init__.py", line 472, in get_build_platform
INFO 2019-03-13 23:45:36,002 module.py:861] default: "GET /_ah/warmup HTTP/1.1" 500 -
version = _macosx_vers()
File "/Users/myusername/projects/myproject/lib/pkg_resources/__init__.py", line 439, in _macosx_vers
version = platform.mac_ver()[0]
File "/Users/myusername/projects/myproject/venv/lib/python2.7/platform.py", line 764, in mac_ver
info = _mac_ver_xml()
File "/Users/myusername/projects/myproject/venv/lib/python2.7/platform.py", line 741, in _mac_ver_xml
pl = plistlib.readPlist(fn)
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist
pathOrFile = open(pathOrFile)
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/stubs.py", line 284, in __init__
raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: '/System/Library/CoreServices/SystemVersion.plist'
I originally installed gcloud with brew cask install google-cloud-sdk in case that's relevant
It looks like the problem was introduced in gcloud 238.0.0 probably with gcloud app Python Extensions 1.9.84. You can downgrade gcloud to lower version with:
gcloud components update --version 237.0.0
I got it to work by doing the following in appengine_config.py, but I'm hoping that someone has a better solution
try:
from google.appengine.tools.devappserver2.python.runtime.stubs import FakeFile
FakeFile._allowed_dirs.update(['/System/Library/CoreServices/'])
except ImportError:
pass
you can delete the lib folder where you requirements are installed and reinstall it worked for me
pip install -t "lib" -r requirements.txt

Running locally with GAE Python second generation

I've been using GAE/P 1st gen for many years and am making the jump to my first GAE/P 2nd gen project.
I'm trying to run it locally like I did with dev_appserver.py for 1st gen apps, but the docs are very confusing in this respect.
I can run Flask on its own (python main.py) but static files don't work (since Flask knows nothing about app.yaml) and the datastore won't work either.
The GAE docs say that dev_appserver.py should work for 2nd gen (except on Windows but I'm on Mac) but when I run it, I get the error below.
This happens when I run dev_appserver.py with Python 2 or 3. I've also set CLOUDSDK_PYTHON to my Python 2 binary as instructed.
So how the heck can I run my GAE/P 2nd gen project locally in way that static files and the datastore work?!?
$ python ~/google-cloud-sdk/bin/dev_appserver.py --application=myapp --support_datastore_emulator=False ./app.yaml
INFO 2019-02-12 00:39:21,885 devappserver2.py:278] Skipping SDK update check.
INFO 2019-02-12 00:39:23,128 api_server.py:275] Starting API server at: http://localhost:51187
INFO 2019-02-12 00:39:23,139 instance_factory.py:71] Detected Python 3.6.5
INFO 2019-02-12 00:39:24,459 instance_factory.py:205] Using pip to install dependency libraries; pip stdout is redirected to /var/folders/yd/xr84fg0946l72fp_cc6j9l540000gr/T/tmpj3SEUZ
INFO 2019-02-12 00:39:24,459 instance_factory.py:211] Running /var/folders/yd/xr84fg0946l72fp_cc6j9l540000gr/T/tmpLtysT3/bin/pip install --upgrade pip
INFO 2019-02-12 00:39:24,469 stub_util.py:357] Applying all pending transactions and saving the datastore
INFO 2019-02-12 00:39:24,469 stub_util.py:360] Saving search indexes
Traceback (most recent call last):
File "/.../google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 96, in <module>
_run_file(__file__, globals())
File "/.../google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 90, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 600, in <module>
main()
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 588, in main
dev_server.start(options)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 360, in start
options.api_host, apiserver.port, wsgi_request_info_)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 248, in start
ssl_port)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 384, in _create_module
ssl_port=ssl_port)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1309, in __init__
super(AutoScalingModule, self).__init__(**kwargs)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 598, in __init__
self._module_configuration)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 231, in _create_instance_factory
module_configuration=module_configuration)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/instance_factory.py", line 98, in __init__
self._SetupVirtualenvFromConfiguration()
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/instance_factory.py", line 143, in _SetupVirtualenvFromConfiguration
self._venv_dir, requirements_file.name)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/instance_factory.py", line 228, in _SetupVirtualenv
cls._RunPipInstall(venv_dir, requirements_file_name)
File "/.../google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/instance_factory.py", line 212, in _RunPipInstall
pip_proc = subprocess.Popen(pip_cmd, stdout=pip_out)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
After a good night's sleep, I was able to figure out the problem...
I was running dev_appserver.py from within my virtual environment. For some reason, this prevented dev_appserver.py from being able to find pip (needed to install the packages in my requirements.txt).
Exiting my virtual environment before running dev_appserver.py fixed the problem.

GoogleAppEngineLauncher deploy fails: appcfg.py has finished with exit code 0 ***

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 ***

gcloud deploy error: Image with tag google/docker-registry was not found

I'm trying to deploy this project https://github.com/GoogleCloudPlatform/appengine-nodejs-quickstart by using this command
gcloud --project poised-graph-758 preview app deploy --server preview.appengine.google.com .
but i get this error:
Updating module [default] from file [/Users/kannix/Desktop/tmp/appengine-nodejs-quickstart/app.yaml]
11:36 PM Host: preview.appengine.google.com
{bucket: vm-containers.poised-graph-758.appspot.com, path: /containers}
Traceback (most recent call last):
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
main()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
_cli.Execute()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 381, in Execute
post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
File "/Users/kannix/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/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 887, in Run
result = command_instance.Run(args)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 78, in TryFunc
return func(*args, **kwargs)
File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 154, in Run
self.__Run(args, project, deployables)
File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 207, in __Run
info.runtime, path, bucket)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/push.py", line 134, in BuildAndPushDockerImage
boto_path=config.BOTO_PATH)) as r:
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 148, in __enter__
self.Start()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 97, in Start
self._registry.Start()
File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 480, in Start
self._image.Build()
File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 309, in Build
raise ImageError('Image with tag %s was not found' % self.tag)
google.appengine.tools.docker.containers.ImageError: Image with tag google/docker-registry was not found
I tried to omit the --server preview.appengine.google.com parameter but it results in the same error
You need to pull the google/docker-registry image to resolve this error:
docker pull google/docker-registry
Note: if you receive the following error when trying to redeploy:
docker.docker.errors.APIError: 500 Server Error: Internal Server Error ("Invalid registry endpoint https://192.168.59.103:49153/v1/: Get https://192.168.59.103:49153/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.59.103:49153` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.59.103:49153/ca.crt")
Ensure that your docker daemon has been setup with the 'insecure registry' option (you will need to re-pull the google/docker-registry after the following steps) . You can do this with the following, (which was an answer on https://github.com/docker/docker/issues/8887):
$ boot2docker delete #removes old image
$ rm -f ~/.ssh/id_boot2docker* # remove old keys
$ boot2docker init #generates new keys, cert
$ boot2docker up
$ boot2docker ssh
$ # add EXTRA_ARGS="--insecure-registry <YOUR INSECURE HOST>"
$ # to /var/lib/boot2docker/profile
$ sudo /etc/init.d/docker restart
Try running this first:
gcloud preview app setup-managed-vms
Also make sure you're running Docker 1.3.0, not 1.3.1.
Docker 1.4.0 also doesn't work at this moment.
Deploying with --server preview.appengine.google.com did it for me.

Why does this gsutil call not work from FinalBuilder website but works when run in FinalBuilder application?

I have a .bat file that makes the following gsutil call to push a file to the Google Cloud:
python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/
Here is my output(with a few names changed for obscurity):
----------------------------------------------------------
Copy to google 11:02:33 AM 11:02:34 AM 00:00:00:479 Failed (Ignored)
Collapse Messages
Messages
Collapse
Executing external process: C:\Windows\system32\cmd.exe
Starting Directory: C:\BuildScripts
Parameters: /c "c:\buildscripts\push_goog.bat"
Collapse
Output from C:\Windows\system32\cmd.exe
The system cannot find the drive specified.
C:\BuildScripts>pushd c:\BuildScripts\
The system cannot find the drive specified.
Traceback (most recent call last):
File "C:\Program Files (x86)\gsutil\gsutil", line 67, in <module>
from gslib.util import UsingCrcmodExtension
File "C:\Program Files (x86)\gsutil\gslib\util.py", line 121, in <module>
os.path.join(CreateTrackerDirIfNeeded(), '.last_software_update_check'))
File "C:\Program Files (x86)\gsutil\gslib\util.py", line 108, in CreateTrackerDirIfNeeded
os.makedirs(tracker_dir)
File "C:\Python27\lib\os.py", line 150, in makedirs
makedirs(head, mode)
**C:\BuildScripts>python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/**
File "C:\Python27\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 3] The system cannot find the path specified: 'H:\\\\'
Program returned code : 1
It is mentioning something about H:\\\\ which we don't use and never mentioned in the .bat file or in the params to gsutil. I'm not sure why it works perfectly when run from the FinalBuilder application and then it gets this error when the FinalBuilder website runs the same FinalBuilder application file but is just triggered through the FinalBuilder Server.
Any help would be great.
The root cause for this is that your home directory is set to an invalid location.
As a workaround, you can change the tracker directory in your .boto configuration file. Here's the relevant section:
[GSUtil]
# 'resumable_tracker_dir' specifies the base location where resumable
# transfer tracker files are saved. By default they're in ~/.gsutil
#resumable_tracker_dir = <file path>
Uncomment the resumable_tracker_dir variable and set it to a location on disk that does exist.

Resources