Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Build Error Jenkins: Your session has expired. Please log in

I'm trying to build my application using jenkins pipeline using shell command. Below is the command i'm using to build the app.

sh 'xcodebuild -workspace projectname.xcworkspace - allowProvisioningUpdates -scheme projectname_UAT -sdk iphoneos - configuration Debug clean build'

Below is the error i'm getting i console.

note: Using new build system

note: Planning build

2018-10-11 11:19:36.638 xcodebuild[92399:5181481] DVTPortal: Service '' encountered an unexpected result code from the portal ('1100')

2018-10-11 11:19:36.638 xcodebuild[92399:5181481] DVTPortal: Error:

Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={type = mutable dict, count = 9,

entries =>

0 : responseId = <CFString 0x7ff48deef220 [0x7fff94b6daf0]>{contents = "40d9ad44-c951-49da-b3f3-b3ea434765a1"}

2 : <CFString 0x7fff94a90b58 [0x7fff94b6daf0]>{contents = "protocolVersion"} = QH65B2

3 : <CFString 0x7ff48dea3420 [0x7fff94b6daf0]>{contents = "requestUrl"} = <CFString 0x7ff48de3d9a0 [0x7fff94b6daf0]>{contents = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action"}

6 : <CFString 0x7ff48dec8c30 [0x7fff94b6daf0]>{contents = "userLocale"} = en_US

8 : resultCode = <CFNumber 0x44c37 [0x7fff94b6daf0]>{value = +1100, type = kCFNumberSInt64Type}

9 : userString = <CFString 0x7ff48ded0cc0 [0x7fff94b6daf0]>{contents = "Your session has expired.  Please log in."}

10 : <CFString 0x7ff48dea94d0 [0x7fff94b6daf0]>{contents = "resultString"} = <CFString 0x7ff48de648e0 [0x7fff94b6daf0]>{contents = "authentication.failed"}

11 : httpCode = <CFNumber 0xc837 [0x7fff94b6daf0]>{value = +200, type = kCFNumberSInt64Type}

12 : <CFString 0x7ff48de340f0 [0x7fff94b6daf0]>{contents = "creationTimestamp"} = <CFString 0x7ff48de9a7d0 [0x7fff94b6daf0]>{contents = "2018-10-11T10:19:36Z"}

}

I have even tried removing the developer account from my xcode preferences in local xcode and as well as in my jenkins installed machine. I have re-added it again. Also Deleted the already logged in session from Keychain App in both places(local keychain, remote keychain) But nothing seems to help me out. I'm working with Xcode10, Mac OS Mojave,What might be the issue, any help is appreciated. Thank you.

like image 661
Madhu Avatar asked Oct 11 '18 10:10

Madhu


3 Answers

This helped fix the problem with Jenkins running a slave with ssh:

  1. Remove the account via Xcode's preferences
  2. Quit Xcode
  3. In terminal, set the preference to not use the keychain service: defaults write com.apple.dt.Xcode DVTDeveloperAccountUseKeychainService_2 -bool NO
  4. Re-open Xcode and re-add the account

Source: https://forums.developer.apple.com/thread/112606

like image 111
js.mouret Avatar answered Nov 11 '22 00:11

js.mouret


Had this problem as well on one Jenkins build slave dedicated to building one specific app (for iOS and Android). The Mac was on Mojave and Xcode 10.1

The fix appeared to be logging on to the Mac, and exporting the archive created by Jenkins using the Xcode UI, not xcodebuild. After doing that, the next Jenkins build when through without a problem. I say appeared to be because I didn't do anything else to the Jenkins job or the slave, and it had been failing consistently before that. Seems odd, but there you have it.

This specific problem didn't occur on build slaves building other apps, but these other slaves, while using Xcode 10.1, were on High Sierra. We have had other odd behaviors on all iOS builds since Apple merged Apple Developer and App Store Connect, however.

like image 2
Lonnie Brownell Avatar answered Nov 11 '22 00:11

Lonnie Brownell


I have had a similar problem for weeks. Since updating to Xcode 10 every aspect of the build Jenkins did would be successful except I would get that error and the build would fail. Directly building, signing, etc. in Xcode was fine.

The solution in my case was the Xcode 10.1 update. The errors you list still exist in the Jenkins output. However it no longer causes Jenkins to fail the build.

Sadly I don't actually know what caused the failure so I don't have any further insight.

like image 1
ajso Avatar answered Nov 11 '22 00:11

ajso