SoftwareAG / webmethods-api-control-plane

webMethods API Control Plane enables centralized platform to manage API Mangement products. It offers functionalities to make decisions based on the performance metrics and patterns. Repository hosting tutorials, code samples, OpenAPI specification files and postman collections.
Apache License 2.0
6 stars 4 forks source link

In API Gateway docker container, Control plane agent startup failed to the SSL enabled API control plane URL #40

Closed pmsgupta closed 6 months ago

pmsgupta commented 7 months ago

Setup details: In my laptop, using docker, API Control plane started successfully with steps listed here Running API Gateway docker container using docker compose with environment variables and steps listed here

Issue Details: But unable to register API Gateway container as runtime with local API Control plane. I am seeing below error in Control plane startup.

jvm 1 | ISSERVER|| 2023-12-04 01:01:11 GMT [YAI.0005.9999E] (tid=579) Control plane Agent startup failed with exception:: I/O error on POST request for "https://localhost:8080/api/assetcatalog/v1/runtimes": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused) jvm 1 | org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:791) jvm 1 | org.springframework.web.client.RestTemplate.execute(RestTemplate.java:717) jvm 1 | org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:608) jvm 1 | com.softwareag.controlplane.agent.core.utils.ProxyService.callback(ProxyService.java:80) jvm 1 | com.softwareag.controlplane.agent.core.utils.ProxyService.forwardRequest(ProxyService.java:70) jvm 1 | com.softwareag.controlplane.agent.core.configuration.ControlPlaneProxyImpl.send(ControlPlaneProxyImpl.java:102)
jvm 1 | com.softwareag.controlplane.agent.core.configuration.ControlPlaneProxyImpl.doPost(ControlPlaneProxyImpl.java:57) jvm 1 | com.softwareag.controlplane.agent.core.processors.RuntimeRegistrationProcessor.publishRuntimeToControlPlane(RuntimeRegistrationProcessor.java:70) jvm 1 | com.softwareag.controlplane.agent.core.init.Agent.start(Agent.java:36) jvm 1 | com.softwareag.controlplane.agent.apigateway.impl.RuntimeAPIGatewayDataProvider.initializeAgent(RuntimeAPIGatewayDataProvider.java:29) jvm 1 | com.softwareag.apigateway.is.init.ISPackageManager$PostStartupRunner.run(ISPackageManager.java:566) jvm 1 | java.base/java.lang.Thread.run(Thread.java:829) jvm 1 | {1} jvm 1 | ISSERVER|| 2023-12-04 01:01:11 GMT [YAI.0005.0076E] (tid=579) [default][0cec232983af] An error occurred in postStartupProcessing. Cause: I/O error on POST request for "https://localhost:8080/api/assetcatalog/v1/runtimes": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused) org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://localhost:8080/api/assetcatalog/v1/runtimes": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused) jvm 1 | at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:791) ~[spring-web.jar:?] jvm 1 | at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:717) ~[spring-web.jar:?] jvm 1 | at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:608) ~[spring-web.jar:?] jvm 1 | at com.softwareag.controlplane.agent.core.utils.ProxyService.callback(ProxyService.java:80) ~[?:?] jvm 1 | at com.softwareag.controlplane.agent.core.utils.ProxyService.forwardRequest(ProxyService.java:70) ~[?:?]
jvm 1 | at com.softwareag.controlplane.agent.core.configuration.ControlPlaneProxyImpl.send(ControlPlaneProxyImpl.java:102) ~[?:?] jvm 1 | at com.softwareag.controlplane.agent.core.configuration.ControlPlaneProxyImpl.doPost(ControlPlaneProxyImpl.java:57) ~[?:?] jvm 1 | at com.softwareag.controlplane.agent.core.processors.RuntimeRegistrationProcessor.publishRuntimeToControlPlane(RuntimeRegistrationProcessor.java:70) ~[?:?] jvm 1 | at com.softwareag.controlplane.agent.core.init.Agent.start(Agent.java:36) ~[?:?] jvm 1 | at com.softwareag.controlplane.agent.apigateway.impl.RuntimeAPIGatewayDataProvider.initializeAgent(RuntimeAPIGatewayDataProvider.java:29) ~[?:?] jvm 1 | at com.softwareag.apigateway.is.init.ISPackageManager$PostStartupRunner.run(ISPackageManager.java:566) [?:?]jvm 1 | at java.lang.Thread.run(Thread.java:829) [?:?] jvm 1 | Caused by: java.net.ConnectException: Connection refused (Connection refused) jvm 1 | at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?] jvm 1 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[?:?] jvm 1 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[?:?] jvm 1 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[?:?] jvm 1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?] jvm 1 | at java.net.Socket.connect(Socket.java:615) ~[?:?] jvm 1 | at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305) ~[?:?] jvm 1 | at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:?] jvm 1 | at sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[?:?] jvm 1 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:509) ~[?:?] jvm 1 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:604) ~[?:?] jvm 1 | at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:266) ~[?:?] jvm 1 | at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373) ~[?:?] jvm 1 | at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:207) ~[?:?] jvm 1 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1192) ~[?:?] jvm 1 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1086) ~[?:?] jvm 1 | at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:193) ~[?:?] jvm 1 | at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:168) ~[?:?]
jvm 1 | at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web.jar:?] jvm 1 | at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web.jar:?] jvm 1 | at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66) ~[spring-web.jar:?] jvm 1 | at org.springframework.http.client.BufferingClientHttpRequestWrapper.executeInternal(BufferingClientHttpRequestWrapper.java:63) ~[spring-web.jar:?] jvm 1 | at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web.jar:?] jvm 1 | at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66) ~[spring-web.jar:?] jvm 1 | at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:782) ~[spring-web.jar:?] jvm 1 | ... 11 more

przemekulik commented 7 months ago

@pmsgupta - please show your agent config As a quick test - please use the proper hostname for the control plane deployment (not localhost)

Kumarapandian commented 7 months ago

@pmsgupta Are you using the Linux subsystem under Windows OS for using the docker?

If so please add the below entry in the docker-compose.yml file under agent's deployment folder.

    extra_hosts:
      - "host.docker.internal:host-gateway"

Also please update the Control Plane URL as below.

http://host.docker.internal:81/

Then restart the agent.

pmsgupta commented 7 months ago

@pmsgupta Are you using the Linux subsystem under Windows OS for using the docker?

If so please add the below entry in the docker-compose.yml file under agent's deployment folder.

    extra_hosts:
      - "host.docker.internal:host-gateway"

Also please update the Control Plane URL as below.

http://host.docker.internal:81/

Then restart the agent.

@Kumarapandian Yes, I am using WSL on Windows OS. After making the change you suggested, I was able to register the agent successfully. I think it would be better if you add that note to the deployment instructions. I noticed the control plane URL is using regular HTTP instead of HTTPS. Can you provide guidance on the changes that need to be made in the agent to ensure secure communication with the control plane?

I forgot to mention one issue earlier: the API Control plane UI was rendering only in Firefox, not in Chrome. I cleared the history in Chrome and tried it in Incognito. Even then, the UI was not rendered in Chrome.

Kumarapandian commented 7 months ago

@pmsgupta We are about to update the document with some more tweaks on this. May by next week it will be available.

Regarding the rendering of the Control Plane UI, we don't have any issues in the Chrome browser. We are checking every release with Chrome, Edge and Firefox mainly. So it should not have any problem with Chrome. Can you share the details of the Chrome version and the screenshot of it when you are browsing the Control Plane application? That will help us to debug further on this.

Kumarapandian commented 6 months ago

Documents updated with the latest chagnes.