0
votes

I'm trying to setup a multi-module Appengine app with one module as managed VM.

But for starters, I'm checking if I can run gcloud preview app run on the AppEngine Java multi-modules sample from here: https://github.com/GoogleCloudPlatform/appengine-modules-sample-java

When I import it in Android Studio, and run the appengineRun build rule, it builds fine. However, if I go to command prompt, and run the following:

E:\appengine-modules-sample-java-master>gcloud preview app run appengine-modules
-guestbook/src/main/webapp

Then I get the following error:

INFO: Skipping SDK update check. INFO: Starting API server at: http://localhost:51296 INFO: Starting module "default" running at: http://localhost:8080 INFO: Starting admin server at: http://localhost:8000 Exception in thread "main" java.lang.RuntimeException: Unable to create a DevApp Server ERROR: bad runtime process port ['']
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory.doCreateDevAppServer(DevAppServer2Factory.java:87)
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory.access$000(DevAppServer2Factory.java:35)
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory$1.run(DevAppServer2Factory.java:47)
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory$1.run(DevAppServer2Factory.java:45)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory.createDevAppServer(DevAppServer2Factory.java:45)
        at com.google.appengine.tools.development.devappserver2.StandaloneInstan ce$StartAction.apply(StandaloneInstance.java:119)
        at com.google.appengine.tools.development.devappserver2.StandaloneInstan ce$StartAction.apply(StandaloneInstance.java:82) ERROR: bad runtime process port ['']
        at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.j ava:48)
        at com.google.appengine.tools.development.devappserver2.StandaloneInstan ce.run(StandaloneInstance.java:66)
        at com.google.appengine.tools.development.devappserver2.StandaloneInstan ce.main(StandaloneInstance.java:44) Caused by: java.lang.RuntimeException: Cannot generate policy file.
        at com.google.apphosting.utils.security.SecurityManagerInstaller.install (SecurityManagerInstaller.java:96)
        at com.google.appengine.tools.development.devappserver2.DevAppServer2Fac tory.doCreateDevAppServer(DevAppServer2Factory.java:72)
        ... 10 more Caused by: java.io.IOException: Access is denied
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1006)
        at java.io.File.createTempFile(File.java:1981)
        at java.io.File.createTempFile(File.java:2032)
        at com.google.apphosting.utils.security.SecurityManagerInstaller.generat ePolicyFile(SecurityManagerInstaller.java:144)
        at com.google.apphosting.utils.security.SecurityManagerInstaller.install (SecurityManagerInstaller.java:94)
        ... 11 more INFO: default: "GET /_ah/warmup HTTP/1.1" 500 2167

I get the same error for any Java AppEngine module that I try to run with gcloud preview app run. Does gcloud app not support running a Java AppEngine module?

What am I doing wrong?

UPDATE: I ran the command again with the latest gcloud tools as of today, and I still get the error above.

1
Did you set vm=true to bypass the security manager? (cloud.google.com/appengine/docs/java/managed-vms) - loosebazooka
I didn't... but wouldn't that make the standard java AppEngine module to also run on Managed VMs? And hence I would lose the automatic scaling that non-Managed VM modules have by default? Is it not allowed to run one module on automatic scaling, and no Managed VM, while running another on Managed VM? (My understanding is, even then, I'd still have to run/deploy using gcloud - yaraju
I set <vm>true></vm> and updated the question with the new error. - yaraju
Yes, you can configure the one making file API calls to me a managed VM, and your other standard modules to be regular. I think managed VMs have autoscaling : cloud.google.com/appengine/docs/managed-vms/config - loosebazooka
Great. I've updated the question to remove vm=true then, since I'm trying to run the default module as a standard module first. - yaraju

1 Answers

1
votes

This problem happens only when I run on Windows. Running Command Prompt as Administrator and executing the gcloud commands there fixes this "bad port/Access Denied" problem.