fail to execute php-cgi for google app engine under windows - google-app-engine

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

Related

App Engine Deployment failing - BuildError - MemoryError - Deployment failed with exit code: 1

We are not able to deploy our app anymore to App Engine Standard.
Steps to reproduce: we simply deploy our project with IntelliJ IDEA - we get the following error:
Beginning deployment of service [default]...
#============================================================#
#= Uploading 0 files to Google Cloud Storage =#
#============================================================#
File upload done.
Updating service [default]...
.................................................................................failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 15c72c99-c2cc-4e4d-b910-0eee13a9cb5a status: FAILURE.
Error ID: 6AA2815A.
Error type: BuildError.
Error message: 21 Feb 2020 04:36:00 INFO Running as user 0, group 0
21 Feb 2020 04:36:00 INFO Arguments: ['--name=eu.gcr.io/XXXXXXX/app-engine-tmp/app/ttl-2h:af4f2b82-4138-4c9a-905f-6f9cf038e4cd', '--src=/workspace', '--base=eu.gcr.io/gae-runtimes/java8:java8_20191215_8_0_RC00']
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/bin/appender.par/__main__.py", line 90, in <module>
File "/bin/appender.par/__main__.py", line 76, in main
File "/bin/appender.par/containerregistry/client/v2_2/append_.py", line 74, in __init__
File "/bin/appender.par/containerregistry/client/v2_2/docker_image_.py", line 110, in uncompressed_blob
File "/usr/lib/python2.7/gzip.py", line 260, in read
self._read(readsize)
File "/usr/lib/python2.7/gzip.py", line 319, in _read
self._add_read_data( uncompress )
File "/usr/lib/python2.7/gzip.py", line 337, in _add_read_data
self.extrabuf = self.extrabuf[offset:] + data
MemoryError.
Failed to deploy '[2020-02-21 06:33:21] XXXX:war exploded. Project: XXXXXX. Version: vvvv': Deployment failed with exit code: 1
Please make sure that you are using the latest version of the Google Cloud SDK.
Run ''gcloud components update'' to update the SDK. (See: https://cloud.google.com/sdk/gcloud/reference/components/update.)
The Cloud SDK is managed by IDEA .. it seems to be the latest version (in Settings - Cloud SDK).
We have another smaller test project in IDEA which we can deploy without issues.
And we have another larger project in Eclipse which fails with a similar error - MemoryError.
I guess there must be some Memory issue in Google Cloud since the smaller project works fine, but the 2 larger projects do not work!!
This happens since yesterday .. we searched but could not find any similar issues .. so I guess this must be something new?
UPDATE:
It seems to work now .. I guess it was a temporary glitch in the Google deployment process.
For issues like this, it would be better to open a ticket to the Google Cloud Platform support team. They will be able to troubleshoot it better with access to the specifics of your environment and the logs.

gcloud preview app run: "OSError: [Errno 2] No such file or directory"

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

Google App Engine PHP running on mac

Trying to run WordPress on Google App Engine.
Following the installation I am missing where the "path to php-cgi" is?
I can find some php54-cgi under macport/software/php54-cgi, but setting the path to this gives permission errors.
Also the installation missed saying anything about installing python sdk in order to run the dev_appserver.py.
Question is can you even run the hello world on mac and if so how to start the dev_appserver.py?
https://developers.google.com/appengine/docs/php/gettingstarted/helloworld
Error message:
dev_appserver.py --php_executable_path=/opt/local/var/macports/software/php54-cgi /Users/name/GAE/PHPTest
WARNING 2013-05-21 22:31:10,600 api_server.py:329] Could not initialize images API; you are likely missing the Python "PIL" module.
WARNING 2013-05-21 22:31:10,606 simple_search_stub.py:962] Could not read search indexes from /var/folders/6w/2nmsznqj3d7310_lp70p34s00000gn/T/appengine.helloworld/search_indexes
INFO 2013-05-21 22:31:10,609 api_server.py:153] Starting API server at: http://localhost:49390
INFO 2013-05-21 22:31:10,614 dispatcher.py:164] Starting server "default" running at: http://localhost:8080
INFO 2013-05-21 22:31:10,619 admin_server.py:117] Starting admin server at: http://localhost:8000
Exception in thread Thread-6:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/server.py", line 1232, in _loop_adjusting_instances
self._adjust_instances()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/server.py", line 1209, in _adjust_instances
self._add_instance(permit_warmup=True)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/server.py", line 1087, in _add_instance
expect_ready_request=perform_warmup)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 195, in new_instance
self._check_environment(php_executable_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 138, in _check_environment
env={})
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/safe_subprocess.py", line 61, in start_process
stdin=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Thanks
Regards
I used macports to get it running, /opt/local/bin/php-cgi54.
./google_appengine/dev_appserver.py --php_executable_path=/opt/local/bin/php-cgi54 --php_remote_debugging=yes ~/apps/minishell/
However, I'm not sure that your permission denied error is related to not being able to find the php-cgi executable.

SSL certificates on Google App Engine

I'm having issues getting started using GAE (1.7.6 on OS X 10.6.8 with Python 2.7) and compared to amazon services it is abysmal. However, I would like to at least get the sample app deployed. After working through the other issues I now have a small sample application ready to deploy. When I try to deploy it, I receive an SSL error as follows:
*** Running appcfg.py with the following flags:
--no_cookies --email=mathsboy#gmail.com --passin update
02:15 PM Host: appengine.google.com
02:15 PM Application: tew-helloworld; version: 1
Traceback (most recent call last):
File "google_appengine/appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "google_appengine/appcfg.py", line 167, 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 4155, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4146, 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 2334, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3881, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2892, in Update
updatecheck.CheckForUpdates()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/sdk_update_checker.py", line 258, in CheckForUpdates
runtime=runtime))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
f = self.opener.open(req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1207, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 383, in do_open
url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host appengine.google.com 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
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 ***
There was some advice on this in another thread stating that you would need to remove cacerts.txt, though I am unable to locate this file on OS X. Also, it seems retarded that in order to have the code upload I'd have to delete a cacert text file. But maybe I'm an idiot.
Another problem I'm facing here, is that OS X doesn't work well with GAE due to the difficulty in managing python versions. I've got a total mess on my hands now after installing multiple versions of python, EPD, ActiveState, MacPorts. None of these worked in solving me earlier problems despite assurances they would. It's really pretty appalling that this is the state of google's application management. It just seems like GAE was built by a bunch of guys from mid-90s microsoft....anyone advice on the above issue would be greatly appreciated. Cheers
Fourth line from end in your error. Relevant instructions under the link.
http://code.google.com/appengine/kb/general.html#rpcssl
Make sure (from documentation):
To do this you must have the ssl Python module installed on your system.
Workaround: Use the command line argument --skip_sdk_update_check=yes when you run dev_appserver.py.
I had the same problem and noticed the GUI tool (GoogleAppEngineLauncher) uses --skip_sdk_update_check=yes every time you start an app. This is as of SDK 1.8.7.
The root cause seems to be a known bug in the GAE development server's module whiltelisting system. Even if you have the ssl module installed (as the documentation says is required), ssl relies on _ssl, which is not whitelisted. This is why you can execute import ssl in a regular python shell session with no problem, but get an error when you execute the same line in a GAE app.

Fatal devappserver2 error: PYTHON_EGG_CACHE in Appengine 1.7.6 and 1.7.5 python 2.7, win7

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

Resources