App Engine deployment fails with "Client Error (400) The request is invalid for an unspecified reason." - google-app-engine

my python27 app deployment is failing for some reasons:
2012-03-09 16:46:25 Running command: "['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=malartre#scolab.com', '--passin', 'update', 'C:\\Users\\XXXXXXXXXXXXXX\\GoogleAppEngine\\XXXXXXXXXXXXXX']"
Application: XXXXXXXXXXXXXX; version: 1
Host: appengine.google.com
Starting update of app: XXXXXXXXXXXXXXX, version: 1
Getting current resource limits.
Password for malartre#scolab.com: Scanning files on local disk.
Scanned 500 files.
Scanned 1000 files.
Scanned 1500 files.
Scanned 2000 files.
Scanned 2500 files.
Cloning 2973 static files.
Cloned 100 files.
Cloned 200 files.
Cloned 300 files.
Cloned 400 files.
Cloned 500 files.
Cloned 600 files.
Cloned 700 files.
Cloned 800 files.
Cloned 900 files.
Cloned 1000 files.
Cloned 1100 files.
Cloned 1200 files.
Cloned 1300 files.
Cloned 1400 files.
Cloned 1500 files.
Cloned 1600 files.
Cloned 1700 files.
Cloned 1800 files.
Cloned 1900 files.
Cloned 2000 files.
Cloned 2100 files.
Cloned 2200 files.
Cloned 2300 files.
Cloned 2400 files.
Cloned 2500 files.
Cloned 2600 files.
Cloned 2700 files.
Cloned 2800 files.
Cloned 2900 files.
Cloning 3 application files.
Uploading 4 files and blobs.
Uploaded 4 files and blobs
Compilation starting.
Compilation completed.
Starting deployment.
Rolling back the update.
Error 400: --- begin server output ---
Client Error (400)
The request is invalid for an unspecified reason.
--- end server output ---
2012-03-09 16:47:14 (Process exited with code 1)
You can close this window now.
How can I debug that?
Thanks,
Carl

Just recording my experience in this related question.
I got a 'Client Error 400/unspecified reason' because my app.yaml error handlers were pointing to files in a static directory.
I moved the error files to a separate directory and updated app.yaml paths.
Update worked properly.

i know this is an old question, but i thought i would provide the solution that worked for me. Select Control from the GAE Launcher, then Clear Deployment Credential. Deploy again. The deployment script will open a web page where GAE is requesting access to use your Google account to authenticate. the answer from Jen Tong helped me get to my solution.

This is a fall-back error message that is triggered when your deployment sends very unexpected data to App Engine during deployment.
In other words, there's no quick fix here, but there are a couple things you can check:
Check your apps metadata in app.yaml for Python and appengine-web.xml for Java. Double check each field. If the application name is very wrong, it may trigger this error.
Make sure that your deployment credentials are valid. If you're authenticating with OAuth 2.0, try using password based authentication.

Deleting some files worked for me. Looks like there may be a 1000 file hard limit for apps on GAE, and this obscure error code is at least in part used to document being over the limit.
http://www.adampresley.com/2011/06/gae-and-client-error-400.html

I has this because I had an rogue ) in my app.yaml. I'd check the last thing(s) you did for errors because although your app may upload, an error may cause the application not to deploy.

One of the causes of this error is having more than 1000 files in a folder.
For me I had about 1k images but then 9 folders and I think that put it over the top. I haven't checked if the limitation also exists for folder counts but I imagine it does.

Related

AppEngine deploy error - HttpIoException: Error posting to URL

Today we start recieving this message when trying to deploy.
...
Scanned 8750 files.
Scanned 9000 files.
Scanned 9250 files.
Scanned 9500 files.
Scanned 9750 files.
Initiating update.
Cloning 711 static files.
Cloning 9233 application files.
Cloned 2000 files.
Cloned 4000 files.
Cloned 6000 files.
Cloned 8000 files.
Deploying:
Uploading 0 files.
Initializing precompilation...
Deploying new version.
Rolling back the update.
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/deploy?app_id=facturanube&version=1&
500 Internal Server Error
<h3>Server Error</h3><p>A server error has occurred.</p>
Debugging information may be found in C:\Users\usuario\AppData\Local\Temp\appengine-deploy6314649189927600314.log
Debugging information file contents:
Unable to update:
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/deploy?app_id=si-nube&version=1&
500 Internal Server Error
<h3>Server Error</h3><p>A server error has occurred.</p>
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:303)
at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:254)
at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:233)
at com.google.appengine.tools.admin.LoggingClientDeploySender.send(LoggingClientDeploySender.java:47)
at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:1100)
at com.google.appengine.tools.admin.AppVersionUpload.deploy(AppVersionUpload.java:949)
at com.google.appengine.tools.admin.AppVersionUpload.commit(AppVersionUpload.java:850)
at com.google.appengine.tools.admin.AppVersionUpload.uploadFilesTransaction(AppVersionUpload.java:176)
at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:151)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:474)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:400)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Important considerations:
The appengine-web.xml file has no errors.
We tried deploying in different versions with no success.
The application can be deployed in another appengine application, but not in our production application.
We have no cuota-related problems. Our payments have no
problems.
Our current versions:
GWT SDK 2.4.0
App Engine 1.9.54
Java 7
Update
I was able to deploy today (2018/03/18) with no changes to code or configuration files. I guess Google did something to solve the issue.
500 A server error has occurred on deployment is usually related to malformed configs, including app.yaml and cron.yaml (and Java equivalents). Or if unsupported stanzas are included. Please check your GAE app configs and attempt to strip them down to the essentials just to narrow down which stanzas/flags are messing up the deployment.

