fastlane: invalid byte sequence in US-ASCII (ArgumentError)

I’m running a lane that works fine on my development machine, but fails on our Jenkins machine. The Jenkins machine has the latest XCode (6.3.1) with ruby setup via rbenv. bundle install was run before running fastlane and fastlane was run using bundle exec fastlane dev.

The error I’m getting is:

[37mINFO [2015-04-24 10:19:41.60]: -----------------
INFO [2015-04-24 10:19:41.60]: --- Step: ipa ---
INFO [2015-04-24 10:19:41.60]: -----------------
DEBUG [2015-04-24 10:19:41.60]: set -o pipefail && ipa build -w "<snip>.xcworkspace" -s "<snip>" -d "./build" -m "/Users/ribot/.jenkins/jobs/<snip>-ios-nightly/workspace/build/profile.mobileprovision" --verbose | xcpretty
INFO [2015-04-24 10:19:41.60]: [SHELL COMMAND]: set -o pipefail && ipa build -w "<snip>.xcworkspace" -s "<snip>" -d "./build" -m "/Users/ribot/.jenkins/jobs/<snip>-ios-nightly/workspace/build/profile.mobileprovision" --verbose | xcpretty
/Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:68:in `strip': invalid byte sequence in US-ASCII (ArgumentError)
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:68:in `block (2 levels) in sh_no_action'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:67:in `each'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:67:in `block in sh_no_action'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:66:in `popen'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:66:in `sh_no_action'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:56:in `sh'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/ipa.rb:64:in `run'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/fast_file.rb:112:in `block (2 levels) in method_missing'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/fast_file.rb:94:in `block in method_missing'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/fast_file.rb:93:in `chdir'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/fast_file.rb:93:in `method_missing'
    from (eval):20:in `block (3 levels) in parse'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/runner.rb:34:in `call'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/runner.rb:34:in `block in execute'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/runner.rb:24:in `chdir'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/runner.rb:24:in `execute'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/lib/fastlane/lane_manager.rb:33:in `cruise_lane'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/bin/fastlane:39:in `block (2 levels) in run'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/command.rb:178:in `call'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/command.rb:178:in `call'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/command.rb:153:in `run'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/runner.rb:428:in `run_active_command'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/runner.rb:68:in `run!'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.3/lib/commander/delegates.rb:15:in `run!'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/bin/fastlane:118:in `run'
    from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-0.12.4/bin/fastlane:124:in `<top (required)>'
    from /Users/ribot/.rbenv/versions/2.1.2/bin/fastlane:23:in `load'
    from /Users/ribot/.rbenv/versions/2.1.2/bin/fastlane:23:in `<main>'
INFO [2015-04-24 10:19:46.82]: [SHELL OUTPUT]: 2015-04-24 10:19:46.824 xcodebuild[5102:18549] [MT] iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed." UserInfo=0x7f980ad0dea0 {NSLocalizedFailureReason=A connection to the simulator verification service could not be established., NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled., NSLocalizedDescription=Simulator verification failed.}
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/lib/xcpretty/parser.rb:350:in `===': invalid byte sequence in US-ASCII (ArgumentError)
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/lib/xcpretty/parser.rb:350:in `update_test_state'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/lib/xcpretty/parser.rb:247:in `parse'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/lib/xcpretty/formatters/formatter.rb:78:in `pretty_format'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/lib/xcpretty/printer.rb:15:in `pretty_print'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/bin/xcpretty:80:in `block in <top (required)>'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/bin/xcpretty:79:in `each_line'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/xcpretty-0.1.9/bin/xcpretty:79:in `<top (required)>'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/bin/xcpretty:23:in `load'
INFO [2015-04-24 10:19:48.99]: [SHELL OUTPUT]: from /Users/ribot/.rbenv/versions/2.1.2/bin/xcpretty:23:in `<main>'
INFO [2015-04-24 10:20:45.70]: Variable Dump:
INFO [2015-04-24 10:20:45.70]: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>nil, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios dev", :GIT_NOTES_LOCATION=>"build/git_notes.txt", :CERT_FILE_PATH=>"/tmp/cert/<snip>.cer", :CERT_CERTIFICATE_ID=>"<snip>", :SIGH_PROFILE_PATH=>"/Users/ribot/.jenkins/jobs/<snip>-ios-nightly/workspace/build/profile.mobileprovision", :SIGH_UDID=>"45f742bf-9078-4112-a56b-f0cad54fb785"}

Any ideas what could be causing this?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20 (7 by maintainers)

Most upvoted comments

I had the same error message, my locale was not UTF-8, I tried this from https://stackoverflow.com/questions/7165108/in-osx-lion-lang-is-not-set-to-utf8-how-fix and solved the issue:

  1. Modified/created a ‘.profile’
nano ~/.profile
  1. added these two lines to .profile:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

change en_US.UTF-8 to whatever country you are, just check first if available via ‘locale -a’

  1. close the session, reopen it

  2. Brew doctor clears the error message

Just ran into this issue when running fastlane from a Jenkins build. Setting LC_ALL=en_US.UTF-8 in the Jenkins configuration resolved the issue.

jenkins-environment-variable

I added

# We want all files to be UTF8, just in case user has it wrongly configured
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

into fastlane_core.rb. Since this problem occurs only when shelling out commands, this should be called in time before executing any external commands. What do you think @milch?