Project

General

Profile

Bug #486

Java AppServer fails to get instanceID using Service API

Added by Anton Leonov about 1 year ago. Updated about 1 year ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Estimated Time:
Deployment type:
AppScale - self deployed

Description

I believe stack trace should be enough for a further investigation:

WARNING: /modules/versions-details
com.google.appengine.api.labs.modules.ModulesException: No valid instance id for this instance.
        at com.google.appengine.api.labs.modules.ModulesServiceImpl.getCurrentInstanceId(ModulesServiceImpl.java:75)
        at com.appscale.hawkeye.modules.GetVersionDetailsHandlerServlet.doGet(GetVersionDetailsHandlerServlet.java:29)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Java code can be found here: https://github.com/AppScale/hawkeye/pull/117/files#diff-cdf7813908fa46f7bf416e941bae89dc


Related issues

Related to AppScale - Bug #484: Incorrect version details provided by services API New

History

#1 Updated by Anton Leonov about 1 year ago

  • Related to Bug #484: Incorrect version details provided by services API added

#2 Updated by Chris Donati about 1 year ago

  • Status changed from New to In Progress

My goal was to generate a fake instance ID like the Python AppServer does.

I first tried modifying the LocalHttpRequestEnvironment, where this property is set, but since each request generates a new environment, the instance ID would change for each request.

I then tried passing in the dummy instance ID from the JettyContainerService in handleImpl. This made the instance ID consistent across requests, but it turns out that the main SDK process calls the runtime's getCurrentInstanceId API, so it did not function correctly when the API call did not raise an exception. (The main SDK process expects the instance ID to be -1).

I tried modifying DevAppServerModulesFilter to always return -1 instead of calling the runtime's API, but I got quite a few missing class errors from the packages that it imports, and I'm not sure if any other places call that user API.

I may continue looking into this if I have time, but I don't think it should be a blocker for the release.

#3 Updated by Graziano Obertelli about 1 year ago

  • Target version deleted (3.4)

Also available in: Atom PDF