Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastlane error 65 on Jenkins or remote login

Tags:

ios

fastlane

I am aware this is known issue, and answers were attempted couple of times, but this time I found conditions which I feel are strange. The logs tell the dreaded Error 65 and errSecInternalComponent when code-signing first Pod.

  • When running on Jenkins, my build FAILS.
  • When running manually on CI machine, logging via SSH and executing bundle exec fastlane appstore, it FAILS
  • When I log in on remote desktop, or physically access the CI machine, build SUCCEEDS.

I have security unlock-keychain command included in shell script to right before building.

bundle update
export FASTLANE_DISABLE_COLORS=1
export APP_IDENTIFIER=com.example.MyApp
security unlock-keychain -p topsecret ~/Library/Keychains/codesign.keychain && bundle exec fastlane appstore

I also tried other voodoo, like doing other magic with keychain

When ran directly on CI server console (or via remote desktop) it runs flawlessly, not prompting for user passwords etc. I wonder what makes the difference?

Fastlane version is 2.106.0 (up to date).

The build fails like for other users, when executing Embed Pods Frameworks:

▸ Running script '[CP] Embed Pods Frameworks'
** ARCHIVE FAILED **


The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/ci/Library/Developer/Xcode/DerivedData/BackOffice-gprttmucbsbjiifnxdulcnwierfb/Build/Intermediates.noindex/ArchiveIntermediates/BackOffice_AppStore/IntermediateBuildFilesPath/BackOffice.build/Release-iphoneos/BackOffice.build/Script-7E4F6707694226143D2E7E0B.sh
(1 failure)
[15:59:39]: Exit status: 65

+---------------+-------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.106.2                 |
| export_method | app-store               |
| sdk           | iPhoneOS11.4.sdk        |
+---------------+-------------------------+

[15:59:39]: ▸ total size is 481485  speedup is 1.00
[15:59:39]: ▸ Code Signing /Users/ci/Library/Developer/Xcode/DerivedData/BackOffice-gprttmucbsbjiifnxdulcnwierfb/Build/Intermediates.noindex/ArchiveIntermediates/BackOffice_AppStore/InstallationBuildProductsLocation/Applications//BackOffice.app/Frameworks/ACEExpandableTextCell.framework with Identity iPhone Distribution: MyCompany Inc. (XXXXXXXXXX)
[15:59:39]: ▸ /usr/bin/codesign --force --sign CB480CDBA0169C56DA9597D6941095F254D89B3B  --preserve-metadata=identifier,entitlements '/Users/ci/Library/Developer/Xcode/DerivedData/BackOffice-gprttmucbsbjiifnxdulcnwierfb/Build/Intermediates.noindex/ArchiveIntermediates/BackOffice_AppStore/InstallationBuildProductsLocation/Applications//BackOffice.app/Frameworks/ACEExpandableTextCell.framework'
[15:59:39]: ▸ /Users/ci/Library/Developer/Xcode/DerivedData/BackOffice-gprttmucbsbjiifnxdulcnwierfb/Build/Intermediates.noindex/ArchiveIntermediates/BackOffice_AppStore/InstallationBuildProductsLocation/Applications//BackOffice.app/Frameworks/ACEExpandableTextCell.framework: errSecInternalComponent
[15:59:39]: ▸ Command /bin/sh failed with exit code 1
like image 988
Tomek Cejner Avatar asked Nov 08 '22 01:11

Tomek Cejner


1 Answers

I had the same issue on my Jenkins server. To fix it I used the following flag in my match action

keychain_password: "my_Mac_Password"

I took it out once I was able to make it work once.

You can also try the unlock_keychain action if you are not using match.

like image 127
Francois Nadeau Avatar answered Nov 15 '22 05:11

Francois Nadeau