Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

javax.servlet.UnavailableException when trying to run Endpoints v1.1 locally using the Cloud SDK Java tooling #43

Closed
patflynn opened this issue Jan 23, 2017 · 18 comments

Comments

@patflynn
Copy link

patflynn commented Jan 23, 2017

Steps to reproduce:

  1. Checkout https://github.com/patflynn/appengine-potpourri/tree/cloud-sdk-refactor
  2. run gradlew :endpoints-frontend:appengineRun
  3. observe error included below
  • this seems to happen on Windows and Linux with Maven, Gradle, or Cloud Tools for IntelliJ.
  • works fine using the old AppCfg based tooling.

`PS C:\Users\patrick\Projects\appengine-potpourri-gradle> .\gradlew.bat :endpoints-frontend:appengineRun
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doL
ast(Action) instead.
at build_6t335i7cz5p80m7el4p825c7o.run(C:\Users\patrick\Projects\appengine-potpourri-gradle\jdo-backend\build.gr
adle:26)
:endpoints-frontend:compileJava UP-TO-DATE
:endpoints-frontend:processResources UP-TO-DATE
:endpoints-frontend:classes UP-TO-DATE
:endpoints-frontend:war UP-TO-DATE
:endpoints-frontend:explodeWar UP-TO-DATE
:endpoints-frontend:assemble UP-TO-DATE
:endpoints-frontend:appengineRun
INFO 2017-01-23 17:28:45,980 devappserver2.py:764] Skipping SDK update check.
INFO 2017-01-23 17:28:46,048 api_server.py:268] Starting API server at: http://localhost:49832
INFO 2017-01-23 17:28:46,052 dispatcher.py:199] Starting module "default" running at: http://localhost:8080
INFO 2017-01-23 17:28:46,053 admin_server.py:116] Starting admin server at: http://localhost:8000
Jan 23, 2017 10:28:47 PM com.google.appengine.tools.development.AbstractContainerService configure

WARNING: Null value for containerConfigProperties.get(devappserver.portMappingProvider)

Jan 23, 2017 10:28:47 PM com.google.apphosting.utils.jetty.JettyLogger info

INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger

Jan 23, 2017 10:28:47 PM com.google.apphosting.utils.jetty.JettyLogger info

INFO: jetty-6.1.x

Jan 23, 2017 10:28:48 PM com.google.apphosting.utils.jetty.JettyLogger info

INFO: Started SelectChannelConnector@localhost:49833

Jan 23, 2017 10:28:48 PM com.google.appengine.tools.development.AbstractModule startup

INFO: Module instance default is running at http://localhost:49833/

Jan 23, 2017 10:28:48 PM com.google.appengine.tools.development.AbstractModule startup

INFO: The admin console is running at http://localhost:49833/_ah/admin

Jan 23, 2017 10:28:48 PM com.google.appengine.tools.development.devappserver2.DevAppServer2Impl doStart

INFO: Dev App Server is now running

Jan 23, 2017 10:28:51 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet

WARNING: No file found for: /_ah/warmup

INFO 2017-01-23 17:28:51,055 module.py:806] default: "GET /_ah/warmup HTTP/1.1" 404 83
Jan 23, 2017 10:29:09 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet

WARNING: No file found for: /favicon.ico

Jan 23, 2017 10:29:09 PM com.google.appengine.tools.development.devappserver2.RemoteApiDelegate log

SEVERE: [1485210549900000] javax.servlet.ServletContext log: unavailable
com.google.appengine.tools.remoteapi.RemoteApiException: response was a python exception:
cgoogle.appengine.runtime.apiproxy_errors
ApplicationError
p0
(I1
tp1
Rp2
(dp3
S'application_error'
p4
I1
sS'error_detail'
p5
S''
p6
sb.

    at com.google.appengine.tools.development.devappserver2.RemoteRpc.call(RemoteRpc.java:63)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate.makeSyncCall(RemoteApiDelegate.java:45

)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate$1.call(RemoteApiDelegate.java:56)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate$1.call(RemoteApiDelegate.java:52)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

Jan 23, 2017 10:29:09 PM com.google.apphosting.utils.jetty.JettyLogger warn

WARNING: /_ah/api/discovery/v1/apis/potApi/v1/rest

com.google.appengine.tools.remoteapi.RemoteApiException: response was a python exception:
cgoogle.appengine.runtime.apiproxy_errors
ApplicationError
p0
(I1
tp1
Rp2
(dp3
S'application_error'
p4
I1
sS'error_detail'
p5
S''
p6
sb.

    at com.google.appengine.tools.development.devappserver2.RemoteRpc.call(RemoteRpc.java:63)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate.makeSyncCall(RemoteApiDelegate.java:45

)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate$1.call(RemoteApiDelegate.java:56)

    at com.google.appengine.tools.development.devappserver2.RemoteApiDelegate$1.call(RemoteApiDelegate.java:52)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

`

