Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stop App Engine local server in certain case #1964

Closed
chanseokoh opened this issue May 17, 2017 · 2 comments
Closed

Cannot stop App Engine local server in certain case #1964

chanseokoh opened this issue May 17, 2017 · 2 comments
Assignees

Comments

@chanseokoh
Copy link
Contributor

chanseokoh commented May 17, 2017

I think this is likely a dev_appserver1 issue.

Steps to reproduce:

  • Create a new HelloWorld project.
  • Change the text of <servlet-name> in web.xml to something else (e.g., to NonExistingHelloAppEngine).
    • This is a semantic configuration error, so deploying or running this app itself shouldn't be a problem.
    • BTW, our validation will correctly mark an error that the HelloAppEngine servlet does not exist, which is nice.
  • Run As > App Engine. The browser will show 503 SERVICE_UNAVAILABLE, and the console will also show the following stack trace:
    WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@1023b85{/,/ ... /workspace_qual/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/A}
    java.lang.IllegalStateException: No such servlet: HelloAppEngine
    	at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1026)
    
  • Try stopping the server. The server won't stop. You can see the following Eclipse log:
WARNING: Error terminating server: Error connecting to http://localhost:8080/_ah/admin/quit
com.google.cloud.tools.appengine.api.AppEngineException: Error connecting to http://localhost:8080/_ah/admin/quit
        at com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDevServer1.stop(CloudSdkAppEngineDevServer1.java:166)
        at com.google.cloud.tools.eclipse.appengine.localserver.server.LocalAppEngineServerBehaviour.stop(LocalAppEngineServerBehaviour.java:139)
        at org.eclipse.wst.server.core.internal.Server.stopImpl2(Server.java:3688)
        at org.eclipse.wst.server.core.internal.Server.stopImpl(Server.java:3645)
        at org.eclipse.wst.server.core.internal.Server$StopJob.run(Server.java:403)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://localhost:8080/_ah/admin/quit
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDevServer1.stop(CloudSdkAppEngineDevServer1.java:158)
        ... 5 more

So, the dev_appserver1 responds with 503 when we connect to http://localhost:8080/_ah/admin/quit.

@chanseokoh
Copy link
Contributor Author

Internal bug: 38378355

@briandealwis
Copy link
Member

From #2771 (comment):

The Servers and Console views offer a Terminate button which is only active when the server is in a Started state. By initiating a terminate, we put the server into Stopping… and so the terminate buttons are no longer enabled.

The Debug view on the other hand, allows multiple terminates until the launch says it is actually terminated. We have code in our LocalAppEngineServerBehaviour to terminate the process if a stop request is initiated and the server is already in a Stopping… state.

@aleguerrini a workaround is to use the Terminate option twice from the Debug view. The first terminate will put the server into a Stopping… state, and the second terminate will forcibly terminate the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants