简体   繁体   中英

Unable to deploy streams on Spring Cloud Dataflow

Problem

I was able to register applications and deploy them previously, now I am not able to.

curl --request POST \
  --url http://10.30.7.244:31444//apps/source/http \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data uri=docker:springcloudstream/http-source-rabbit:2.1.1.RELEASE \
  --data version=2.1.1.RELEASE \
  --data metadata-uri=maven://org.springframework.cloud.stream.app:http-source-rabbit:jar:metadata:2.1.1.RELEASE

# + more custom apps

curl --request POST \
  --url http://10.30.7.244:31444/streams/definitions \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data name=my-stream \
  --data 'definition=http | my-proc1 | my-proc-2 | my-sink' \
  --data deploy=false

curl --request POST \
  --url http://thehost:31444/streams/deployments/my-stream \
  --header 'content-type: application/json' \
  --data '{
    "deployer.*.kubernetes.imagePullPolicy":"Always",
    "deployer.http.kubernetes.createNodePort" : "32125",
    
    "app.*.spring.profiles.active":"integ",
    

}'

How it happened

I was able to undeploy and deploy the above stream just fine. However, one day I undeployed it and tried to deploy it again too quickly and it complained about the ingress http port not being available as the pod didn't stop yet. I basically undeploye and redeployed within 2 seconds, not giving it much time. Now, I am unable to deploy due to what appears to be a stuck/orphaned deployment metadata in skipper. I am getting this error now EVERY time I tried to deploy my stream:

[
  {
    "logref": "SkipperException",
    "message": "Could not install AppDeployRequest [[AppDeploymentRequest@7afd79d6 commandlineArguments = list[[empty]], deploymentProperties = map['spring.cloud.deployer.group' -> 'my-app-to-era', 'spring.cloud.deployer.kubernetes.imagePullPolicy' -> 'Always'], definition = [AppDefinition@1fb86fe0 name = 'my-app-data-mapper-v14', properties = map['spring.metrics.export.triggers.application.includes' -> 'integration**', 'spring.cloud.dataflow.stream.app.label' -> 'my-app-data-mapper', 'spring.cloud.stream.metrics.key' -> 'my-app-to-era.my-app-data-mapper.${spring.cloud.application.guid}', 'spring.cloud.stream.bindings.input.group' -> 'my-app-to-era', 'spring.cloud.stream.bindings.output.producer.requiredGroups' -> 'my-app-to-era', 'spring.cloud.stream.metrics.properties' -> 'spring.application.name,spring.application.index,spring.cloud.application.*,spring.cloud.dataflow.*', 'spring.cloud.dataflow.stream.name' -> 'my-app-to-era', 'spring.cloud.stream.bindings.output.destination' -> 'my-app-to-era.my-app-data-mapper', 'spring.cloud.dataflow.stream.app.type' -> 'processor', 'spring.cloud.stream.bindings.input.destination' -> 'my-app-to-era.my-app-packet-builder', 'spring.profiles.active' -> 'integ']], resource = Docker Resource [docker:artifacts.dynatron.io/era-docker/stream-my-app-data-mapper:1.0.5-SNAPSHOT]]]  to platform [default].  Error Message = [Failure executing: POST at: https://10.152.183.1/api/v1/namespaces/default/services. Message: services \"my-app-to-era-my-app-data-mapper-v14\" already exists. Received status: Status(apiVersion=v1, code=409, details=StatusDetails(causes=[], group=null, kind=services, name=my-app-to-era-my-app-data-mapper-v14, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=services \"my-app-to-era-my-app-data-mapper-v14\" already exists, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=AlreadyExists, status=Failure, additionalProperties={}).]"
  }
]

Work around

If I unregister the apps and re-register it fixes nothing. But if I unregister the apps and register them with new names then it works. But it is annoying to have to keep doing this as it is used in an automated environment. Doing hacky commands and renames is not ideal going forward.

In this case, you might want to try deleting the release that is stuck at the Skipper side. To do this, you can try from the Skipper shell:

skipper:>release delete <release-name>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM