PowerShell Task Hangs in Bamboo both with either inline/file options selected

Issue #27 resolved
Terrence Bayley created an issue

Hi Guys, I'm running into a very odd issue. My script is hanging and doesn't return control back to Bamboo. I can get it to intermittently work by resaving the bamboo task or rerunning the failed build. Do I need to add a parameter when calling my script from Bamboo?

Notice Timestamp:
30-Jan-2020 08:40:30 BUILD SUCCESSFUL in 2m 4s
30-Jan-2020 08:40:30 50 actionable tasks: 47 executed, 3 up-to-date
30-Jan-2020 08:40:30 Wrapping Up Targeted APK Script...
30-Jan-2020 08:40:30
30-Jan-2020 08:58:07 Force Stop build feature is enabled for current plan. Either Bamboo has detected the build has hung or it has been manually stopped.

PowerShell Task v1.2.0
Bamboo v6.10.3 build 61008
Windows Server 2012 R2 Standard x64
Powershell 4.0

Let me know if you need any log files, etc..

Kindest Regards,

Terrence

Comments (11)

  1. Sergey Podobry

    Hi Terrence! It looks the build hangs in gradle. Try adding debug logging: .\gradlew --debug clean assemble... and see where does it stuck.

  2. Terrence Bayley Account Deactivated reporter

    Hi Sergey, I will add --debug flag to gradle, but from my logs it looks like the build hangs on the very last ‘Write-Host’ statement in the buildAndroidTargetedAPK.ps1 script. If i rerun a failed build w/out resaving the task it typically succeeds as well.

    Thanks for your help!

    Kindest Regards,

    Terrence

  3. Terrence Bayley Account Deactivated reporter

    Doubled Java Heap Size in Conf file. Seeing if that helps with Gradle.

    T

  4. Sergey Podobry

    We replicated the same environment (PowerShell Task v1.2.0, Bamboo v6.10.3, Windows Server 2012 R2 Standard x64, Powershell 4.0) and built several android projects - but couldn’t reproduce the issue.

    Here are some ideas:

    • check bamboo log for errors/warnings
    • run process explorer when a build hangs and check powershell process tree
    • replace return with [Environment]::Exit(0) in the script

  5. Terrence Bayley Account Deactivated reporter

    Thanks Sergey, still seeing the issue, i will try some of your suggestions.

    T

  6. Terrence Bayley Account Deactivated reporter

    Sergey, you were right from the beginning. Gradle is holding onto Java process. Added ‘.\gradlew --stop’ to end of script and build is completing successfully. Thanks for your help on this!

    Kindest Regards,

    Terrence

  7. Log in to comment