1

i have wired behavior when the failOnStderr: true is not set in the task everything working fine BUT
when i invoke the script task like this with failOnStderr: true:

- script:  |
     echo 'Start invoking Fastfile'
     fastlane release --verbose projectName:${{parameters.projectName}} appIdentifier:${{parameters.appIdentifier}} versionNumber:${{parameters.versionNumber}} buildNumber:${{parameters.buildNumber}} plistFileFtpBasePath:${{parameters.plistFileFtpBasePath}} ArtifactsDirectory:$(System.ArtifactsDirectory)
     echo 'Done invoking Fastfile'
    failOnStderr: true 
    workingDirectory: '$(System.ArtifactsDirectory)/ios_artifacts'
    displayName: 'create keychain invoke fastlane'

I'm getting this errors :

2020-09-30T07:54:45.8179430Z INFO [2020-09-30 07:54:45.81]: [32mfastlane.tools finished successfully 🎉[0m
2020-09-30T07:54:45.8917310Z Done invoking Fastfile
2020-09-30T07:54:45.8948720Z 
2020-09-30T07:54:45.9020160Z ##[error]Bash wrote one or more lines to the standard error stream.
2020-09-30T07:54:45.9033610Z ##[error]/Users/runner/hostedtoolcache/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/fastlane-2.161.0/fastlane_core/lib/fastlane_core/ui/interface.rb:141: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/runner/hostedtoolcache/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/fastlane-2.161.0/fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb:9: warning: The called method `initialize' is defined here

2020-09-30T07:54:45.9035550Z ##[error]security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

2020-09-30T07:54:45.9037370Z ##[error]/Users/runner/hostedtoolcache/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/fastlane-2.161.0/gym/lib/gym/generators/package_command_generator_xcode7.rb:154: warning: URI.escape is obsolete

2020-09-30T07:54:45.9040080Z ##[error]/Users/runner/hostedtoolcache/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/fastlane-2.161.0/gym/lib/gym/generators/package_command_generator_xcode7.rb:155: warning: URI.escape is obsolete
/Users/runner/hostedtoolcache/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/fastlane-2.161.0/gym/lib/gym/generators/package_command_generator_xcode7.rb:156: warning: URI.escape is obsolete

2020-09-30T07:54:45.9042740Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_2019.1.4.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/1BD5CB31-31FC-328B-A827-73EA51BB6041.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9045210Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_1.1.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/9FCBA8ED-D8FD-3C16-9740-5E2A31F3E959.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9047670Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_1.1.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/999C2967-8A06-3CD5-82D7-D156E9440A0C.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9050110Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_1.1.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/EB7DF7BE-351D-3A4A-949C-0AE12606A3E2.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9052570Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_1.1.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/9702769F-1F06-3001-AB75-5AD38E1F7D66.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9055030Z ##[error]warning: /Users/runner/Library/Developer/Xcode/Archives/2020-09-30/xxxx_1.1.xxxx-xxxx.1.1.0.4_SPRINT_14 2020-09-30 07.51.27.xcarchive/BCSymbolMaps/D560471D-F43F-30D6-9717-5252EE100F10.bcsymbolmap: No such file or directory: not unobfuscating.

2020-09-30T07:54:45.9056620Z ##[error]Additional writes to stderr truncated
2020-09-30T07:54:45.9063410Z ##[section]Finishing: create keychain invoke fastlane

UPDATE when setting to false still not working

- script:  |
     echo 'Start invoking Fastfile'
     fastlane release --verbose projectName:${{parameters.projectName}} appIdentifier:${{parameters.appIdentifier}} versionNumber:${{parameters.versionNumber}} buildNumber:${{parameters.buildNumber}} plistFileFtpBasePath:${{parameters.plistFileFtpBasePath}} ArtifactsDirectory:$(System.ArtifactsDirectory)
     echo 'Done invoking Fastfile'
    failOnStderr: false
    workingDirectory: '$(System.ArtifactsDirectory)/ios_artifacts'
    displayName: 'create keychain invoke fastlane'

enter image description here

user63898
  • 29,839
  • 85
  • 272
  • 514

1 Answers1

5

This is an expected behavior.

Once you set failOnStderr: true, then task will fail if any errors are written to the StandardError stream.

enter image description here

Conversely, if failOnStderr is false, the failure of task will depends on the exit code. Task will fail while exit code is not 0.

As normal, you should have known that errors are written into stderr will not result in the exit code will be non-zero. The failOnStderr is true or false are two different failure conditions.

According to the log you shared:

2020-09-30T07:54:45.9020160Z ##[error]Bash wrote one or more lines to the standard error stream.

You can see there are some errors write into Stderr stream. At this moment, task failed as expected since you set failOnStderr to true.

Updated:

Sample:

Succeed with warning:

enter image description here

Failed with stderr:

enter image description here

Mengdi Liang
  • 17,577
  • 2
  • 28
  • 35
  • Thanks for your informative response, this all good and understood but what i meant is that when i set this property suddenly i have those errors to the stderr . without this property, everything is working fine and i DO not see the bash stderr in logs – user63898 Oct 01 '20 at 04:40
  • 1
    @user63898, if you do not set failOnStderr, as normal, those messages will display as **warning**. See my updated sample. – Mengdi Liang Oct 01 '20 at 05:07
  • I'm a bit confused, so to how can i fail this task when "REAL" application errors are rising? failOnStderr =false ? – user63898 Oct 01 '20 at 05:12
  • @user63898. yep! The real application errors should lead your process exit with non-zero. If you set failOnStderr =false for tasks, then tasks' failure will depend on tasks' **exit code**. – Mengdi Liang Oct 01 '20 at 05:18
  • Thanks, @Merlin Liang - MSFT can you please look into this question: https://stackoverflow.com/questions/64151412/azure-hosted-mac-pipeline-suggestion-on-how-to-make-it-faster-currently-very – user63898 Oct 01 '20 at 08:13
  • it didn't work when set to failOnStderr: false i got an error to the stdErr and the script task still successfully pass see image attached in the original question – user63898 Oct 01 '20 at 12:20
  • @user63898, I'm sure that if you reproduce this issue on your local machine, you would encounter same circumstance. Because you are calling fastlane in command line task, and fastlane do not think the "no profile" error is a fatal issue of the process. Then it continued the next sub-process until fastlane encounter an fatal error and terminate the execution of the process. – Mengdi Liang Oct 02 '20 at 10:00
  • its working just fine with fastlane , it compiles to iOS app which is working great . only when i set the Flag true or false the build got broken ... with not working , without working .... another idea can i configure the next task task: DownloadBuildArtifacts@0 to fail if no compilation products are found ? – user63898 Oct 02 '20 at 15:05
  • @user63898 I got that. Refer to this code snippet of cmd task: https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/CmdLineV2/cmdline.ts#L51. FailOnStderr flag will not be the cause of the error you faced. What I means is if you reproduce the same error on your local, you will see the execution process does not terminate by this error.(I know everything working fine on local, just discussing the scenario that why task is green with error ) Finally, we still need fix no profile issue. – Mengdi Liang Oct 02 '20 at 15:37
  • @user63898 For your second idea, where is this downloadbuildartifact task located? The first task of the next job? – Mengdi Liang Oct 02 '20 at 15:40
  • check this question you will see my pipeline, by the way, thanks for your help – user63898 Oct 03 '20 at 16:33