Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47271

Cloud Foundry Plugin fails when using inherit in manifest

XMLWordPrintable

      When using the inheritance feature described in the Cloud Foundry Docs the plugin fails to deploy with 

      java.lang.IllegalStateException: Application application-name failed during staging
      

       

      Full description

      We use the inherit `base-manifest.yml` feature mentioned above in our projects, so the manifests look like:

      base-manifest.yml
      instances: 1
      memory: 1G
      buildpack: https://github.com/cloudfoundry/java-buildpack.git#v3.19
      path: path.to.jar
      
      manifest.yml

       

      inherit: base-manifest.yml
      applications:
        - name: application-name
          timeout : 180
          services:
            - services-to-bind
          env:
            SPRING_PROFILES_ACTIVE: abcdef
      

       

      But when trying to deploy the application with Jenkins + Cloud Foundry Plugin it fails with the stacktrace shown at the end of this issue.

       

      But when merging the manifest files everything works as expected.

      instances: 1
      memory: 1G
      buildpack: https://github.com/cloudfoundry/java-buildpack.git#v3.19
      path: path.to.jar
      applications:
        - name: application-name
          timeout : 180
          services:
            - services-to-bind
          env:
            SPRING_PROFILES_ACTIVE: abcdef
      

       

      Stacktrace

       

      ...
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 34.120 s
      [INFO] Finished at: 2017-10-04T14:42:29+02:00
      [INFO] Final Memory: 75M/990M
      [INFO] ------------------------------------------------------------------------
      Cloud Foundry Plugin:
      java.lang.IllegalStateException: Application application-name failed during staging
      	at org.cloudfoundry.util.ExceptionUtils.illegalState(ExceptionUtils.java:60)
      	at org.cloudfoundry.operations.applications.DefaultApplications.waitForStaging(DefaultApplications.java:1734)
      	at org.cloudfoundry.operations.applications.DefaultApplications.lambda$startApplicationAndWait$134(DefaultApplications.java:1503)
      	at reactor.core.publisher.MonoThenMap$ThenMapMain.onNext(MonoThenMap.java:120)
      	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115)
      	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:373)
      	at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:173)
      	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:235)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.ipc.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:207)
      	at reactor.ipc.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:322)
      	at reactor.ipc.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:316)
      	at reactor.ipc.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:581)
      	at reactor.ipc.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:125)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at reactor.ipc.netty.http.HttpOperations.lambda$static$3(HttpOperations.java:261)
      	at reactor.ipc.netty.ReactorNetty$ExtractorHandler.channelRead(ReactorNetty.java:328)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1240)
      	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1041)
      	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:559)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:476)
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
      	at java.lang.Thread.run(Unknown Source)
      	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
      Assembly trace from producer [reactor.core.publisher.MonoIgnoreEmpty] :
      	reactor.core.publisher.Mono.checkpoint(Mono.java:1400)
      	org.cloudfoundry.operations.applications.DefaultApplications.pushManifest(DefaultApplications.java:390)
      	com.hpe.cloudfoundryjenkins.CloudFoundryPushTask.perform(CloudFoundryPushTask.java:168)
      	com.hpe.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:130)
      	hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
      	hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
      	hudson.model.Build$BuildExecution.post2(Build.java:186)
      	hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
      	hudson.model.Run.execute(Run.java:1762)
      	hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	hudson.model.ResourceController.execute(ResourceController.java:97)
      	hudson.model.Executor.run(Executor.java:419)
      Error has been observed by the following operator(s):
      	|_	Mono.checkpoint(DefaultApplications.java:390)
      
      java.lang.IllegalStateException: Application application-name failed during staging
      	at org.cloudfoundry.util.ExceptionUtils.illegalState(ExceptionUtils.java:60)
      	at org.cloudfoundry.operations.applications.DefaultApplications.waitForStaging(DefaultApplications.java:1734)
      	at org.cloudfoundry.operations.applications.DefaultApplications.lambda$startApplicationAndWait$134(DefaultApplications.java:1503)
      	at reactor.core.publisher.MonoThenMap$ThenMapMain.onNext(MonoThenMap.java:120)
      	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115)
      	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:373)
      	at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:173)
      	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:235)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
      	at reactor.ipc.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:207)
      	at reactor.ipc.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:322)
      	at reactor.ipc.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:316)
      	at reactor.ipc.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:581)
      	at reactor.ipc.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:125)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at reactor.ipc.netty.http.HttpOperations.lambda$static$3(HttpOperations.java:261)
      	at reactor.ipc.netty.ReactorNetty$ExtractorHandler.channelRead(ReactorNetty.java:328)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1240)
      	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1041)
      	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:559)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:476)
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
      	at java.lang.Thread.run(Unknown Source)
      	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
      Assembly trace from producer [reactor.core.publisher.MonoIgnoreEmpty] :
      	reactor.core.publisher.Mono.checkpoint(Mono.java:1400)
      	org.cloudfoundry.operations.applications.DefaultApplications.pushManifest(DefaultApplications.java:390)
      	com.hpe.cloudfoundryjenkins.CloudFoundryPushTask.perform(CloudFoundryPushTask.java:168)
      	com.hpe.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:130)
      	hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
      	hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
      	hudson.model.Build$BuildExecution.post2(Build.java:186)
      	hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
      	hudson.model.Run.execute(Run.java:1762)
      	hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	hudson.model.ResourceController.execute(ResourceController.java:97)
      	hudson.model.Executor.run(Executor.java:419)
      Error has been observed by the following operator(s):
      	|_	Mono.checkpoint(DefaultApplications.java:390)
      
      	Suppressed: java.lang.Exception: #block terminated with an error
      		at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:86)
      		at reactor.core.publisher.Mono.block(Mono.java:1301)
      		at com.hpe.cloudfoundryjenkins.CloudFoundryPushTask.perform(CloudFoundryPushTask.java:171)
      		at com.hpe.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:130)
      		at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
      		at hudson.model.Build$BuildExecution.post2(Build.java:186)
      		at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
      		at hudson.model.Run.execute(Run.java:1762)
      		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      		at hudson.model.ResourceController.execute(ResourceController.java:97)
      		at hudson.model.Executor.run(Executor.java:419)
      Build step 'Push to Cloud Foundry' marked build as failure
      Finished: FAILURE
      

       

            sworisbreathing Steven Swor
            konraifen88 Konrad Grüner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: