zend-patterns / ZendServerBamboo

Bamboo Plugin for packaging and deploying to Zend Server
Other
14 stars 3 forks source link

Timeout 60 seconds on command zpk #9

Closed stalxed closed 9 years ago

stalxed commented 9 years ago

Hello!

Size of my project now more than 100mb. And after this(increasing the size of the project) I see in log of Atlassian Bamboo this lines:

26-Jun-2015 18:01:36 Starting task 'Zend Server Packaging Task' of type 'org.zend.zendserver.bamboo.plugin.zendserver:ZendServerPackagingTask' 26-Jun-2015 18:02:36 Process command line: C:\ZendServerSDK\zs-client.bat packZpk --folder=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1 --destination=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1\zpk --name=443-383bb3.zpk --version=443-383bb3 26-Jun-2015 18:02:36 Output written to: C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1/zwsa/pack-443-383bb3.log 26-Jun-2015 18:02:36 Failing task since return code of [C:\ZendServerSDK\zs-client.bat packZpk --folder=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1 --destination=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1\zpk --name=443-383bb3.zpk --version=443-383bb3] was -1 while expected 0 26-Jun-2015 18:02:36 Finished task 'Zend Server Packaging Task' with result: Failed

Let's count: 18:02:36 - 26-Jun-2015 18:01:36 = 60 seconds or 1 minute

It is strange that such a value is not it?!

I tested it on a few projects. If command packZpk takes 60 seconds (1 minute) or less, then build is completed successfully. If more, then fails(code -1).

The time depends on the size of the project (which is reasonable).

Even if time is up (60 seconds), and the build fails, the archive zpk few minutes later successfully created!

Please fix this bug!

stalxed commented 9 years ago

This project is abandoned?

slaff commented 9 years ago

Not really, my the guys who is responsible for the project will take care for the issue in the coming week(s).

stalxed commented 9 years ago

Thank you!, looking forward to when you fix this bug!

janatzend commented 9 years ago

You can now add custom options zs-client which is the executable for all the Zend Server Task types. Please see the paragraph "HTTP tuning" at https://github.com/zend-patterns/ZendServerSDK on how to set a timeout.

However, if the package takes so much time to be deployed, you should consider using the library feature of Zend Server. http://files.zend.com/help/Zend-Server/zend-server.htm#../Content/deploying_a_library.htm

stalxed commented 9 years ago

Hello!

You're a little mistaken.

Deploy(Zend Server Deployment Task + Zend Server Deployment Check Task) started and completed correctly!

Bug in task Zend Server Packaging Task. This task runs without Zend Server, and http timeout to it has no effect.

Or I do not understand something?

janatzend commented 9 years ago

I'm sorry, my bad...

I can see in your original post that you're executing C:\ZendServerSDK\zs-client.bat . I zs-client.bat something you've written at your own? If yes, could you please post the content? If not it's probably the one from Zend Server for Windows? Is it a vanilla PHP or Zend Server running on your Bamboo machine? What's the content of the log file (in your example C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1/zwsa/pack-443-383bb3.log) ?

Jan

stalxed commented 9 years ago

Hello janatzend.

< zs-client.bat

@ECHO OFF
php "%~dp0zs-client.phar" %*

< What's the content of the log file? Empty file.

stalxed commented 9 years ago

If I run this command:

C:\ZendServerSDK\zs-client.bat packZpk --folder=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1 --destination=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1\zpk --name=443-383bb3.zpk --version=443-383bb3

in Command Prompt(cmd.exe) manually then everything is successfully completed.

stalxed commented 9 years ago

I got to find a valuable log of this bug:

2015-07-24 03:16:19,359 INFO [10-BAM::Default Agent::Agent:pool-25-thread-1] [TaskResultBuilder] AM-AMD-JOB1-500: Failing task since return code of [C:\ZendServerSDK\zs-client.bat packZpk --folder=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1 --destination=C:\Bamboo\xml-data\build-dir\AM-AMD-JOB1\zpk --name=500-678cc3.zpk --version=500-678cc3] was -1 while expected 0 2015-07-24 03:16:19,406 INFO [10-BAM::Default Agent::Agent:pool-25-thread-1] [TaskResultBuilder] Process exception: com.atlassian.utils.process.ProcessTimeoutException: process timed out at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:656) at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:161) at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:114) at com.zend.zendserver.bamboo.Process.ProcessHandler.execute(ProcessHandler.java:47) at com.zend.zendserver.bamboo.PackagingTask.execute(PackagingTask.java:29) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:216) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:98) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:188) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:112) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:110) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Unknown Source)

janatzend commented 9 years ago

Thanks for the logs.

I was able to reproduce the issue and I also found the root cause of the problem. However a fix needs some more effort as I'd like to make the timeout setting configurable. I'm working on it...

janatzend commented 9 years ago

Hi, I uploaded a new jar file with the ability of configuring the timeout. Please find a new section 'Troubleshooting' in the README to get information on how to configure. I hope it fixes your problem.

stalxed commented 9 years ago

Thank you very much! Now everything works great!