0
votes

I was experimenting with Spring Cloud Data Flow (version 1.0.0.M2) on Cloud Foundry. Specifically I'm using, Bluemix for my task.

I used those references to sucessfully build a Cloud Foundry server: https://github.com/lshannon/spring-cloud-data-flow-demo

http://docs.spring.io/spring-cloud-dataflow-admin-cloudfoundry/docs/1.0.0.M2/reference/html/getting-started.html

I started the server, connected the local shell, successfully registered the default processors, sinks and sources.

The environment variables used are ($1,$2,$3,$4) are my personal data:

cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_API_ENDPOINT https://api.eu-gb.bluemix.net 
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_ORGANIZATION $1
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SPACE $2
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_DOMAIN eu-gb.mybluemix.net
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SERVICES redis01,rabbit
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_USERNAME $3
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_PASSWORD $4
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION false

I double checked those variables in the Bluemix instance and everything is correct.

Then I tried to recreate the basic stream example using the shell, which is:

stream create luketicktock --definition "time | log" --deploy

The shell output is:

Created and deployed new stream 'luketicktock'

However, I cannot see any deployed Cloud Foundry apps able to reproduce such a stream.

   2016-07-02T18:27:34.74+0200 [RTR/0]      OUT approver-dataflow-v2.eu-gb.mybluemix.net - [02/07/2016:16:27:34 +0000] "GET /streams/definitions?page=0&size=10 HTTP/1.1" 200 0 387 "http://approver-dataflow-v2.eu-gb.mybluemix.net/admin-ui/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" 159.122.215.10:39562 x_forwarded_for:"87.14.219.53" x_forwarded_proto:"http" vcap_request_id:781a16d0-9b21-4549-4403-3b95744b936a response_time:0.046310147 app_id:59f2c573-1b54-4480-81e3-6a064260820a x_global_transaction_id:"1105927831"
2016-07-02T18:27:39.14+0200 [App/0]      OUT 2016-07-02 16:27:39.143 ERROR 29 --- [io-61588-exec-5] o.s.c.d.s.c.CloudFoundryAppDeployer      : Error creating app luketicktock-log
2016-07-02T18:27:39.14+0200 [App/0]      OUT org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token.
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:280) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$get$3(AbstractSpringOperations.java:85) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$null$1(AbstractSpringOperations.java:66) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxYieldingEmitter$YieldingSignalEmitter.request(FluxYieldingEmitter.java:75) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.util.DeferredSubscription.set(DeferredSubscription.java:71) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onSubscribe(FluxSubscribeOn.java:129) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.subscriber.SignalEmitter.start(SignalEmitter.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxYieldingEmitter.subscribe(FluxYieldingEmitter.java:43) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:363) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:919) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:883) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at reactor.core.publisher.WorkQueueProcessor$QueueSubscriberLoop.run(WorkQueueProcessor.java:842) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0]      OUT Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport$AccessTokenErrorHandler.handleError(OAuth2AccessTokenSupport.java:244) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:137) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0]      OUT    ... 24 common frames omitted
2016-07-02T18:27:40.70+0200 [RTR/2]      OUT approver-dataflow-v2.eu-gb.mybluemix.net - [02/07/2016:16:27:40 +0000] "GET /streams/definitions?page=0&size=10 HTTP/1.1" 200 0 384 "http://approver-dataflow-v2.eu-gb.mybluemix.net/admin-ui/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" 159.122.215.11:30146 x_forwarded_for:"87.14.219.53" x_forwarded_proto:"http" vcap_request_id:ecaaca33-cc82-4c4e-4cd8-c81a431c4f4f response_time:0.009798874 app_id:59f2c573-1b54-4480-81e3-6a064260820a x_global_transaction_id:"3460948721"
2016-07-02T18:27:43.51+0200 [App/0]      OUT 2016-07-02 16:27:43.519 ERROR 29 --- [io-61588-exec-5] o.s.c.d.s.c.CloudFoundryAppDeployer      : Error creating app luketicktock-time
2016-07-02T18:27:43.51+0200 [App/0]      OUT org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token.
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.51+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:280) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$get$3(AbstractSpringOperations.java:85) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$null$1(AbstractSpringOperations.java:66) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxYieldingEmitter$YieldingSignalEmitter.request(FluxYieldingEmitter.java:75) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.util.DeferredSubscription.set(DeferredSubscription.java:71) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onSubscribe(FluxSubscribeOn.java:129) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.subscriber.SignalEmitter.start(SignalEmitter.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxYieldingEmitter.subscribe(FluxYieldingEmitter.java:43) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:363) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:919) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:883) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at reactor.core.publisher.WorkQueueProcessor$QueueSubscriberLoop.run(WorkQueueProcessor.java:842) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0]      OUT Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport$AccessTokenErrorHandler.handleError(OAuth2AccessTokenSupport.java:244) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:137) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0]      OUT    ... 24 common frames omitted

It seems that the dataflow server fails in requesting the access token to Bluemix to creating the stream. Did I make something wrong?

Thanks for your support!

1
I just tried with server version 1.0.0.M3 on Bluemix and I got the same error. Just to be sure I tried with a trial account on Pivotal PAAS and everything works perfectly. So it seems a problem related to the Bluemix implementation of Cloud Foundry...maybe it's related to github.com/cloudfoundry/cf-java-client/issues/513Luca

1 Answers

0
votes

This is usually observed when deploying to Cloud Foundry without valid self-signed certificate. If this is on your development environment, you can skip the SSL validation by the following.

cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION true

As of today, Spring Cloud Data Flow "core" is at RC1 and the Cloud Foundry implementation is at M3. As listed in the RC1 blog, there were several new improvements along with terminology changes, so upgrading to the latest release is highly recommended.