Can't deploy my App Engine since SDK 1.9.46

Since I upgraded my Gradle build to deploy my App Engine application with SDK 1.9.46, I get deployment conflict messages, like the one below.
Beginning interaction for module admin...
0% Created staging directory at: '/var/folders/m8/6z4h4k2x11s3whxrqmd79lym0000gn/T/appcfg2292422843793738444.tmp'
5% Scanning for jsp files.
8% Generated git repository information file.
20% Scanning files on local disk.
25% Scanned 250 files.
28% Scanned 500 files.
31% Scanned 750 files.
33% Scanned 1000 files.
34% Initiating update.
Nov 13, 2016 11:11:41 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/create?module=admin&app_id=the-outdoor-game&version=dev&
409 Conflict
There is an operation pending for this application: AppLock held for "Updating engine_version_id='dev' within engine_id='default'." acquired by Peter.Fortuin at 2016-11-13 09:15:05.482616 GMT. Please wait and try again or use 'appcfg rollback' to attempt to cleanly abort the current operation.
This is try #0
A rollback if not solving the problem. The only thing that seems to work is downgrading the App Engine SDK to 1.9.44. But that gives me other problems that I don't want to solve.
Anybody has any idea how to solve this? Can it be that this is a bug in the 1.9.46 SDK? Anybody else seeing the same thing?
I have resolved this problem by changing 'service' to 'module' in appengine-web.xml of my module.
See https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/issues/268 for more information.

Hitting Max number of files and blobs for Google App Engine

When trying to deploy my application:
appcfg.py update --oauth2 .
I'm getting:
PM Rolling back the update.
Error 400: --- begin server output ---
Max number of files and blobs is 10000.
--- end server output ---
How do I solve this?
You "solve" it by having less files deployed when you deploy your project. You have a few choices.
You can use Skipfiles in your app.yaml to exclude some files from being deployed:
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
You might want to, for example, exclude .readme files, compiled python files etc.
Or you can use ZipImport and compress your python packages and they will be unzipped on the fly during import.
Or if you are also uploading lots of static assets, put them in a bucket instead as the other answer suggests.
Looks like you are hitting this quota: https://cloud.google.com/appengine/docs/quotas#Deployments
Could you shift many of your files to Cloud Storage?

Silverlight web project is always not up to date

Silverlight web project is always not up to date. That leads to web-project rebuilding each time, even if it's never changed and it's dependencies never changed.
Is it possible to build web-project only when neccessary, not every time I start an app using VS?
Minimal build log:
Build: 1 succeeded, 0 failed, <...> up-to-date, 0 skipped
Diagnostic build log:
Project '<...>.Web' is not up to date. Input file '<...>.xap' is modified
after output file '<...>.Web.pdb'.
I believe this may be related to how MSBuild deposits xap files into a web project's ClientBin directory after it has already compiled the dll/pdb for that web project.
Something that has worked for me is to add a command-line post-build event to the web project that "touches" the pdb file, copying it into the same location. This makes the pdb have a date-modified value that is after when the xap gets pulled into the ClientBin directory.
Here's the command:
copy /b "$(ProjectDir)obj\Debug\$(TargetName).pdb" +,,
Got the skeleton of the script from this StackOverflow answer: https://stackoverflow.com/a/1190325/1800930
You may have to change the path, depending on what specific error you're getting.

Server giving 404 not found

I am deploying a spring application which contains files with around 100000 entries. Each row in the file has about 23 chars.
The app deploys fine when a file has 100000 entries but when I increase the contents to 400000 entries, when I access my app url I get a 404 Not found error.
I need to figure out what causes the crash ( whether a memory problem or something else ) but I do not see anything erroneous in the tomcat log files, using the command vmc files [app_name] tomcat/logs/catalina.... just info messages related to server startup.
Are there other options to debug the issue?
Thanks,
Cristian
I would look into what Dan has mentioned! Also can you look at the logs folder to see if the files there give more information.
vmc logs <app-name>
or
vmc files <app-name> logs/stderr.log
vmc files <app-name> logs/stdout.log
Okay, the application was using too much memory, as a result the Java processes was being destroyed causing the router to return a 404 when trying to route to the application.

Resources