@tangiel
Copy link
Contributor

tangiel commented Jan 25, 2017

Is there a way to set remote debugging up with the new plugin? Last time I saw this error it was because the gcloud dev server has very different error handling, causing different Java exceptions to be thrown. That was fixed in another library so this is a different issue.

@patflynn
Copy link
Author

@tangiel as long as you're only debugging one module there is.

You can use our IntelliJ or Eclipse integration :
https://cloud.google.com/tools/intellij/docs/
https://cloud.google.com/eclipse/docs/

If you're using maven or gradle with the com.google.cloud.tools appengine plugins you can specify the debugger args via the jvmFlags property.

I believe the raw flag to the dev_appserver.py is --jvm_flag.

@tangiel
Copy link
Contributor

tangiel commented Jan 27, 2017

Where does jvmFlags go? With the new plugin, I get:

> Could not set unknown property 'jvmFlags' for object of type com.google.cloud.tools.gradle.appengine.model.AppEngineStandardExtension.

@patflynn
Copy link
Author

patflynn commented Jan 27, 2017 via email

@loosebazooka
Copy link
Contributor

appengine {
  run {
    jvmFlags = ["blah", "blah"]
 }
}

For reference : ./gradlew appengineShowConfig to see all available parameters and what they are currently set to

@patflynn
Copy link
Author

patflynn commented Feb 1, 2017

@tangiel Any thoughts on this? Let me know if we can do anything to help.

@tangiel
Copy link
Contributor

tangiel commented Feb 2, 2017

@patflynn I'm unable to catch the original exception for some reason, still trying to figure that out. The exception as is is not helpful since it's a bunch of garbled junk.

@patflynn
Copy link
Author

patflynn commented Feb 3, 2017 via email

@tangiel
Copy link
Contributor

tangiel commented Feb 3, 2017

@patflynn I think this might be mysteriously fixed by the changes since 2.0.0. I think they should be aware of this issue. The weird stacktrace is a Python pickled object but I don't think I'm getting the correct information out of it.

@patflynn
Copy link
Author

patflynn commented Feb 6, 2017

@tangiel
My current repro project uses 2.0.0. You think I should open something with the devappserver?

@tangiel
Copy link
Contributor

tangiel commented Feb 6, 2017

My guess is that there is an issue on both sides. My current hypothesis from the fixes past 2.0.0 is that we're calling a legacy GAE service that isn't available in dev server. For their side, the unhelpful error message is the error.

@patflynn
Copy link
Author

patflynn commented Feb 7, 2017

http://stackoverflow.com/questions/41839651/appengine-local-dev-server-for-google-cloud-endpoints-framework-v2-not-work

I added version to the appengine-web.xml and this magically started working.

version in appengine-web.xml is deprecated on the toolchain.

@patflynn
Copy link
Author

patflynn commented Feb 7, 2017

b/33657599

@tangiel
Copy link
Contributor

tangiel commented Feb 7, 2017

Is the requirement there because of a faulty assumption on the framework side or something is up with dev server? Guessing the former, might be because we were using the dev module server to construct a hostname and that might be trying to get the version out of appengine-web.xml?

@patflynn
Copy link
Author

patflynn commented Feb 7, 2017

@ludoch

@ludoch
Copy link

ludoch commented Feb 8, 2017

Can someone look at the endpoints code/libs to see if version/appid is accessed from the appengine-web.xml?

@tangiel
Copy link
Contributor

tangiel commented Feb 8, 2017

I don't think it's accessed directly, maybe through the dev modules service, which I believe I recently removed. Once I release 1.0.1, it may work.

@tangiel
Copy link
Contributor

tangiel commented Feb 17, 2017

This should now be fixed.

@tangiel tangiel closed this as completed Feb 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants