Error while deploying App Engine project - google-app-engine

I deploy my go application via appcfg.py --oauth2 --noauth_local_webserver update .
Everything was working fine last week, but over the past 3 days and 20+ attempts I keep getting this error:
09:11 PM Application: my-app; version: 0-1-0
09:11 PM Host: appengine.google.com
09:11 PM
Starting update of app: my-app, version: 0-1-0
09:11 PM Getting current resource limits.
09:11 PM Scanning files on local disk.
09:11 PM Cloning 381 application files.
09:11 PM Compilation starting.
09:11 PM Compilation: 315 files left.
09:14 PM Error 500: --- begin server output ---
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>500 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered an error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
--- end server output ---
09:14 PM Rolling back the update.
Error 500: --- begin server output ---
--- end server output ---
I don't see any errors in the log. I'm well below my quota. I have billing enabled with more than enough money to spare. My project runs locally just fine. I tried pushing an older version of my code and that didn't work either.
I have other App Engine projects that are deploying just fine, just not this one.
Please help! I'm out of ideas :(

I had too many files I was trying to deploy. By removing one of my larger third-party libraries, I was able to deploy just fine

Try
appcfg.py rollback <app-directory>
As described here
Then redeploy

Related

Getting 403 error but version is getting deployed with 0% traffic

I am using maven plugin 1.9.60 with JDK 8
Running command
mvn install appengine:update -Dappengine.additionalParams="--service_account_json_key_file=client-secret.json"
I could see the version deployed but 0% traffic. Logs says error as below. Could someone suggest how to fix this?
Beginning interaction for module default...
0% Created staging directory at: '/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp'
5% Scanning for jsp files.
8% Generated git repository information file.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 34 application files.
40% Uploading 2 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Sending batch containing 2 file(s) totaling 1KB.
73% Initializing precompilation...
90% Deploying new version.
95% Closing update: new version is ready to start serving.
98% Uploading index definitions.
Feb. 19, 2018 12:54:48 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #0
Feb. 19, 2018 12:54:48 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #1
Feb. 19, 2018 12:54:49 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #2
Feb. 19, 2018 12:54:49 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #3
Error Details:
2018-02-19 00:54:17.700:INFO::main: Logging initialized #409ms
2018-02-19 00:54:17.816:INFO:oejs.Server:main: jetty-9.3.18.v20170406
2018-02-19 00:54:19.481:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=1228ms
2018-02-19 00:54:19.497:INFO:oejq.QuickStartDescriptorGenerator:main: Quickstart generating
2018-02-19 00:54:19.512:INFO:oejsh.ContextHandler:main: Started o.e.j.q.QuickStartWebApp#2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp/,AVAILABLE}
2018-02-19 00:54:19.514:INFO:oejs.Server:main: Started #2231ms
2018-02-19 00:54:19.517:INFO:oejsh.ContextHandler:main: Stopped o.e.j.q.QuickStartWebApp#2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp/,UNAVAILABLE}
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
Unable to update app: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
appengine-web.xml
```
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>clean-aleph-191303</application>
<version>beta-001</version>
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
</appengine-web-app>
```
pom.xml (plugin declaration)
```
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.60</version>
</plugin>
```
Complete bitbucket repo can be found here.
https://bitbucket.org/rohgoyal/springbootgcp-example/src
The issue you are experiencing is due to a missing role on the service account. It probably has the "App Engine Deployer" role assigned but it is missing the "Datastore Index Admin" role and this causes the 403s while POSTing to appengine.google.com/api/datastore/index/
After adding that role, you'll need to regenerate the private key (client-secret.json as you've named it) because the old one won't have the new permissions.
Some more information on roles needed to deploy GAE apps can be found on Deploying using IAM roles section.
Note: Thanks for providing a full repro. It is always helpful.

Cannot get Apache httpd mod_dbd to work

I am trying to setup a mysql authorization function in my XAMPP php5.6 developer server. However, I can't get the server to start up. I have tried numerous variations to the code, including commenting out the lines beginning with DB. #ing them out makes the server start up, but gives a HTTP500 error when I try to view the pages requiring authentication, because it doesn't know what database to look in.
Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/5.6.31
httpd.conf:
...
DBDriver mysql
DBDParams host=localhost,dbname=aDatabase,user=aUser,pass=ThisIsNotReallyMyPassword
<Directory "E:\xampp\htdocs\shouldnotbesecure\shouldbesecure">
Options -Indexes
AuthType Basic
AuthName "Please Login"
AuthBasicProvider dbd
# mod_authz_core configuration
Require valid-user
AuthDBDUserPWQuery "SELECT password FROM users WHERE username = %s"
</Directory>
loaded in httpd.config (coming from phpinfo() command):
Loaded Modules
core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authnz_fcgi mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dbd mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_logio mod_log_config mod_log_debug mod_log_forensic mod_cache_disk mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_session_dbd mod_setenvif mod_socache_dbm mod_socache_shmcb mod_ssl mod_status mod_php5
Nothing shows up in the error log when I try to start things with these configs, displayed in the system output is the following generic message:
5:38:11 PM [Apache] Checking default ports...
5:38:11 PM [Apache] Attempting to start Apache app...
5:38:11 PM [Apache] Executing "e:\xampp5.6\apache\bin\httpd.exe"
5:38:11 PM [Apache] Return code: 0
5:38:12 PM [Apache] Status change detected: running
5:38:12 PM [Apache] Status change detected: stopped
5:38:12 PM [Apache] Error: Apache shutdown unexpectedly.
5:38:12 PM [Apache] This may be due to a blocked port, missing dependencies,
5:38:12 PM [Apache] improper privileges, a crash, or a shutdown by another method.
5:38:12 PM [Apache] Press the Logs button to view error logs and check
5:38:12 PM [Apache] the Windows Event Viewer for more clues
5:38:12 PM [Apache] If you need more help, copy and post this
5:38:12 PM [Apache] entire log window on the forums

Unable to get Google App Engine PHP tutorial working

I'm following the GAE PHP tutorial but I can't get the local dev server to respond properly.
I run it with
dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./
and it starts up fine. When I view http://192.168.33.44:8080/ the logs show
INFO 2016-10-12 07:55:06,264 module.py:788] default: "GET / HTTP/1.1" 200 -
but I get a blank page. There's nothing in the tutorial explaining what to do if you have problems.
So far, I've:
Tried PHP 5.5 and 5.6 (remi): no difference
Put corrupt PHP in helloworld.php: no errors
Changed the handler to - url: /: blank page on /, 404 page for any other URL
Scoured Google Docs: no help
Scoured Google: no help
Asked the rubber duck: no help
I'm running Centos 7.2 via Vagrant and Google Cloud SDK 129.0.0.
Any and all help greatly appreciated.
[EDIT]
Additional data as requested
$ which php
/usr/bin/php
$ /usr/bin/php -v
PHP 5.5.38 (cli) (built: Sep 19 2016 13:45:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
$ which python
/usr/bin/python
$ /usr/bin/python -V
Python 2.7.5
$ cat app.yaml
runtime: php55
api_version: 1
handlers:
- url: /.*
script: helloworld.php
$ cat helloworld.php
<?php
echo 'Hello, World!';
$ dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./
Updates are available for some Cloud SDK components. To install them, please run:
$ gcloud components update
INFO 2016-10-13 08:21:22,699 devappserver2.py:769] Skipping SDK update check.
INFO 2016-10-13 08:21:22,730 api_server.py:205] Starting API server at: http://localhost:46453
INFO 2016-10-13 08:21:22,737 dispatcher.py:197] Starting module "default" running at: http://192.168.33.44:8080
INFO 2016-10-13 08:21:22,738 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO 2016-10-13 08:21:34,142 module.py:788] default: "GET / HTTP/1.1" 200 -
Response Headers from Chrome when accessing http://192.168.33.44:8080/
Cache-Control: no-cache
Content-Length: 0
Content-Type: text/html
Date: Thu, 13 Oct 2016 08:21:34 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Server: Development/2.0
I updated from 129 to 130 but the same problem exists
Turns out the problem was a trivial oversight...
dev_appserver.py --php_executable_path=/usr/bin/php --host=192.168.33.44 ./
Should have been
dev_appserver.py --php_executable_path=/usr/bin/php-cgi --host=192.168.33.44 ./
The App Engine requires the php-cgi binary, not the cli one. Ended up stumbling over it in the docs a while ago, but forgot to come back here and post the answer

Google Cloud Datalab - insufficient permissions for project

I am using Google AppEngine to run an application. I am now trying to setup the Google Cloud Datalab. I have the Compute Engine enabled. When I try to deploy, I get the following error in the log:
...
Jan 26 21:48:20 datalab-deploy-main-20160126-21-46-14 startupscript: Verifying that Managed VMs are enabled and ready.
Jan 26 21:48:22 datalab-deploy-main-20160126-21-46-14 startupscript: If this is your first deployment, this may take a while...#015If this is your first deployment, this may take a while.../#015If this is your first deployment, this may take a while...-#015If this is your first deployment, this may take a while...done.
Jan 26 21:48:22 datalab-deploy-main-20160126-21-46-14 startupscript: WARNING: If this is your first deployment, please try again.
Jan 26 21:48:22 datalab-deploy-main-20160126-21-46-14 startupscript: ERROR: (gcloud.preview.app.deploy) Server responded with code [400]:
Jan 26 21:48:22 datalab-deploy-main-20160126-21-46-14 startupscript: Bad Request Unexpected HTTP status 400.
Jan 26 21:48:22 datalab-deploy-main-20160126-21-46-14 startupscript: Failed Project Preparation (app_id='s~prjectId'). App Engine service account has insufficient permissions for project. Developer or owner required.
Any ideas what to do?

Google App Engine with GWT Fails

I am attempting to run the sample GWT application with Google App Engine. I simply installed the Google Plugin for Eclipse and created a new project that uses both GWT and GAE, with the sample code project. The library versions that I'm using are: JDK-1.7.0_55; GAE-1.6.4; GWT-2.6.0. I'm getting the following exception when I try to run locally:
Initializing App Engine server
Jun 14, 2014 11:36:48 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jun 14, 2014 11:36:48 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Andy\workspace\GAETest\war\WEB-INF/appengine-web.xml
Jun 14, 2014 11:36:48 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\Andy\workspace\GAETest\war\WEB-INF/web.xml
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/appengine/api/utils/SystemProperty
at com.google.appengine.tools.development.AbstractContainerService.setSystemProperties(AbstractContainerService.java:438)
at com.google.appengine.tools.development.AbstractContainerService.staticInitialize(AbstractContainerService.java:386)
at com.google.appengine.tools.development.AbstractContainerService.loadAppEngineWebXml(AbstractContainerService.java:369)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:237)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:522)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1104)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:844)
at com.google.gwt.dev.DevMode.main(DevMode.java:322)
Caused by: java.lang.ClassNotFoundException: com.google.appengine.api.utils.SystemProperty
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at com.google.appengine.tools.development.DevAppServerClassLoader.loadClass(DevAppServerClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 10 more
I've tried adding various jar files that include the SystemProperty class, but I nothing seems to work correctly. I would really appreciate any suggestions or direction on this ... I know that it should work in some form, since I've seen GWT applications running on GAE.
Make sure that appengine-api.jar (choose one that comes with the App Engine SDK) is included in /war/WEB-INF/lib/ folder. It's not enough to add it to your classpath. Eclipse should give you a warning in Problems tab.

Resources