我正在尝试在 Cloudbees 上设置持续集成,运行 Jenkins 并将我的 Grails 应用程序部署到 Cloudfoundry。
我按照这篇博文中的步骤进行操作,但 Jenkins 构建在尝试将 WAR 部署到 Cloudfoundry 时失败。
异常消息是'403 Forbidden(内存容量不足,允许:2048M)'。我可以在 Jenkins / Cloudfoundry 部署配置中指定的最大值仅为 2048MB,所以这条消息对我来说没有意义。我尝试将内存分配减少到 1024MB,但我仍然收到相同的消息。
如果我使用 Grails Cloudfoundry 插件手动部署它,我的应用程序在 Cloudfoundry 上运行没有任何问题,并且运行良好,只有 1GB。
有任何想法吗?
[cloudbees-deployer:cloudfoundry] Processing matched resources: 9395721
[cloudbees-deployer:cloudfoundry] done.
[cloudbees-deployer:cloudfoundry] Setting number of instances... done.
[cloudbees-deployer:cloudfoundry] Application state: unknown
[cloudbees-deployer:cloudfoundry] Starting application...
com.cloudbees.plugins.deployer.exceptions.DeployException: remote file operation failed: /scratch/jenkins/workspace/myApp/target/myApp-0.1.war at hudson.remoting.Channel@1c179d4c:s-c0eee604
at com.cloudbees.plugins.deployer.engines.Engine.process(Engine.java:162)
at com.cloudbees.plugins.deployer.engines.Engine.perform(Engine.java:96)
at com.cloudbees.plugins.deployer.DeployPublisher.perform(DeployPublisher.java:95)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:728)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:703)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:650)
at hudson.model.Run.execute(Run.java:1530)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: hudson.util.IOException2: remote file operation failed: /scratch/jenkins/workspace/myApp/target/myApp-0.1.war at hudson.remoting.Channel@1c179d4c:s-c0eee604
at hudson.FilePath.act(FilePath.java:877)
at hudson.FilePath.act(FilePath.java:863)
at com.cloudbees.plugins.deployer.engines.Engine.process(Engine.java:156)
... 11 more
Caused by: hudson.remoting.ProxyException: org.cloudfoundry.client.lib.CloudFoundryException: 403 Forbidden (Not enough memory capacity, you're allowed: 2048M)
at org.cloudfoundry.client.lib.rest.AbstractCloudControllerClient$ErrorHandler.handleError(AbstractCloudControllerClient.java:357)
at com.cloudbees.shaded.org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:486)
at com.cloudbees.shaded.org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:443)
at org.cloudfoundry.client.lib.rest.LoggingRestTemplate.doExecute(LoggingRestTemplate.java:54)
at com.cloudbees.shaded.org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401)
at com.cloudbees.shaded.org.springframework.web.client.RestTemplate.put(RestTemplate.java:327)
at org.cloudfoundry.client.lib.rest.CloudControllerClientV1.doUpdateApplication(CloudControllerClientV1.java:615)
at org.cloudfoundry.client.lib.rest.CloudControllerClientV1.startApplication(CloudControllerClientV1.java:342)
at com.cloudbees.plugins.deployer.impl.cloudfoundry.EngineImpl$DeployFileCallable.invoke(EngineImpl.java:637)
at com.cloudbees.plugins.deployer.impl.cloudfoundry.EngineImpl$DeployFileCallable.invoke(EngineImpl.java:307)
at com.cloudbees.plugins.deployer.engines.Engine$FingerprintingWrapper.invoke(Engine.java:248)
at com.cloudbees.plugins.deployer.engines.Engine$FingerprintingWrapper.invoke(Engine.java:236)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2275)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Build step 'Deploy applications' marked build as failure
Finished: FAILURE