Jenkins xcodebuild -exportArchive error "Your session has expired. Please log in."

MacOS14.0 Xcode15.1(已登录开发者账号)

Build with Jenkins(fastlane)

1.刚登录开发者账号几个小时内,功能正常;而后使用Jenkins构建时会出现"Your session has expired. Please log in." 2.如果我在出现错误后,手动打开以下Xcode,而后再进行Jenkins构建,则不会出现错误;(但如果之后关闭Xcode,过一段时间错误还会复现)

+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/8x/c3qf2sz95jd40fk49d5dbg400000gn/T/gym_config20240119-38953-jl7k5y.plist -archivePath '/Users/smg_ios/Library/Developer/Xcode/Archives/2024-01-19/WinTaxProject 2024-01-19 13.45.59.xcarchive' -exportPath /var/folders/8x/c3qf2sz95jd40fk49d5dbg400000gn/T/gym_output20240119-38953-3u2rch -allowProvisioningUpdates

2024-01-19 13:47:15.691 xcodebuild[44905:206740]  DVTPortal: Service '<DVTPortalViewDeveloperService: 0x6000024d3400; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')
2024-01-19 13:47:15.691 xcodebuild[44905:206740]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
    creationTimestamp = "2024-01-19T05:47:15Z";
    httpCode = 200;
    protocolVersion = QH65B2;
    requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
    responseId = "29bf9da6-b667-4025-bd1f-09de9f5c76f1";
    resultCode = 1100;
    resultString = "Your session has expired. Please log in.";
    userLocale = "en_US";
    userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}

Same on Xcode 15.3 with a non-Jenkins custom system also running xcodebuild -exportArchive, to upload to TestFlight. The failure does NOT occur if Xcode Preferences > Accounts has recently been opened on the Mac running xcodebuild (because this loads the same developer account). We are using an App Store Connect API key for this authentication. The same key is always successful when used by notarytool.

Have the same issue with gitlab-runer version 17.4 on macOS 15, Xcode 16.

Jenkins xcodebuild -exportArchive error "Your session has expired. Please log in."
 
 
Q