I am trying to deploy the app.yaml file to appengine flexible.
Here is my app.yaml file
runtime: java
env: flex
manual_scaling:
instances: 1
handlers:
- url: /.*
script: this field is required, but ignored
secure: always
runtime_config: # Optional
jdk: openjdk8
server: jetty9
resources:
cpu: 0.5
memory_gb: 0.18
disk_size_gb: 10
I am trying to deploy it with this command:
gcloud app deploy app.yaml --verbosity=debug
And this is the error I get:
DEBUG: No staging command found for runtime [java] and environment [FLEX].
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta
Building and pushing image for service [my-service]
DEBUG: Could not call git with args ('config', '--get-regexp', 'remote\\.(.*)\\.url'): [Error 2] The system cannot find the file specified
INFO: Not checking for [Custom] because runtime is [java]
INFO: Not checking for [Go] because runtime is [java]
INFO: Not checking for [Ruby] because runtime is [java]
INFO: Not checking for [Node.js] because runtime is [java]
INFO: Checking for Java.
INFO: Not checking for [Python Compat] because runtime is [java]
INFO: Not checking for [Python] because runtime is [java]
INFO: Not checking for [PHP] because runtime is [java]
DEBUG: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 742, in Execute
resources = args.calliope_command.Run(cli=self, args=args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 739, in Run
resources = command_instance.Run(args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\app\deploy.py", line 59, in Run
return deploy_util.RunDeploy(args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 413, in RunDeploy
all_services)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 241, in Deploy
new_version, service, source_dir, image, code_bucket_ref)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 176, in _PossiblyBuildAndPush
code_bucket_ref, self.deploy_options.use_runtime_builders)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 206, in BuildAndPushDockerImage
gen_files.update(_GetDockerfiles(service, source_dir))
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 139, in _GetDockerfiles
'again.'.format(info.runtime))
UnsatisfiedRequirementsError: Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
So it ends up not deploying the app.yaml.
However, if I run this command:
gcloud app deploy cron.yaml
It will work just fine.
Yeah, this is a gap right now :/ You can't actually deploy a Java app to App Engine flexible via gcloud app deploy. You need to use the Maven or Gradle plugins.
Sorry for the trouble!
Related
When running gcloud preview app run from Google Compute Engine, running Ubuntu Trust 14.04 image, I get the following error:
(Note: I fetched the complete gcloud SDK from https://cloud.google.com/sdk/)
$ gcloud preview app run appengine-modules-guestbook/src/main/webapp
Java module found in [/home/yaraju_gmail_com/appengine-modules-sample-java/appengine-modules-guestbook/src/main/webapp]
INFO: Skipping SDK update check.
INFO: Starting API server at: http://localhost:46920
INFO: Starting module "default" running at: http://localhost:8080
INFO: Starting admin server at: http://localhost:8000
Exception in thread Instance Adjustment:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1492, in _loop_adjusting_instances
self._adjust_instances()
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1469, in _adjust_instances
self._add_instance(permit_warmup=True)
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1354, in _add_instance
if not inst.start():
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/instance.py", line 274, in start
self._runtime_proxy.start()
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/http_runtime.py", line 270, in start
stderr=subprocess.PIPE)
File "/home/yaraju_gmail_com/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/safe_subprocess.py", line 132, in start_process_file
stderr=stderr)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
What can I do to fix this?
You might be missing one of the dependencies.
Ensure that you have run the following:
sudo apt-get install openjdk-7-jdk
gcloud components update gae-java
I try to deploy some files on google CDN (appspot) with Google App Engine release 1.19.7 and Python 2.7.9.
I'm sure that's it's not a big problem but I'm not a specialist.
I've created the application in 'Google developers'
The content of the file app.yaml is :
application: o-naturel version: 1 runtime: python27 api_version: 1 threadsafe: true
# Expiration des fichiers : 30 jours default_expiration: "30d"
handlers:
- url: /styles static_dir: styles
- url: /images static_dir: images
- url: /files static_dir: files
#- url: /.*
# static_files: index.html
# upload: index.html
Find below the errors during the deployment. Hope I will get an answer because I can not follow the development of my web site. Many thanks in advance !!!!
2014-12-12 17:56:28 Running command: "['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=patrick.sanchez24#gmail.com', '--passin', 'update', 'D:\\Cdn-App_o-naturel']"
05:56 PM Application: o-naturel; version: 1
05:56 PM Host: appengine.google.com
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 127, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 123, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5397, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5388, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2978, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5044, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3791, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3812, in _UpdateWithParsedAppYaml
updatecheck.CheckForUpdates()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\sdk_update_checker.py", line 243, in CheckForUpdates
runtime=runtime))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 424, in Send
f = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 431, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 449, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1240, in https_open
context=self._context)
TypeError: do_open() got an unexpected keyword argument 'context'
2014-12-12 17:56:31 (Process exited with code 1)
You can close this window now.
If you use Python 2.7.9, you should install Python 2.7.8.
When I ran GAE/P in Python 2.7.9, this error occured just like you.
However, it worked correctly, when I ran GAE/P in Python 2.7.8.
Probably, the difference is between Python 2.7.9 released 2014-12-10 and GAE/P released 2014-12-8 now.
Please try Python 2.7.8.
There seems to be a bug in the SDK.
See Deep's link above.
for me simplest solution was to add:
--skip_sdk_update_check=yes to the additional options.
Later I will check for and download a newer version manually, and then remove the option again.
If you want to continue using Python 2.7.9, the solution as shown in:
https://code.google.com/p/googleappengine/issues/detail?id=11536 worked for me.
Had to change three lines of code and it started working.
This is fixed for me by upgrading Google App Engine SDK to 1.9.18 (in GoogleAppEngineLauncher UI use Help > Check for updates).
I'm running Python 2.7.9.
OS: windows 8
google app engine sdk 1.8.2
C:\google_appengine>dev_appserver.py --php_executable_path=D:\php5417 D:\helloworld
INFO 2013-08-03 16:13:43,874 sdk_update_checker.py:244] Checking for updates to the SDK.
INFO 2013-08-03 16:13:45,128 sdk_update_checker.py:260] Update check failed: HTTP Error 404: Not Found
WARNING 2013-08-03 16:13:45,148 api_server.py:314] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-08-03 16:13:45,164 api_server.py:138] Starting API server at: http://localhost:9024
INFO 2013-08-03 16:13:45,171 dispatcher.py:164] Starting module "default" running at: http://localhost:8080
ERROR 2013-08-03 16:13:45,176 php_runtime.py:216] The PHP runtime is not available
Traceback (most recent call last):
File "C:\google_appengine\google\appengine\tools\devappserver2\php_runtime.py", line 212, in new_instance
self._check_environment(php_executable_path)
File "C:\google_appengine\google\appengine\tools\devappserver2\php_runtime.py", line 156, in _check_environment
env={})
File "C:\google_appengine\google\appengine\tools\devappserver2\safe_subprocess.py", line 61, in start_process
stdin=subprocess.PIPE)
File "C:\python\lib\subprocess.py", line 711, in __init__
errread, errwrite)
File "C:\python\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 5] 存取被拒。
INFO 2013-08-03 16:13:45,177 admin_server.py:117] Starting admin server at: http://localhost:8000
--php_executable_path should point to the actual executable file. So you probably want something like:
--php_executable_path=D:\php5417\php-cgi.exe
I attempted to use Appengine SDK version 1.7.6 but was receiving fatal errors (same as outlined below) so reverted to 1.7.5, where my app works fine. However, the errors I saw in 1.7.6 recur when I attempt to run the experimental devappserver in 1.7.5. I am running Python 2.7 on a win 7 machine. Standard install selections for AppEngine.
These error messages refer to permissions relating to the PYTHON_EGG_CACHE, but...
- 1) They do not occur for the 'old' dev_appserver
- 2) The application can successfully extract files to the location noted. In fact, I changed the path of the PYTHON_EGG_CACHE to another location, gave it wide open permissions, and still received the error.
- 3) I have pyyaml in my site-packages, so am not sure why it would need to do a temporary extract anyway.
Any help looking for a resolution to this would be appreciated, since I'll be forced to use the new devappserver in a couple of releases time.
Command line error dump below:
python "C:\Program Files (x
86)\Google\google_appengine\devappserver2.py" .
WARNING 2013-03-25 19:10:41,029 devappserver2.py:497] devappserver2.py is curre
ntly experimental but will eventually replace dev_appserver.py in the App Engine
Python SDK. For more information and to report bugs, please see: http://code.go
ogle.com/p/appengine-devappserver2-experiment/
INFO 2013-03-25 19:10:41,171 appcfg.py:618] Checking for updates to the SDK.
WARNING 2013-03-25 19:10:44,525 simple_search_stub.py:975] Could not read searc
h indexes from c:\users\ben\appdata\local\temp\appengine.dev~upskillme-main.Ben\
search_indexes
INFO 2013-03-25 19:10:44,539 api_server.py:148] Starting API server at: http
://localhost:49302
INFO 2013-03-25 19:10:44,555 dispatcher.py:96] Starting server "default" run
ning at: http://localhost:8080
INFO 2013-03-25 19:10:44,571 admin_server.py:112] Starting admin server at:
http://localhost:8000
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
150, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
146, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\python\runtime.py", line 39, in <module>
from google.appengine.ext.remote_api import remote_api_stub
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remo
te_api\remote_api_stub.py", line 75, in <module>
import yaml
File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\__init
__.py", line 14, in <module>
from cyaml import *
File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\cyaml.
py", line 5, in <module>
from _yaml import CParser, CEmitter
File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 7, in <module>
File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 4, in __bootstrap__
File "C:\Python27\lib\site-packages\pkg_resources.py", line 882, in resource_f
ilename
self, resource_name
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1351, in get_resou
rce_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1406, in _extract_
resource
manager.extraction_error() # report a user-friendly error
File "C:\Python27\lib\site-packages\pkg_resources.py", line 928, in extraction
_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Error 5] Access is denied: 'C:\\Users\\Ben\\AppData\\Roaming\\Python-Eggs\\py
yaml-3.10-py2.7-win32.egg-tmp\\_yaml.pyd'
The Python egg cache directory is currently set to:
C:\Users\Ben\AppData\Roaming\Python-Eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\server.py", line 1045, in _loop_adjusting_instances
self._adjust_instances()
If anyone comes along with the same issue, the resolution that worked for me was as follows:
Unzip the PyYAML-3.10-py2.7-win32.egg in your python27 site-packages
directory into a new directory within site-packages. You'll need to
unzip it to into a directory name like NEWPyYAML-3.10-py2.7-win32.egg
to avoid name conflicts.
Rename your original egg. to something else (e.g., OLDPyYAML-3.10-py2.7-win32.egg).
Rename your new directory to PyYAML-3.10-py2.7-win32.egg
All references to the egg will now actually point to a directory in your site-packages containing the unzipped python files. The new devappserver should be able to work with this.
Unsure how to unzip an egg in windows? See here (presuming you have Winzip or similar installed):
http://mail.python.org/pipermail/chicago/2007-July/002301.html
Trying to do HelloWorld on GoogleAppEngine, but getting the following error.
C:\LearningGoogleAppEngine\HelloWorld>dev_appserver.py helloworld
WARNING 2012-07-17 10:21:37,250 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 133, in
run_file(file, globals())
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 129, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 694, in sys.exit(main(sys.argv))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 582, in main root_path, {}, default_partition=default_partition)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3217, in LoadAppConfig raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError
I've found posts on GoogleCode, StackO regarding this issue. But no matter what I try, I still can't overcome this error.
Python version installed on Windows 7 machine is: 2.7.3
GAE Launcher splash screen displays the following:
Release 1.7.0
Api versions: ['1']
Python: 2.5.2
wxPython : 2.8.8.1(msw-unicode)
Can someone help?
it's been a while, but I believe I've previously fixed this by adding import rdbms to dev_appserver.py
hmm.. or was that import MySQLdb? (more likely)
Runtime needed to be set to "Python27" not just "Python" and threadsafe needed be set to false, here is my app.yaml
application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: false
handlers:
- url: /.*
script: helloworld.py
Here is my helloworld.py
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'
just had the exact same error messages: I found that restarting Windows fixed everything and I did not have to deviate from the YAML or py file given on the google helloworld python tutorial.