[JIRA] (JENKINS-57171) Permissive script security plugin is broken after updating to script security 1.58
Title: Message Title Gabriel Loewen created an issue Jenkins / JENKINS-57171 Permissive script security plugin is broken after updating to script security 1.58 Issue Type: Bug Assignee: Oliver Gondža Components: permissive-script-security-plugin, script-security-plugin Created: 2019-04-24 17:05 Environment: Jenkins 2.164.2 Script Security 1.58 Permissive Script Security 0.3 Labels: jenkins security script-security Priority: Major Reporter: Gabriel Loewen After updating to Script Security 1.58 permissive script security no longer permits unsafe method calls. I have -Dpermissive-script-security.enabled=no_security set up in the java args, and before upgrading to 1.58 I was receiving no warnings/errors when calling unsafe methods. After upgrading I see many warnings in my pipeline log, such as: Scripts not permitted to use staticMethod org.jenkinsci.plugins.workflow.cps.Safepoint safepoint. Administrators can decide whether to approve or reject this signature.
[JIRA] (JENKINS-57171) Permissive script security plugin is broken after updating to script security 1.58
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-57171 Permissive script security plugin is broken after updating to script security 1.58 Change By: Gabriel Loewen After updating to Script Security 1.58 permissive script security no longer permits unsafe method calls. I have *-Dpermissive-script-security.enabled=no_security* set up in the java args, and before upgrading to 1.58 I was receiving no warnings/errors when calling unsafe methods as expected . After upgrading I see many warnings in my pipeline log, such as:Scripts not permitted to use staticMethod org.jenkinsci.plugins.workflow.cps.Safepoint safepoint. Administrators can decide whether to approve or reject this signature. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54322) Add ability SKIP stage in script pipeline
Title: Message Title Gabriel Loewen commented on JENKINS-54322 Re: Add ability SKIP stage in script pipeline It would be great to have this feature, or at least whitelist markStageSkippedForConditional so that the method is allowed in groovy sandbox. I am trying to bring my codebase into compliance with groovy script security, but I am finding it incredibly difficult as there are features that I need to support in scripted pipeline that are only supported securely in declarative pipelines, such as markStageSkippedForConditional. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-52884) durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1
Title: Message Title Gabriel Loewen commented on JENKINS-52884 Re: durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1 PR sent https://github.com/jenkinsci/durable-task-plugin/pull/90 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-52884) durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1
Title: Message Title Gabriel Loewen updated JENKINS-52884 Jenkins / JENKINS-52884 durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1 Change By: Gabriel Loewen Status: Open Fixed but Unreleased Resolution: Fixed Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-52884) durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1
Title: Message Title Gabriel Loewen commented on JENKINS-52884 Re: durable-task-plugin 1.23 powershell step does not return exit code other than 0 or 1 The change to using -Command was to solve a different regression in Powershell versions < 5. The fix here is to add an additional exit $LASTEXITCODE within the command block. e.g.: & powershell -ExecutionPolicy ByPass -Command "& .\test.ps1; exit $LASTEXITCODE;" $LASTEXITCODE 2 I'll send a PR shortly with this fix. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54611) Timestamper does not work properly with Windows style line endings
Title: Message Title Gabriel Loewen resolved as Cannot Reproduce Jenkins / JENKINS-54611 Timestamper does not work properly with Windows style line endings Change By: Gabriel Loewen Status: Open Resolved Resolution: Cannot Reproduce Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54611) Timestamper does not work properly with Windows style line endings
Title: Message Title Gabriel Loewen commented on JENKINS-54611 Re: Timestamper does not work properly with Windows style line endings The issue went away after restarting Jenkins... Resolving for now, but confused why this was the resolution. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen commented on JENKINS-51145 Re: PowerShell pipeline step does not seem to be durable Vivek Pandey You've assigned this bug to me, but I am actually not working on this. The underlying issue is that when Jenkins is running as a windows service and the agent goes offline, once the agent is reconnected the entire process tree under slave.jar including the durable tasks are killed. I believe that the fix for this needs to be process isolation for any durable tasks running on windows agents. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen assigned an issue to Unassigned Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen Assignee: Gabriel Loewen Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49723) Powershell execution within GIT Multibranch pipeline failing
Title: Message Title Gabriel Loewen updated JENKINS-49723 Jenkins / JENKINS-49723 Powershell execution within GIT Multibranch pipeline failing Change By: Gabriel Loewen Status: Fixed but Unreleased Resolved Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49723) Powershell execution within GIT Multibranch pipeline failing
Title: Message Title Gabriel Loewen updated JENKINS-49723 Jenkins / JENKINS-49723 Powershell execution within GIT Multibranch pipeline failing Change By: Gabriel Loewen Status: Open Fixed but Unreleased Resolution: Cannot Reproduce Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54611) Timestamper does not work properly with Windows style line endings
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-54611 Timestamper does not work properly with Windows style line endings Change By: Gabriel Loewen Priority: Minor Major Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54611) Timestamper does not work properly with Windows style line endings
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-54611 Timestamper does not work properly with Windows style line endings Change By: Gabriel Loewen When using timestamper with either PowerShell or Windows Batch pipeline steps the timestamps do not get added to the console output. I suspect this is because in these steps the console log has Windows style line endings of CRLF instead of unix style.Example repro: {code:java}node("Windows") { timestamps { bat """ @echo off echo These echo lines echo should echo have echo timestamps """ powershell """ Write-Host "These" Write-Host "lines" Write-Host "should" Write-Host "have" Write-Host "timestamps" """ }}{code} Result: {noformat}[Pipeline] { (hide)[Pipeline] timestamps (hide)[Pipeline] { (hide)[Pipeline] bat (hide)2018-11-13 10:08:00 [TestTimestamper] Running batch scriptTheselinesshouldhavetimestamps[Pipeline] powershell (hide)2018-11-13 10:08:00 [TestTimestamper] Running PowerShell scriptTheselinesshouldhavetimestamps[Pipeline] }[Pipeline] // timestamps[Pipeline] }[Pipeline] // node[Pipeline] End of Pipeline{noformat} Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins
[JIRA] (JENKINS-54611) Timestamper does not work properly with Windows style line endings
Title: Message Title Gabriel Loewen created an issue Jenkins / JENKINS-54611 Timestamper does not work properly with Windows style line endings Issue Type: Bug Assignee: Steven G Brown Components: timestamper-plugin Created: 2018-11-13 18:09 Priority: Minor Reporter: Gabriel Loewen When using timestamper with either PowerShell or Windows Batch pipeline steps the timestamps do not get added to the console output. I suspect this is because in these steps the console log has Windows style line endings of CRLF instead of unix style. Example repro: node("Windows") { timestamps { bat """ @echo off echo These echo lines echo should echo have echo timestamps """ powershell """ Write-Host "These" Write-Host "lines" Write-Host "should" Write-Host "have" Write-Host "timestamps" """ } } Result: [Pipeline] { (hide) [Pipeline] timestamps (hide) [Pipeline] { (hide) [Pipeline] bat (hide) 2018-11-13 10:08:00 [TestTimestamper] Running batch script These lines should have timestamps [Pipeline] powershell (hide) 2018-11-13 10:08:00 [TestTimestamper] Running PowerShell script These lines should have timestamps [Pipeline] } [Pipeline] // timestamps [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen commented on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 The problematic line of code is this one: Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT Here, FT is an alias for Format-Table, which is what is causing the exception to be thrown. Without taking my fix you could modify that line slightly: Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT | Out-String Which should get past the issue. If you want to build and use my latest bits you can always checkout my repo and build it using Maven, and then install the HPI file in your Jenkins instance. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen edited a comment on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 The problematic line of code is this one: {code:java}Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT{code}Here, *FT* is an alias for *Format-Table*, which is what is causing the exception to be thrown. Without taking my fix you could modify that line slightly: {code:java}Get-VM -Server $vc -Name $svr | Get-Snapshot | Select VM, Created, Name, SizeMB | FT | Out-String{code}Which should get past the issue. If you want to build and use my latest bits you can always checkout my repo and build it using Maven, and then install the HPI file in your Jenkins instance. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen edited a comment on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc... Are you using one of these cmdlets? You can fix it temporarily by piping any calls to Foramt Format -* cmdlets to Out-String:e.g.{code:java}$Data | Format-Table | Out-String{code}Meanwhile, it should be fixed in my PR: [https://github.com/jenkinsci/durable-task-plugin/pull/70] Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen edited a comment on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc... Are you using one of these cmdlets? You can fix it temporarily by piping any calls to Foramt-* cmdlets to Out-String:e.g. {code:java}$Data | Format-Table | Out-String{code}Meanwhile, it should be fixed in my PR: [ https://github.com/jenkinsci/durable-task-plugin/pull/70 ] Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen commented on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 This edge case seems to be happening only with powershell format cmdlets, such as Format-Table, etc... Are you using one of these cmdlets? You can fix it temporarily by piping any calls to Foramt-* cmdlets to Out-String: e.g. $Data | Format-Table | Out-String Meanwhile, it should be fixed in my PR: https://github.com/jenkinsci/durable-task-plugin/pull/70 Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen commented on JENKINS-50840 Re: Powershell script execution broken in powershellHelper.ps1 It looks like this is an edge case that is triggered when streaming console output from a powershell script cannot be interpreted as serializable data. I will work on a fix for this. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50840) Powershell script execution broken in powershellHelper.ps1
Title: Message Title Gabriel Loewen assigned an issue to Gabriel Loewen Jenkins / JENKINS-50840 Powershell script execution broken in powershellHelper.ps1 Change By: Gabriel Loewen Assignee: Gabriel Loewen Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-27617) Isolate durable task in a dedicated Windows process group
Title: Message Title Gabriel Loewen commented on JENKINS-27617 Re: Isolate durable task in a dedicated Windows process group Not having durable tasks on Windows is a major blocker for me. Is there any update on this issue? Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen Labels: durability pipeline windows Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen assigned an issue to Unassigned Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen Assignee: Gabriel Loewen Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen commented on JENKINS-51145 Re: PowerShell pipeline step does not seem to be durable This seems to be the same issue as described here: https://issues.jenkins-ci.org/browse/JENKINS-27617 Am I to understand that durable tasks are not actually durable on Windows when Jenkins is running as a Windows service? Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen commented on JENKINS-51145 Re: PowerShell pipeline step does not seem to be durable Actually, I see the same behavior for the windows batch step. Looking at the jenkins logs I see the following, which seems to be a likely culprit. After disconnecting the slave agent, the powershell process continues to work normally, but as soon as the slave agent is reconnected, it seems like the first thing that happens is that is kills the powershell process. Is this expected? Or could I have something misconfigured? 2018-05-08 09:45:12,931 DEBUG - Starting ServiceWrapper in the CLI mode 2018-05-08 09:45:13,042 INFO - Restarting the service with id 'jenkinsslave-C__Program Files (x86)_Jenkins' 2018-05-08 09:45:13,061 INFO - Stopping jenkinsslave-C__Program Files (x86)_Jenkins 2018-05-08 09:45:13,066 DEBUG - ProcessKill 14096 2018-05-08 09:45:13,185 INFO - Found child process: 8368 Name: conhost.exe 2018-05-08 09:45:13,191 INFO - Found child process: 13712 Name: powershell.exe 2018-05-08 09:45:13,273 INFO - Stopping process 8368 2018-05-08 09:45:13,283 INFO - Send SIGINT 8368 2018-05-08 09:45:13,290 WARN - SIGINT to 8368 failed - Killing as fallback 2018-05-08 09:45:13,374 INFO - Found child process: 9432 Name: conhost.exe 2018-05-08 09:45:13,458 INFO - Stopping process 9432 2018-05-08 09:45:13,466 INFO - Send SIGINT 9432 2018-05-08 09:45:13,471 WARN - SIGINT to 9432 failed - Killing as fallback 2018-05-08 09:45:13,476 INFO - Stopping process 13712 2018-05-08 09:45:13,484 INFO - Send SIGINT 13712 2018-05-08 09:45:13,490 WARN - SIGINT to 13712 failed - Killing as fallback 2018-05-08 09:45:13,496 INFO - Stopping process 14096 2018-05-08 09:45:13,504 INFO - Send SIGINT 14096 2018-05-08 09:45:13,510 WARN - SIGINT to 14096 failed - Killing as fallback Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen edited a comment on JENKINS-51145 Re: PowerShell pipeline step does not seem to be durable Durability is set to max durability (MAX_SURVIVABILITY). I've updated the environment details to include those version versions . Thanks! Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen commented on JENKINS-51145 Re: PowerShell pipeline step does not seem to be durable Durability is set to max durability (MAX_SURVIVABILITY). I've updated the environment details to include those version. Thanks! Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen Environment: Windows Server 2016 Datacenter, Jenkins 2.107.2, Durable Task 1.22 , workflow-support 2.18, workflow-cps 2.51, workflow-job 2.21 Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen While running a PowerShell pipeline step I triggered a graceful shutdown, while also monitoring the powershell.exe process on the Jenkins host. The PowerShell process unexpectedly crashed, and the job failed with a -1 exit code.Job definition:{code:java}node ('Windows') { powershell ''' while (1) { write-host "Testing" Start-Sleep 1 } '''}{code}Console output:{noformat}Started by user Gabriel LoewenRunning in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on WinHost in C:\Program Files (x86)\Jenkins\workspace\Test Durability[Pipeline] {[Pipeline] powershell[Test Durability] Running PowerShell scriptTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingResuming build at Fri May 04 17:40:07 UTC 2018 after Jenkins restartWaiting to resume part of Test Durability #5: ???TestingWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineReady to run at Fri May 04 17:40:19 UTC 2018TestingTestingTestingTestingTesting[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code -1Finished: FAILURE{noformat} I ran the same test again and this time it hung, even though the PowerShell process seems to have crashed.At this point I do not know how to debug the issue, and what can be done to ensure durability in the powershell pipeline step.[~svanoort], [~teilo], let me know if you need any more details and if you can assist in this investigation. Add Comment
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen While running a PowerShell pipeline step I triggered a graceful shutdown, while also monitoring the powershell.exe process on the Jenkins host. The PowerShell process unexpectedly crashed, and the job failed with a -1 exit code. Job definition:{code:java}node ('Windows') { powershell ''' while (1) { write-host "Testing" Start-Sleep 1 } '''}{code}Console output:{noformat}Started by user Gabriel LoewenRunning in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on WinHost in C:\Program Files (x86)\Jenkins\workspace\Test Durability[Pipeline] {[Pipeline] powershell[Test Durability] Running PowerShell scriptTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingResuming build at Fri May 04 17:40:07 UTC 2018 after Jenkins restartWaiting to resume part of Test Durability #5: ???TestingWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineReady to run at Fri May 04 17:40:19 UTC 2018TestingTestingTestingTestingTesting[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code -1Finished: FAILURE{noformat} I ran the same test again and this time it hung, even though the PowerShell process seems to have crashed.At this point I do not know how to debug the issue, and what can be done to ensure durability in the powershell pipeline step.[~svanoort], let me know if you need any more details and if you can assist in this investigation. Add Comment
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen While running a PowerShell pipeline step I triggered a graceful shutdown, while also monitoring the powershell.exe process on the Jenkins host. The PowerShell process unexpectedly crashed, and the job failed with a -1 exit code. Job definition: {code:java}node ('Windows') { powershell ''' while (1) { write-host "Testing" Start-Sleep 1 } '''}{code}Console output: {noformat}Started by user Gabriel LoewenRunning in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on WinHost in C:\Program Files (x86)\Jenkins\workspace\Test Durability[Pipeline] {[Pipeline] powershell[Test Durability] Running PowerShell scriptTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingResuming build at Fri May 04 17:40:07 UTC 2018 after Jenkins restartWaiting to resume part of Test Durability #5: ???TestingWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineReady to run at Fri May 04 17:40:19 UTC 2018TestingTestingTestingTestingTesting[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code -1Finished: FAILURE{noformat} I ran the same test again and this time it hung, even though the PowerShell process seems to have crashed.At this point I do not know how to debug the issue, and what can be done to ensure durability in the powershell pipeline step.[~svanoort], let me know if you need any more details and if you can assist in this investigation. Add Comment
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Change By: Gabriel Loewen While running a PowerShell pipeline step I triggered a graceful shutdown, while also monitoring the powershell.exe process on the Jenkins host. The PowerShell process unexpectedly crashed, and the job failed with a -1 exit code. {code:java}node ('Windows') { powershell ''' while (1) { write-host "Testing" Start-Sleep 1 } '''}{code}Console output: {noformat} Started by user Gabriel LoewenRunning in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on WinHost in C:\Program Files (x86)\Jenkins\workspace\Test Durability[Pipeline] {[Pipeline] powershell[Test Durability] Running PowerShell script TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingResuming build at Fri May 04 17:40:07 UTC 2018 after Jenkins restartWaiting to resume part of Test Durability #5: ???TestingWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineWaiting to resume part of Test Durability #5: WinHost is offlineReady to run at Fri May 04 17:40:19 UTC 2018TestingTestingTestingTestingTesting[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code -1Finished: FAILURE{noformat} I ran the same test again and this time it hung, even though the PowerShell process seems to have crashed.At this point I do not know how to debug the issue, and what can be done to ensure durability in the powershell pipeline step.[~svanoort], let me know if you need any more details and if you can assist in this investigation. Add Comment
[JIRA] (JENKINS-51145) PowerShell pipeline step does not seem to be durable
Title: Message Title Gabriel Loewen created an issue Jenkins / JENKINS-51145 PowerShell pipeline step does not seem to be durable Issue Type: Bug Assignee: Gabriel Loewen Components: durable-task-plugin Created: 2018-05-04 18:31 Environment: Windows Server 2016 Datacenter, Jenkins 2.107.2, Durable Task 1.22 Priority: Major Reporter: Gabriel Loewen While running a PowerShell pipeline step I triggered a graceful shutdown, while also monitoring the powershell.exe process on the Jenkins host. The PowerShell process unexpectedly crashed, and the job failed with a -1 exit code. node ('Windows') { powershell ''' while (1) { write-host "Testing" Start-Sleep 1 } ''' } Console output: Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Resuming build at Fri May 04 17:40:07 UTC 2018 after Jenkins restart Waiting to resume part of Test Durability #5: ??? Testing Waiting to resume part of Test Durability #5: WinHost is offline Waiting to resume part of Test Durability #5: WinHost is offline Waiting to resume part of Test Durability #5: WinHost is offline Ready to run at Fri May 04 17:40:19 UTC 2018 Testing Testing Testing Testing Testing [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned
[JIRA] (JENKINS-49723) Powershell execution within GIT Multibranch pipeline failing
Title: Message Title Gabriel Loewen commented on JENKINS-49723 Re: Powershell execution within GIT Multibranch pipeline failing Oh! That changes my prior assumption then. I do not know what kind of path issues we would hit in pipeline because there is no difference with how we execute powershell in pipeline from how it is executed in the powershell freestyle plugin except that in pipeline we add the -NoProfile command line argument as a security and performance measure to prevent powershell from automatically executing profile scripts. But, it's not even getting to that point... I'll have to investigate this further to understand what is happening here. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49723) Powershell execution within GIT Multibranch pipeline failing
Title: Message Title Gabriel Loewen commented on JENKINS-49723 Re: Powershell execution within GIT Multibranch pipeline failing That's not surprising, since the powershell plugin for freestyle jobs and in pipeline are not related Just to be clear, if you execute "powershell" without a .exe extension from a powershell prompt it fails? If this is the case then I can submit a small PR to always call powershell with extension Sam Van Oort. The reason that I did this was to avoid having separate code paths for windows powershell and open powershell since executing "powershell" without the added .exe extension worked fine on all versions of windows in my testing, and there is no concept of file extension in *nix platforms. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49723) Powershell execution within GIT Multibranch pipeline failing
Title: Message Title Gabriel Loewen commented on JENKINS-49723 Re: Powershell execution within GIT Multibranch pipeline failing Hmm, this is interesting. It looks like you are unable to launch powershell from a powershell session, or perhaps in Server 2008 you cannot launch an executable within the system path without adding the .exe extension? Could you open a powershell prompt and execute "powershell.exe" and let me know if that works? This could be a compat issue. When this was tested I made sure to test it on Windows Server 2012 R2, Windows Server 2016, Windows 10, and Windows 8 and I did not see this issue in any of those. Also, can you tell me what version of powershell you are using on Server 2008? Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen commented on JENKINS-50029 Re: Powershell treats warnings as errors Here is a reference to PowerShell preference variables: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6 Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen commented on JENKINS-50029 Re: Powershell treats warnings as errors E.g. the error stream is technically ignored if your error action proference is not set to "Stop" Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen commented on JENKINS-50029 Re: Powershell treats warnings as errors Write-Error does not typically fail a PowerShell script unless you set ErrorActionPreference to "Stop" or explicitly pass -ErrorAction to the cmdlet. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50456) Pipeline continues after powershell error
Title: Message Title Gabriel Loewen commented on JENKINS-50456 Re: Pipeline continues after powershell error This isn't really a pipeline bug. In PowerShell there is a concept of terminating and non-terminating errors, and your error preference is controlled via the preference variable $ErrorActionPreference for a script scoped change, or by passing -ErrorAction to the cmdlet you are using. The system default is "Continue", which is why your errors seem to be ignored. By passing a value of "Stop" you should see the behavior that you expect. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38442) Support nested stages in the Pipeline Graph
Title: Message Title Gabriel Loewen commented on JENKINS-38442 Re: Support nested stages in the Pipeline Graph Something that I find interesting is that nested stage visualizations kind of work while your pipeline is running and when your nested stage is created within a script block. If I have some pipeline code such as the following: pipeline { agent any stages { stage("Testing") { steps { script { stage("A") { parallel "1": { println "1" sleep 500 }, "2": { println "2" sleep 500 }, "3": { println "3" sleep 500 } } } } } } } Then while this pipeline is running I see the following in Blue Ocean: But after the pipeline finishes the nested stage and the parent stage get merged: What would be really great is if the visualization that I see while the pipeline is running does not change when the pipeline finishes. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group
[JIRA] (JENKINS-38442) Support nested stages in the Pipeline Graph
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-38442 Support nested stages in the Pipeline Graph Change By: Gabriel Loewen Attachment: After.png Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38442) Support nested stages in the Pipeline Graph
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-38442 Support nested stages in the Pipeline Graph Change By: Gabriel Loewen Attachment: Before.PNG Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen commented on JENKINS-50029 Re: Powershell treats warnings as errors No, nothing else pending from me. Just trying to fix the bugs as quickly as I find them Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen assigned an issue to Gabriel Loewen Jenkins / JENKINS-50029 Powershell treats warnings as errors Change By: Gabriel Loewen Assignee: Gabriel Loewen Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen edited a comment on JENKINS-50029 Re: Powershell treats warnings as errors Actually, from the context of PowerShell it is an error. You are executing a native command and that command is producing what PowerShell is interpreting as an error, which is written to the error stream and then caught by the PowerShell pipeline step. You can test this out for yourself in a PowerShell session by executing that command and then checking the error history in $Error, which is a PowerShell automatic variable containing an array of errors. Normally this would be a non-fatal error, but because of an issue with how errors are handled in the PowerShell pipeline step it is treated as a fatal error and exiting.[~svanoort] I have submitted a PR that fixes this issue, [67| {color:#33} [ https://github.com/jenkinsci/durable-task-plugin/pull/67 ] {color} ] , so it should be fixed as soon as that PR is merged and a new version is cut :) Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50029) Powershell treats warnings as errors
Title: Message Title Gabriel Loewen commented on JENKINS-50029 Re: Powershell treats warnings as errors Actually, from the context of PowerShell it is an error. You are executing a native command and that command is producing what PowerShell is interpreting as an error, which is written to the error stream and then caught by the PowerShell pipeline step. You can test this out for yourself in a PowerShell session by executing that command and then checking the error history in $Error, which is a PowerShell automatic variable containing an array of errors. Normally this would be a non-fatal error, but because of an issue with how errors are handled in the PowerShell pipeline step it is treated as a fatal error and exiting. Sam Van Oort I have submitted a PR that fixes this issue, [67|https://github.com/jenkinsci/durable-task-plugin/pull/67], so it should be fixed as soon as that PR is merged and a new version is cut Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen edited a comment on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step What I can do is try to get the best of both worlds. If the user wants stdout then I can redirect all other streams to the console log without stream designations, otherwise it can continue with the current behavior. How does that sound?e.g.{code:java}def stdout = powershell returnStdout:true, script: ''' Write-Output "Hello, World!" Write- Verbost Verbose "Verbose output"'''println "stdout = $stdout"{code}Would yield:{noformat}Verbose outputstdout = Hello, World!{noformat}But,{code:java}powershell ''' Write-Output "Hello, World!" Write- Verbost Verbose "Verbose output"'''{code}Would yield:{noformat}Hello, World!VERBOSE: Verbose output{noformat} Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen edited a comment on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step What I can do is try to get the best of both worlds. If the user wants stdout then I can redirect all other streams to the console log without stream designations, otherwise it can continue with the current behavior. How does that sound?e.g.{code:java}def stdout = powershell returnStdout:true, script: ''' Write-Output "Hello, World!" Write-Verbost "Verbose output"'''println "stdout = $stdout"{code}Would yield:{noformat}Verbose outputstdout = Hello, World!{noformat}But,{code:java}powershell ''' Write-Output "Hello, World!" Write-Verbost "Verbose output"'''{code}Would yield:{noformat}Hello, World!VERBOSE: Verbose output{noformat} Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step You're welcome Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step I've sent a PR: https://github.com/jenkinsci/durable-task-plugin/pull/64 Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen assigned an issue to Gabriel Loewen Jenkins / JENKINS-49754 Streams other than StdOut getting returned when using returnStdOut on PowerShell Step Change By: Gabriel Loewen Assignee: Gabriel Loewen Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen edited a comment on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step What I can do is try to get the best of both worlds. If the user wants stdout then I can redirect all other streams to the console log without stream designations, otherwise it can continue with the current behavior. How does that sound?e.g. {code:java}def stdout = powershell ''' Write-Output "Hello, World!" Write-Verbost "Verbose output"'''println "stdout = $stdout"{code}Would yield: {noformat}Verbose outputstdout = Hello, World!{noformat}But, {code:java}powershell ''' Write-Output "Hello, World!" Write-Verbost "Verbose output"'''{code}Would yield: {noformat}Hello, World!VERBOSE: Verbose output{noformat} Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step What I can do is try to get the best of both worlds. If the user wants stdout then I can redirect all other streams to the console log without stream designations, otherwise it can continue with the current behavior. How does that sound? e.g. def stdout = powershell ''' Write-Output "Hello, World!" Write-Verbost "Verbose output" ''' println "stdout = $stdout" Would yield: Verbose output stdout = Hello, World! But, powershell ''' Write-Output "Hello, World!" Write-Verbost "Verbose output" ''' Would yield: Hello, World! VERBOSE: Verbose output Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen edited a comment on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step There are a few issues with your example. ">" is just an alias for "Out-File", which by default adds a UTF-8 BOM. PowerShell handles the BOM internally very nicely, but it is not good for cross compatibility between PowerShell and Java. Also, in your example you capture output from the script and buffer it into memory. Output has to be immediately piped to disk because we want to ensure that the job is responsive, and to prevent overuse of memory, etc. Yes, your example works, but not as it is intended to work in pipeline because once you modify your code slightly to write to disk you'll see that the output change changes to the behavior that I am describing. For example, here is the same code, but with a simple piped output to disk:{code:java}$(& C:\temp\script.ps1) 2>&1 3>&1 4>&1 5>&1 6>&1 | Out-File output.txt{code}Which produces the following output.txt contents:{noformat}This is written to hostThis is written to Success outputC:\temp\script.ps1 : This is an errorAt line:1 char:3+ $(& C:\temp\script.ps1) 2>&1 3>&1 4>&1 5>&1 6>&1 | ...+ ~~+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,test2.ps1 This is a warning messageThis is verbose output{noformat}If we were to take your example and buffer the output in memory before writing it to disk then we'd open ourselves up to a heap of new issues :)If you want to see how this is all working now you can take a look at the following script:[https://github.com/jenkinsci/durable-task-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/durabletask/powershellHelper.ps1]Thanks,Gabriel Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step There are a few issues with your example. ">" is just an alias for "Out-File", which by default adds a UTF-8 BOM. PowerShell handles the BOM internally very nicely, but it is not good for cross compatibility between PowerShell and Java. Also, in your example you capture output from the script and buffer it into memory. Output has to be immediately piped to disk because we want to ensure that the job is responsive, and to prevent overuse of memory, etc. Yes, your example works, but not as it is intended to work in pipeline because once you modify your code slightly to write to disk you'll see that the output change to the behavior that I am describing. For example, here is the same code, but with a simple piped output to disk: $(& C:\temp\script.ps1) 2>&1 3>&1 4>&1 5>&1 6>&1 | Out-File output.txt Which produces the following output.txt contents: This is written to host This is written to Success output C:\temp\script.ps1 : This is an error At line:1 char:3 + $(& C:\temp\script.ps1) 2>&1 3>&1 4>&1 5>&1 6>&1 | ... + ~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,test2.ps1 This is a warning message This is verbose output If we were to take your example and buffer the output in memory before writing it to disk then we'd open ourselves up to a heap of new issues If you want to see how this is all working now you can take a look at the following script: https://github.com/jenkinsci/durable-task-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/durabletask/powershellHelper.ps1 Thanks, Gabriel Add Comment
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step There are a couple things that can be done. I can revert the change that wraps user scripts, but this will introduce a bug that strips out all stream designations from the output. If you look at the non-pipeline PowerShell build step you'll see that they also create a wrapper script, and the behavior is the same. The only difference is that there is obviously no returnStdout option, which is why the issue is now getting exposed in pipeline. I can intercept output right before it is written to the output file (which is what is read when you use returnStdout) to check for stream designations, and if the pattern match succeeds then just I can easily pass the input through to the console log file. That check can be as easy as a simple regex: $keywordMatch = $Input -match "^(VERBOSE|WARNING|DEBUG):(.*)$" But, this would cause a side effect of misinterpreting regular console output as special streams. For instance: Write-Host "VERBOSE: This is actually not a verbose stream" Normally this would be sent to stdout, but now it would incorrectly be treated as a special stream. Both of these introduce a side effect. Sam Van Oort, Andrew Bayer, James Nord, do any of you have a preference for this issue? Thanks, Gabriel Add Comment
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen edited a comment on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step There are a couple things that can be done. # I can revert the change that wraps user scripts, but this will introduce a bug that strips out all stream designations from the output. If you look at the non-pipeline PowerShell build step you'll see that they also create a wrapper script, and the behavior is the same. The only difference is that there is obviously no returnStdout option, which is why the issue is now getting exposed in pipeline. # I can intercept output right before it is written to the output file (which is what is read when you use returnStdout) to check for stream designations, and if the pattern match succeeds then just I can easily pass the input through to the console log file. That check can be as easy as a simple regex:{code:java}$keywordMatch = $Input -match "^(VERBOSE|WARNING|DEBUG):(.*)$"{code}But, this would cause a side effect of misinterpreting regular console output as special streams. For instance:{code:java}Write-Host "VERBOSE: This is actually not a verbose stream"{code}Normally this would be sent to stdout, but now it would incorrectly be treated as a special stream.{color:#33}Both of these introduce a side effect.{color}[~svanoort], [~abayer], [~teilo], do any of you have a preference for this issue?Thanks,Gabriel Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving
[JIRA] (JENKINS-49754) Streams other than StdOut getting returned when using returnStdOut on PowerShell Step
Title: Message Title Gabriel Loewen commented on JENKINS-49754 Re: Streams other than StdOut getting returned when using returnStdOut on PowerShell Step Jared Kauppila I think this is a side effect caused by the bugfixes that just came in 1.18. What is happening is that when PowerShell scripts are executed and the output is piped to the log files used by Jenkins for console and error output the stream designations are lost. What I mean is that if you run the following script: // script.ps1 $VerbosePreference = "Continue" Write-Output "Hello" Write-Verbose "World" ps> & script.ps1 *> result.txt You'll see the following output: Hello World Whereas what you'd expect to see is: Hello VERBOSE: World The fix for this was to wrap up the execution of this in another script. // wrapper.ps1 & script.ps1 ps> & wrapper.ps1 *> result.txt Which produces the result as you would expect, including the stream designation. The side effect of this is that essentially all streams get merged into stdout except for the stderr, which of course is separate. Is this issue a major blocker for you? Thanks, Gabriel Add Comment
[JIRA] (JENKINS-34581) Please add support for Pipelines to the Powershell plugin
Title: Message Title Gabriel Loewen updated JENKINS-34581 Jenkins / JENKINS-34581 Please add support for Pipelines to the Powershell plugin Change By: Gabriel Loewen Status: In Progress Review Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-34581) Please add support for Pipelines to the Powershell plugin
Title: Message Title Gabriel Loewen updated JENKINS-34581 Jenkins / JENKINS-34581 Please add support for Pipelines to the Powershell plugin Change By: Gabriel Loewen Status: In Review Progress Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-34581) Please add support for Pipelines to the Powershell plugin
Title: Message Title Gabriel Loewen commented on JENKINS-34581 Re: Please add support for Pipelines to the Powershell plugin @Marley Kudiabor - Please don't build out of my repo as the plugin may have changes made during the review process. This needs to be fully vetted and accepted into the maintained repository. So you should wait for the official support. I have submitted 2 pull requests for review: https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/35 https://github.com/jenkinsci/durable-task-plugin/pull/39 Thanks, Gabriel Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-34581) Please add support for Pipelines to the Powershell plugin
Title: Message Title Gabriel Loewen commented on JENKINS-34581 Re: Please add support for Pipelines to the Powershell plugin My changes are in the following repositories: https://github.com/gabloe/durable-task-plugin https://github.com/gabloe/workflow-durable-task-step-plugin All unit tests are passing during build, and I've tested it in Jenkins using some example pipeline code (See attached screenshots). Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-34581) Please add support for Pipelines to the Powershell plugin
Title: Message Title Gabriel Loewen updated an issue Jenkins / JENKINS-34581 Please add support for Pipelines to the Powershell plugin Change By: Gabriel Loewen Attachment: input.png Attachment: result.PNG Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.