"DVTPortal: Error: Your session has expired" with xcodebuild

Hi,


I'm attempting to use xcodebuild to automate our release process. Because our build has an associated provisioning profile, I have added the `-allowProvisioningUpdates` flag to the xcodebuild command.


If I run my xcodebuild command while logged in locally to the build machine, Xcode's automatic process of downloading the correct prov profile appears to work - the archive completes succesfully.


However. If I ssh into the build machine and run the exact same xcodebuild command, I get the following error.



2019-10-08 00:04:50.828 xcodebuild[53165:1665565]  DVTPortal: Service '' encountered an unexpected result code from the portal ('1100')
2019-10-08 00:04:50.828 xcodebuild[53165:1665565]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired.  Please log in." UserInfo={payload={type = mutable dict, count = 9,
entries =>
  0 : responseId = {contents = "78442697-9dda-449d-90b7-cfc0d646fde4"}
  2 : {contents = "protocolVersion"} = QH65B2
  3 : {contents = "requestUrl"} = {contents = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action"}
  6 : {contents = "userLocale"} = en_US
  8 : resultCode = {value = +1100, type = kCFNumberSInt64Type}
  9 : userString = {contents = "Your session has expired.  Please log in."}
  10 : {contents = "resultString"} = {contents = "Your session has expired.  Please log in."}
  11 : httpCode = {value = +200, type = kCFNumberSInt64Type}
  12 : {contents = "creationTimestamp"} = {contents = "2019-10-07T22:04:50Z"}
}
, NSLocalizedDescription=Your session has expired.  Please log in.}


In my attempts to fix this issue I made sure the login keychain was unlocked using the `security` command, but it made no difference.


Is there any way of fixing this? Is it possible to log into the service via the command line?


The user I ssh in as is present in the Accounts pane of Xcode, but I guess this login is somehow "lost" over ssh.


Thanks in advance!


Heather.

did you find any solution to this .. i'm encountering the exact same problem

i've tried so many things to resolve it, but the error has not moved a bit, its the same everytime


Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload=<CFBasicHash 0x7faa8a912a70 [0x7fff918398f0]>{type = mutable dict, count = 9,

entries =>

0 : responseId = <CFString 0x7faa8a90f1d0 [0x7fff918398f0]>{contents = "c24ce81c-9ae8-4565-a97e-06706a1f31b1"}

2 : <CFString 0x7fff91896598 [0x7fff918398f0]>{contents = "protocolVersion"} = QH65B2

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

6 : <CFString 0x7faa8a913ca0 [0x7fff918398f0]>{contents = "userLocale"} = en_US

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

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

10 : <CFString 0x7faa8a912970 [0x7fff918398f0]>{contents = "resultString"} = <CFString 0x7faa8a914c70 [0x7fff918398f0]>{contents = "Your session has expired. Please log in."}

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

12 : <CFString 0x7faa8a912a00 [0x7fff918398f0]>{contents = "creationTimestamp"} = <CFString 0x7faa8a913bf0 [0x7fff918398f0]>{contents = "2019-11-15T17:01:16Z"}

}

, NSLocalizedDescription=Your session has expired. Please log in.}

2019-11-15 17:01:16.930 xcodebuild[98974:15883112] IDEDistribution: Failed to log in with account '<my_apple_id>' while checking for an App Store Connect account

error: exportArchive: Failed to log in.


If I run the same command from a terminal within this mac it runs without a problem

Hi, guys, i got this problem too when i use jenkins to archive/upload ipa, finally i found a solution: https://forums.developer.apple.com/thread/112606

related from: https://stackoverflow.com/questions/52757878/xcode-build-error-jenkins-your-session-has-expired-please-log-in

Maybe it can help. You can try.

One possible reason is that xcode was installed by another app id. Try to re-install xcode from app store using the new app id.

I sovled the error. In my case, I changed the password of my appid , then i encounted the error。 So i checked my account in Xcode,and found the tip “Your session has expired. Please log in”。 I logged back in my appid in Xcode and sovled the error。

"So i checked my account in Xcode,and found the tip “Your session has expired. Please log in” "

I run into this issue in another Mac Mini, which run task in Jenkins, in order to distribute app to TestFlight. And the account in Xcode, with tip "Your session has expired. Please log in", is my Mac for development of app.

When I logged back in my Mac, the issue in another Mac mini was gone. The task in Jenkins runs well now.

I solved this issue by going into Xcode > Preferences > Accounts.

I noticed I had 2 accounts - one was my business account which was properly logged in. The other was my personal account which was logged out. I deleted my personal account.

Then everything worked properly.

"DVTPortal: Error: Your session has expired" with xcodebuild
 
 
Q