Running modules project in devserver using gcloud command

357 views Asked by At

I have created a project using maven with the following "layout" - proj-ear - module1-war - module2-war

Running this with "mvn appengine:devserver" works just fine, both apps/modules starts and shows up in admin console. However, I am not able to run it with "mvn gcloud:run" (which I believe is necessary if/when I want to move a module to a managed vm?)

I get: ...

[INFO] INFO: Starting API server at: `http://localhost:50500`

[INFO] INFO: Starting module "module1" running at: `http://localhost:8080`

[INFO] INFO: Applying all pending transactions and saving the datastore

...

[INFO] google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8081

[ERROR] Error: gcloud app xxx exit code is: 1

...

Using mvn:run ends up in calling the actual "gcloud preview app run" command, so I dont think this is a maven problem.

Why is this happening and any ideas how to resolve?

1

There are 1 answers

0
Nick On

This is a common family of error when running servers on a computer. The error is coming from the wsgi_server code, which is attempting to open a socket on port 8081, I assume for module2. It fails, probably due to the port already being claimed by another process.

You can check which processes are listening on these ports using commands netstat for windows or lsof -i for linux/mac. Terminating any processes that are using ports your devserver will request (probably just a previous run of devserver) should allow the new devserver to bind on that port.