cloudfoundry / cf-java-client

Java Client Library for Cloud Foundry
Apache License 2.0
328 stars 318 forks source link

Service broker throws an error while checking version compatability because of fixed cloud controller API version #1120

Closed deepagpatil closed 3 years ago

deepagpatil commented 3 years ago

Hello,

We have a service broken that uses CloundFoundryClient, we are attempting to run the application in oir enviornment, but it fails due to cloud controller api_version compatibility.

The current Cloud Controller API version supported by cf-java-client is 2.150.0, but we are using 2.164.0 in our environment.

Could you please give us the option to use the most recent api_version, or let me know if there is any way I can change it?

SUPPORTED_API_VERSION = "2.150.0"; Required API_VERSION = "2.164.0"

https://github.com/cloudfoundry/cf-java-client/blob/main/cloudfoundry-client/src/main/java/org/cloudfoundry/client/CloudFoundryClient.java

Appreciate any solution for this!

Best Regards, Deepa

dmikusa commented 3 years ago

Please include the output of any error messages you receive. As well as the information from https://github.com/cloudfoundry/cf-java-client#troubleshooting

My understanding is that it will complain (ie. log a warning) if you are on an unsupported version, but not fail.

deepagpatil commented 3 years ago

Hello @dmikusa-pivotal,

Please see the error message below, as asked. Please let me know if you require any other information.

We are using the 2.150.0 cfapi version in one of our environments, and the service broker app works properly. However, we are attempting to deploy this in a different environment where we are using 2.164.0 cfapi version.

11:29:59.202: [APP/PROC/WEB.0] 2021-09-10 09:29:59.201 INFO 8 --- [ main] c.b.d.b.c.CfServiceBrokerApplication : Started CfServiceBrokerApplication in 8.657 seconds (JVM running for 9.388) 11:29:59.738: [APP/PROC/WEB.0] 2021-09-10 09:29:59.736 ERROR 8 --- [-client-epoll-2] cloudfoundry-client.compatibility : An error occurred while checking version compatibility: 11:29:59.738: [APP/PROC/WEB.0] io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: api.sys.cfy05.ipz001.internal.bosch.cloud/10.140.184.190:443 11:29:59.738: [APP/PROC/WEB.0] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 11:29:59.738: [APP/PROC/WEB.0] Assembly trace from producer [reactor.core.publisher.MonoFlatMap] : 11:29:59.738: [APP/PROC/WEB.0] reactor.core.publisher.Mono.checkpoint(Mono.java:2120) 11:29:59.738: [APP/PROC/WEB.0] org.cloudfoundry.reactor.client.v2.info.ReactorInfo.get(ReactorInfo.java:49) 11:29:59.738: [APP/PROC/WEB.0] Error has been observed at the following site(s): 11:29:59.738: [APP/PROC/WEB.0] |_ Mono.checkpoint ⇢ at org.cloudfoundry.reactor.client.v2.info.ReactorInfo.get(ReactorInfo.java:49) 11:29:59.738: [APP/PROC/WEB.0] Stack trace: 11:29:59.738: [APP/PROC/WEB.0] Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Socket.finishConnect(Socket.java:312) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:470)

dmikusa commented 3 years ago

Ah, I see. So the problem is not that the versions are incompatible. The problem is that when it's trying to check if the versions are compatible, the library cannot talk to your CF.

An error occurred while checking version compatibility: 11:29:59.738: [APP/PROC/WEB.0] io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused:

Specifically a connection timeout. You have some sort of network issue happening. Something is blocking the connection, perhaps you need to add an application security group or you need to open a firewall port or something like that.

It's not a library problem.

deepagpatil commented 3 years ago

Hello @dmikusa-pivotal,

Please see the error message below, as asked. Please let me know if you require any other information.

We are using the 2.150.0 cfapi version in one of our environments, and the service broker app works properly. However, we are attempting to deploy this in a different environment where we are using 2.164.0 cfapi version.

11:29:59.202: [APP/PROC/WEB.0] 2021-09-10 09:29:59.201 INFO 8 --- [ main] c.b.d.b.c.CfServiceBrokerApplication : Started CfServiceBrokerApplication in 8.657 seconds (JVM running for 9.388) 11:29:59.738: [APP/PROC/WEB.0] 2021-09-10 09:29:59.736 ERROR 8 --- [-client-epoll-2] cloudfoundry-client.compatibility : An error occurred while checking version compatibility: 11:29:59.738: [APP/PROC/WEB.0] io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: api.sys.cfy05.ipz001.internal.bosch.cloud/10.140.184.190:443 11:29:59.738: [APP/PROC/WEB.0] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 11:29:59.738: [APP/PROC/WEB.0] Assembly trace from producer [reactor.core.publisher.MonoFlatMap] : 11:29:59.738: [APP/PROC/WEB.0] reactor.core.publisher.Mono.checkpoint(Mono.java:2120) 11:29:59.738: [APP/PROC/WEB.0] org.cloudfoundry.reactor.client.v2.info.ReactorInfo.get(ReactorInfo.java:49) 11:29:59.738: [APP/PROC/WEB.0] Error has been observed at the following site(s): 11:29:59.738: [APP/PROC/WEB.0] |_ Mono.checkpoint ⇢ at org.cloudfoundry.reactor.client.v2.info.ReactorInfo.get(ReactorInfo.java:49) 11:29:59.738: [APP/PROC/WEB.0] Stack trace: 11:29:59.738: [APP/PROC/WEB.0] Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.unix.Socket.finishConnect(Socket.java:312) ~[netty-transport-native-unix-common-4.1.67.Final.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) ~[netty-transport-native-epoll-4.1.67.Final-linux-x86_64.jar:4.1.67.Final] 11:29:59.738: [APP/PROC/WEB.0] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:470)

Ah, I see. So the problem is not that the versions are incompatible. The problem is that when it's trying to check if the versions are compatible, the library cannot talk to your CF.

An error occurred while checking version compatibility: 11:29:59.738: [APP/PROC/WEB.0] io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused:

Specifically a connection timeout. You have some sort of network issue happening. Something is blocking the connection, perhaps you need to add an application security group or you need to open a firewall port or something like that.

It's not a library problem.

deepagpatil commented 3 years ago

Hi @dmikusa-pivotal ,

Yes you're right, problem was from our side. ticket can be closed. But just one question, do you provide the list of cloud controller api version is it always 2.150.0 Thank you for your support on this ticket.

Best Regards, Deepa

dmikusa commented 3 years ago

That is the highest version that we're currently testing against in our CI. We're a little behind in our CI pipeline, but do plan to update that soon. When we do, we'll bump the version in the code.