-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return the stderr stream with "Bash wrote one or more lines to the standard error stream." for troubleshooting #6840
Comments
it should be in the log, correct? |
queue: hosted linux preview
steps:
- bash: echo hello from stderr 1>&2
failOnStderr: true |
Yes, it writes it to the log Reactivate if you're not seeing it in the log |
@bryanmacfarlane, We are not seeing the error in the logs, please, reactivate. |
@farrukh-normuradov can you download the logs zip and check there? Sometimes the streaming console can miss a web event. But I would expect to see the error in the downloaded log. |
@ericsciple, I did that. The logs file contains the same logs that are presented through the UI. I also turned on debug mode and agent diagnostics. The only error containing phrase is this: I search for "err" in the logs and do not find an error. I ran build multiple times. Some extra info:
|
It is very difficult to differentiate standard output and error stream, please improve your output log, for easy identification of the error in a long output of mixed streams. Suggestion add a prefix:
|
@ericsciple |
+1 on the issue. Unable to find the errors. It is an "ant" command that is run inside the bash task. Build is successful but bash complains of errors. Error: #[error]Bash wrote one or more lines to the standard error stream. Task : Bash Workaround: works fine if "Fail on Standard Error" this is not checked. |
We have 5000 lines of output in a build that succeeds completely, but that prints this error and marks the build as failed. It is impossible to figure out which of the 5000 lines was written to stderr. This is not a usable feature without a way to distinguish stderr output from stdout output. If the UI could just color stderr output red, or call it out separately, or write it to a stdout.log file, or any of a number of things we could be easily unblocked. As a workaround we have added this to the end of our script run. It will print "STDERROR" before the lines that were printed to stderr, and the extra >&2 make sure the result is still actually printed to stderror so the build will fail. This is a pretty silly workaround, there should be a first class way of debugging this. |
Same issue. Running a shell script that completes and exits with 0 but the job/task fails with: But I run this script on multiple environment and 50% fails and the other 50% succeeds. |
Having the same error. Any idea?
|
Same problem here. Maybe it does indeed redirect the error to stdout, but since it's indistinguishable from the regular output there's no way of knowing which line that's the culprit. |
Yes @denravonska that is correct. The script I pasted above is intended to allow you to annotate the output of bash with STDERROR for anything that goes there, for example
Will print
This has been invaluable for my team to diagnose what actually failed when shelling our to a sufficiently complex command. I suggest you folks bang on PR #9391 since @damccorm made a simple fix for this a year ago that is being soundly ignored and simply needs to be looked at by an area owner at Microsoft like @stephenmichaelf @jtpetty. |
@benbuzbee Thanks, I'll try it out. I just assumed that failure triggers would verbosely be printed in the logs. Edit: like all other CI systems. |
@benbuzbee Your suggestion worked perfectly, without it I would have had no idea how to track down the issue. It goes to show how important such a trivial feature is to the users. |
@bryanmacfarlane was this issue ever fixed? |
This issue still needs to be fixed for AzureCLI@2 tasks |
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Environment
Server - VSTS or TFS on-premises?
Agent - Hosted or Private:
Issue Description
When a release task is set to fail on stderr, not enough feedback is provided on failure to troubleshoot the problem.
The only feedback is "Bash wrote one or more lines to the standard error stream."
This makes it very difficult to troubleshoot those errors. It would be nice to have the stderr output.
Right here, it looks like you could accumulate the data (stderr stream) into a string, then pass it along with the error message.
https://github.com/Microsoft/vsts-tasks/blob/b6ca8a23cbdc5f825ebe3d260664073e079f1f1e/Tasks/CmdLine/cmdline.ts#L50-L52
I'm currently looking for a workaround to get those error messages, as they aren't being printed from my scripts.
The text was updated successfully, but these errors were encountered: