Azure script task when failOnStderr: true , bash error arise which wasn't without this flag

11.9k views Asked by At

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

1

There are 1 answers

11
Mengdi Liang On

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