Skip to content

Refreshing Live Data over HTTP is not working on VS Code #872

Closed

Description

@Eskibear

Following https://github.com/spring-projects/sts4/wiki/Live-Application-Information , configure boot-java.remote-apps to get live data over http, it failed to refresh data.

Originally I wanted to connect my app running on Azure, which only expose actuator endpoints over HTTP (JMX port is internal, no public access). It failed to refresh the data. Then I tried locally, it also failed with same error message and same sts-log.

settings:

    "boot-java.remote-apps": [
        // {
        //     "host": "my-app-name.azuremicroservices.io",
        //     "jmxurl": "https://my-app-name.azuremicroservices.io/actuator"
        // },
        {
            "host": "localhost",
            "jmxurl": "http://localhost:8080/actuator"
        }
    ],

exception location:
https://github.com/spring-projects/sts4/blob/e9c813279f15f5f48144d5d8eb13c232e62c4134/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverHttp.java#L135

sts log:

15:56:50.895 [pool-10-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - Creating RemoteStringBootApp: RemoteBootAppData [jmxurl=http://localhost:8080/actuator, host=localhost, urlScheme=https, port=443, manualConnect=false, keepChecking=true, processId=null, processName=null]
15:56:50.895 [pool-10-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - connect to process: remote process - http://localhost:8080/actuator
15:56:50.895 [pool-10-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Connecting to process: remote process - http://localhost:8080/actuator - retry no: 0
15:56:50.895 [pool-10-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - done
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - refresh process: remote process - http://localhost:8080/actuator
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Refreshing data from Spring process: remote process - http://localhost:8080/actuator - retry no: 0
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - refresh process: remote process - http://localhost:8080/actuator
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Refreshing data from Spring process: remote process - http://localhost:8080/actuator - retry no: 0
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - refresh process: remote process - http://localhost:8080/actuator
15:56:50.900 [pool-6-thread-4] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Refreshing data from Spring process: remote process - http://localhost:8080/actuator - retry no: 0
...
15:57:18.055 [pool-6-thread-5] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Refreshing data from Spring process: remote process - http://localhost:8080/actuator - retry no: 10
15:57:21.069 [pool-6-thread-5] ERROR o.s.i.v.b.j.l.v.SpringProcessLiveDataExtractorOverJMX - Error parsing beans
org.springframework.web.client.HttpClientErrorException$NotFound: 404 : [no body]
	at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:113)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:168)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122)
	at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:819)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:334)
	at org.springframework.ide.vscode.boot.java.livehover.v2.HttpActuatorConnection.getLiveMetrics(HttpActuatorConnection.java:87)
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessLiveDataExtractorOverHttp.getLiveMetrics(SpringProcessLiveDataExtractorOverHttp.java:388)
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessLiveDataExtractorOverHttp.retrieveLiveGcPausesMetricsData(SpringProcessLiveDataExtractorOverHttp.java:201)
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessConnectorOverHttp.refreshGcPausesMetrics(SpringProcessConnectorOverHttp.java:120)
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessConnectorService.lambda$scheduleRefresh$4(SpringProcessConnectorService.java:247)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
15:57:21.071 [pool-6-thread-5] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - problem occured during process live data refresh
java.lang.Exception: no live gc pauses metric data received, lets try again
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessConnectorOverHttp.refreshGcPausesMetrics(SpringProcessConnectorOverHttp.java:135)
	at org.springframework.ide.vscode.boot.java.livehover.v2.SpringProcessConnectorService.lambda$scheduleRefresh$4(SpringProcessConnectorService.java:247)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
15:57:21.071 [pool-6-thread-5] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - disconnect from process: remote process - http://localhost:8080/actuator
15:57:21.071 [pool-6-thread-5] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorService - Disconnect from process: remote process - http://localhost:8080/actuator - retry no: 0

Activity

  1. Eskibear commented on Nov 8, 2022

    @Eskibear
    ContributorAuthor

    sample project is spring-petclinic, and I was using latest CI build vscode-spring-boot-1.41.0-202211080047.vsix

  2. martinlippert commented on Nov 8, 2022

    @martinlippert
    Member

    Yepp, I can reproduce the issue, will work on a fix.

  3. added this to the 4.17.0.RELEASE milestone on Nov 8, 2022
  4. BoykoAlex commented on Nov 8, 2022

    @BoykoAlex
    Contributor

    Hopefully #875 would fix it but it requires discussion before going in.

  5. Eskibear commented on Nov 9, 2022

    @Eskibear
    ContributorAuthor

    Thanks for the quick fix.
    Some additional thoughts about remote-apps scenario. In such cases, apps are already running with their own configurations, that some actuator endpoints might not be exposed. Here querying gcPauses breaks the whole live data feature even though other data like beans and request mappings are successfully fetched.

    I think we should make it as robust as not to break the whole feature when some endpoints are not exposed. E.g. when management.endpoints.web.exposure.exclude=metrics according to actuator docs. WDYT?

  6. martinlippert commented on Nov 9, 2022

    @martinlippert
    Member

    @Eskibear Agree, a problem while fetching the metrics data should not break the whole feature. But such a problem should also not be ignored silently without telling the user. Otherwise users might be confused why, e.g., GC information is not showing up in the graph. So we need some kind of error reporting mechanism here to show those problems on the UI. WDYT?

  7. Eskibear commented on Nov 9, 2022

    @Eskibear
    ContributorAuthor

    we need some kind of error reporting mechanism here to show those problems on the UI.

    Agree. In such case, ideally, I imagine that maybe we can show something like "GC information is unavailable" on/next to the graph, possibly with readable error messages or some links to docs, etc.

    I have been revisiting live info with remote process recently, and I find some minor issues/potential improvements about current implementation of memory view. I'll create issues accordingly for discussion.

  8. BoykoAlex commented on Nov 9, 2022

    @BoykoAlex
    Contributor

    Should be fixed now with a411663

  9. martinlippert commented on Nov 10, 2022

    @martinlippert
    Member

    @Eskibear I tried this with the latest Spring Tools extension CI build and the pre-release dashboard version.

    It looks like the overall mechanism to fetch the data via HTTP seems to work, since I can see the live hovers showing up in the source code.

    The remote process also shows up in the dashboards view for beans (not for request mappings though), but there are no beans showing up in the tree.

  10. Eskibear commented on Nov 10, 2022

    @Eskibear
    ContributorAuthor

    The remote process also shows up in the dashboards view for beans (not for request mappings though)

    That's fixed in microsoft/vscode-spring-boot-dashboard@57ca22d . It will be auto shipped in next pre-release version (probably 10 hours later from now).

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

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions